Commit 47ea9e75 authored by nextime's avatar nextime

Better panel_selector with any than dmdomain with content *

parent d7eb1826
ALTER TABLE `actions` ADD `select_domain` VARCHAR( 32 ) NOT NULL AFTER `launch_sequence_name` , ADD INDEX ( `select_domain` ) ; 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';
...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
include_once("common_includes.php"); include_once("common_includes.php");
$DEFPANELS = array(); $DEFPANELS = array();
$DEFPANELS[]=array('panel_title'=>'grandstream_left','panel_websections'=>'_grandstream_left','panel_type'=>'gxv3175_left','panel_content'=>'*')+$PANELDEFAULTS; $DEFPANELS[]=array('panel_title'=>'grandstream_left','panel_websections'=>'_grandstream_left','panel_type'=>'gxv3175_left',
$DEFPANELS[]=array('panel_title'=>'grandstream_center','panel_websections'=>'_grandstream_center','panel_type'=>'gxv3175_center','panel_content'=>'*')+$PANELDEFAULTS; 'panel_content'=>'','panel_selector'=>'any')+$PANELDEFAULTS;
$DEFPANELS[]=array('panel_title'=>'grandstream_right','panel_websections'=>'_grandstream_right','panel_type'=>'gxv3175_right','panel_content'=>'*')+$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( $colors=array(
'gray' => 'pure-button-active', 'gray' => 'pure-button-active',
......
...@@ -89,7 +89,7 @@ function getSectionElements($section, $table='relay', $activeonly=true) { ...@@ -89,7 +89,7 @@ function getSectionElements($section, $table='relay', $activeonly=true) {
/* NEW FUNCTIONS */ /* 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') if($table=='input')
{ {
...@@ -178,9 +178,9 @@ function getPanelIO($table, $content, $websection, $activeonly=true, $where="",$ ...@@ -178,9 +178,9 @@ function getPanelIO($table, $content, $websection, $activeonly=true, $where="",$
$sqlquery.=" AND"; $sqlquery.=" AND";
if($activeonly) if($activeonly)
$sqlquery.=" active>0"; $sqlquery.=" active>0";
if(($websection!="*" || $activeonly) && $content!="") if(($websection!="*" || $activeonly) && ($content!="" && $selector!="any"))
$sqlquery.=" AND"; $sqlquery.=" AND";
if($content!="") if($content!="" && $selector=='dmdomain')
{ {
$dmds=explode(',',$content); $dmds=explode(',',$content);
if(count($dmds)<2) if(count($dmds)<2)
...@@ -266,37 +266,35 @@ function getPanelButtons($user, $content, $sections="*", $websection="*", $selec ...@@ -266,37 +266,35 @@ function getPanelButtons($user, $content, $sections="*", $websection="*", $selec
} else { } else {
$sectar=explode(",",str_replace(" ","",$sections)); $sectar=explode(",",str_replace(" ","",$sections));
} }
if($selector=="dmdomain") foreach($sectar as $sect)
{ {
foreach($sectar as $sect) $res=array();
switch($sect)
{ {
$res=array(); case "relay":
switch($sect) $res=getPanelIO("relay", $selector, $content, $websection, $activeonly, "", "", $limit);
{ $buts=$buts+$res;
case "relay": break;
$res=getPanelIO("relay",$content, $websection, $activeonly, "", "", $limit); case "input":
$buts=$buts+$res; $res=getPanelIO("input", $selector, $content, $websection, $activeonly, "", "", $limit);
break; $buts=$buts+$res;
case "input": break;
$res=getPanelIO("input", $content, $websection, $activeonly, "", "", $limit); case "analog":
$buts=$buts+$res; $res=getPanelIO("analog",$selector, $content, $websection, $activeonly, "", "", $limit);
break; $buts=$buts+$res;
case "analog": break;
$res=getPanelIO("analog", $content, $websection, $activeonly, "", "", $limit); case "output":
$buts=$buts+$res; $res=getPanelIO("output",$selector, $content, $websection, $activeonly, "", "", $limit);
break; $buts=$buts+$res;
case "output": break;
$res=getPanelIO("output",$content, $websection, $activeonly, "", "", $limit); case "actions":
$buts=$buts+$res; $res=getPanelIO("actions",$selector ,$content, $websection, $activeonly, "", "", $limit);
break; $buts=$buts+$res;
case "actions": break;
$res=getPanelIO("actions",$content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
}
} }
} }
return $buts; return $buts;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment