0 ) { $newZone = dbFetchOne( "select * from Zones where MonitorId = ".dbEscape($mid)." and Id = ".dbEscape($zid) ); } else { $view = "error"; return; } $monitor = dbFetchMonitor ( $mid ); $plugin = dbEscape($_REQUEST['pl']); $plugin_path = dirname(ZM_PLUGINS_CONFIG_PATH)."/".$plugin; $focusWindow = true; xhtmlHeaders(__FILE__, $SLANG['Plugin'] ); $pluginOptions=array( 'Enabled'=>array( 'Type'=>'select', 'Name'=>'Enabled', 'Choices'=>'yes,no', 'Value'=>'no' ) ); $optionNames=array(); if(file_exists($plugin_path."/config.php")) { include_once($plugin_path."/config.php"); } $sql="SELECT * FROM PluginsConfig WHERE MonitorId=$mid AND ZoneId=$zid AND pluginName='$plugin'"; foreach( dbFetchAll( $sql ) as $popt ) { if(array_key_exists($popt['Name'], $pluginOptions) && $popt['Type']==$pluginOptions[$popt['Name']]['Type'] && $popt['Choices']==$pluginOptions[$popt['Name']]['Choices'] ) { $pluginOptions[$popt['Name']]=$popt; array_push($optionNames, $popt['Name']); } else { dbQuery("DELETE from PluginsConfig WHERE Id=".$popt['Id']); } } foreach($pluginOptions as $name => $values) { if(!in_array($name, $optionNames)) { $popt=$pluginOptions[$name]; $sql="INSERT INTO PluginsConfig VALUES ('',".dbEscape($popt['Name']).",".dbEscape($popt['Value']).", ".dbEscape($popt['Type']).",".dbEscape($popt['Choices']).",'$mid','$zid','$plugin')"; dbQuery($sql); } } $PLANG=array(); if(file_exists($plugin_path."/lang/".$user['Language'].".php")) { include_once($plugin_path."/lang/".$user['Language'].".php"); } function pLang($name) { global $PLANG; if(array_key_exists($name, $PLANG)) return $PLANG[$name]; else return $name; } ?>
$popt) { ?>
disabled="disabled"/>