Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
domotikad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
domotika
domotikad
Commits
47ea9e75
Commit
47ea9e75
authored
Jan 14, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better panel_selector with any than dmdomain with content *
parent
d7eb1826
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
32 deletions
+34
-32
90-actions_domain.sql
Databases/createdb/90-actions_domain.sql
+1
-0
index.php
Web/htdocs/gmi/index.php
+6
-3
libraries.php
Web/includes/libraries.php
+27
-29
No files found.
Databases/createdb/90-actions_domain.sql
View file @
47ea9e75
ALTER
TABLE
`actions`
ADD
`select_domain`
VARCHAR
(
32
)
NOT
NULL
AFTER
`launch_sequence_name`
,
ADD
INDEX
(
`select_domain`
)
;
ALTER
TABLE
`user_gui_panels`
CHANGE
`panel_selector`
`panel_selector`
ENUM
(
'any'
,
'dmdomain'
)
CHARACTER
SET
latin1
COLLATE
latin1_swedish_ci
NOT
NULL
DEFAULT
'any'
;
Web/htdocs/gmi/index.php
View file @
47ea9e75
...
...
@@ -2,9 +2,12 @@
include_once
(
"common_includes.php"
);
$DEFPANELS
=
array
();
$DEFPANELS
[]
=
array
(
'panel_title'
=>
'grandstream_left'
,
'panel_websections'
=>
'_grandstream_left'
,
'panel_type'
=>
'gxv3175_left'
,
'panel_content'
=>
'*'
)
+
$PANELDEFAULTS
;
$DEFPANELS
[]
=
array
(
'panel_title'
=>
'grandstream_center'
,
'panel_websections'
=>
'_grandstream_center'
,
'panel_type'
=>
'gxv3175_center'
,
'panel_content'
=>
'*'
)
+
$PANELDEFAULTS
;
$DEFPANELS
[]
=
array
(
'panel_title'
=>
'grandstream_right'
,
'panel_websections'
=>
'_grandstream_right'
,
'panel_type'
=>
'gxv3175_right'
,
'panel_content'
=>
'*'
)
+
$PANELDEFAULTS
;
$DEFPANELS
[]
=
array
(
'panel_title'
=>
'grandstream_left'
,
'panel_websections'
=>
'_grandstream_left'
,
'panel_type'
=>
'gxv3175_left'
,
'panel_content'
=>
''
,
'panel_selector'
=>
'any'
)
+
$PANELDEFAULTS
;
$DEFPANELS
[]
=
array
(
'panel_title'
=>
'grandstream_center'
,
'panel_websections'
=>
'_grandstream_center'
,
'panel_type'
=>
'gxv3175_center'
,
'panel_content'
=>
''
,
'panel_selector'
=>
'any'
)
+
$PANELDEFAULTS
;
$DEFPANELS
[]
=
array
(
'panel_title'
=>
'grandstream_right'
,
'panel_websections'
=>
'_grandstream_right'
,
'panel_type'
=>
'gxv3175_right'
,
'panel_content'
=>
''
,
'panel_selector'
=>
'any'
)
+
$PANELDEFAULTS
;
$colors
=
array
(
'gray'
=>
'pure-button-active'
,
...
...
Web/includes/libraries.php
View file @
47ea9e75
...
...
@@ -89,7 +89,7 @@ function getSectionElements($section, $table='relay', $activeonly=true) {
/* NEW FUNCTIONS */
function
getPanelIO
(
$table
,
$content
,
$websection
,
$activeonly
=
true
,
$where
=
""
,
$orderby
=
""
,
$limit
=
""
)
function
getPanelIO
(
$table
,
$
selector
,
$
content
,
$websection
,
$activeonly
=
true
,
$where
=
""
,
$orderby
=
""
,
$limit
=
""
)
{
if
(
$table
==
'input'
)
{
...
...
@@ -178,9 +178,9 @@ function getPanelIO($table, $content, $websection, $activeonly=true, $where="",$
$sqlquery
.=
" AND"
;
if
(
$activeonly
)
$sqlquery
.=
" active>0"
;
if
((
$websection
!=
"*"
||
$activeonly
)
&&
$content
!=
""
)
if
((
$websection
!=
"*"
||
$activeonly
)
&&
(
$content
!=
""
&&
$selector
!=
"any"
)
)
$sqlquery
.=
" AND"
;
if
(
$content
!=
""
)
if
(
$content
!=
""
&&
$selector
==
'dmdomain'
)
{
$dmds
=
explode
(
','
,
$content
);
if
(
count
(
$dmds
)
<
2
)
...
...
@@ -266,37 +266,35 @@ function getPanelButtons($user, $content, $sections="*", $websection="*", $selec
}
else
{
$sectar
=
explode
(
","
,
str_replace
(
" "
,
""
,
$sections
));
}
if
(
$selector
==
"dmdomain"
)
{
foreach
(
$sectar
as
$sect
)
{
$res
=
array
();
switch
(
$sect
)
{
case
"relay"
:
$res
=
getPanelIO
(
"relay"
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$res
=
getPanelIO
(
"relay"
,
$selector
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$buts
=
$buts
+
$res
;
break
;
case
"input"
:
$res
=
getPanelIO
(
"input"
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$res
=
getPanelIO
(
"input"
,
$selector
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$buts
=
$buts
+
$res
;
break
;
case
"analog"
:
$res
=
getPanelIO
(
"analog"
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$res
=
getPanelIO
(
"analog"
,
$selector
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$buts
=
$buts
+
$res
;
break
;
case
"output"
:
$res
=
getPanelIO
(
"output"
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$res
=
getPanelIO
(
"output"
,
$selector
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$buts
=
$buts
+
$res
;
break
;
case
"actions"
:
$res
=
getPanelIO
(
"actions"
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$res
=
getPanelIO
(
"actions"
,
$selector
,
$content
,
$websection
,
$activeonly
,
""
,
""
,
$limit
);
$buts
=
$buts
+
$res
;
break
;
}
}
}
return
$buts
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment