Handle when controls is not defined, like in WebSite monitors

pull/3751/head
Isaac Connor 2023-08-09 19:01:55 -04:00
parent 7aa229658b
commit 10d70022fe
1 changed files with 9 additions and 7 deletions

View File

@ -8,6 +8,7 @@ if (ZM_OPT_CONTROL and canView('Control')) {
var controlOptions = new Object();
<?php
global $controls;
if ($controls) {
foreach ($controls as $control) {
echo '
controlOptions['.$control->Id().'] = new Array();
@ -17,6 +18,7 @@ controlOptions['.$control->Id().'][0] = '.
echo 'controlOptions['. $control->Id().']['.$i.'] = \''.translate('Preset').' '.$i .'\';'.PHP_EOL;
}
} # end foreach row
}
} # end if ZM_OPT_CONTROL
?>