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 `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 @@
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',
......
......@@ -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)
{
foreach($sectar as $sect)
$res=array();
switch($sect)
{
$res=array();
switch($sect)
{
case "relay":
$res=getPanelIO("relay",$content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "input":
$res=getPanelIO("input", $content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "analog":
$res=getPanelIO("analog", $content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "output":
$res=getPanelIO("output",$content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "actions":
$res=getPanelIO("actions",$content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "relay":
$res=getPanelIO("relay", $selector, $content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "input":
$res=getPanelIO("input", $selector, $content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "analog":
$res=getPanelIO("analog",$selector, $content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "output":
$res=getPanelIO("output",$selector, $content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
case "actions":
$res=getPanelIO("actions",$selector ,$content, $websection, $activeonly, "", "", $limit);
$buts=$buts+$res;
break;
}
}
}
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