From 67f03ca954c72e0c6c2a2e0993a980b58082699c Mon Sep 17 00:00:00 2001 From: Jash Date: Tue, 17 Nov 2026 10:02:06 +0530 Subject: [PATCH] fix: give the cycle view's monitor data its zms url refs #6557 --- tests/php/test_cycle_monitordata_zms_url.php | 62 ++++++++++++++++++++ web/skins/classic/views/js/cycle.js.php | 1 + 2 files changed, 63 insertions(+) create mode 100644 tests/php/test_cycle_monitordata_zms_url.php diff --git a/tests/php/test_cycle_monitordata_zms_url.php b/tests/php/test_cycle_monitordata_zms_url.php new file mode 100644 index 0000000000..5321286109 --- /dev/null +++ b/tests/php/test_cycle_monitordata_zms_url.php @@ -0,0 +1,62 @@ + 'stream'); + $monitors = array(new FakeMonitor()); + ob_start(); + require __DIR__.'/../../web/skins/classic/views/js/cycle.js.php'; + $js = ob_get_clean(); + + check('monitorData carries the zms url', + preg_match("/'url_to_zms': 'https:\/\/zm\.example\/cgi-bin\/nph-zms\?monitor=7'/", $js), 1); + + echo "\n$passed passed, $failed failed\n"; + exit($failed ? 1 : 0); +} diff --git a/web/skins/classic/views/js/cycle.js.php b/web/skins/classic/views/js/cycle.js.php index 3fe6770c22..986abe820f 100644 --- a/web/skins/classic/views/js/cycle.js.php +++ b/web/skins/classic/views/js/cycle.js.php @@ -21,6 +21,7 @@ monitorData[monitorData.length] = { 'width': ViewWidth() ?>, 'height':ViewHeight() ?>, 'url': 'UrlToIndex()) ?>', + 'url_to_zms': 'UrlToZMS()) ?>', 'onclick': function(){window.location.assign( '?view=watch&mid=Id() ?>' );}, 'type': 'Type()) ?>', 'capturing': 'Capturing()) ?>',