From 10d70022fe23a34220db9896332becacc1312b80 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 9 Aug 2023 19:01:55 -0400 Subject: [PATCH] Handle when controls is not defined, like in WebSite monitors --- web/skins/classic/views/js/monitor.js.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/web/skins/classic/views/js/monitor.js.php b/web/skins/classic/views/js/monitor.js.php index 928e3d806..ff870a408 100644 --- a/web/skins/classic/views/js/monitor.js.php +++ b/web/skins/classic/views/js/monitor.js.php @@ -8,15 +8,17 @@ if (ZM_OPT_CONTROL and canView('Control')) { var controlOptions = new Object(); Id().'] = new Array(); controlOptions['.$control->Id().'][0] = '. - ( $control->HasHomePreset() ? '\''.translate('Home').'\'' : 'null' ).PHP_EOL; - for ( $i = 1; $i <= $control->NumPresets(); $i++ ) { - echo 'controlOptions['. $control->Id().']['.$i.'] = \''.translate('Preset').' '.$i .'\';'.PHP_EOL; - } - } # end foreach row + ( $control->HasHomePreset() ? '\''.translate('Home').'\'' : 'null' ).PHP_EOL; + for ( $i = 1; $i <= $control->NumPresets(); $i++ ) { + echo 'controlOptions['. $control->Id().']['.$i.'] = \''.translate('Preset').' '.$i .'\';'.PHP_EOL; + } + } # end foreach row + } } # end if ZM_OPT_CONTROL ?>