From afa31842b5352e2c5c7fe07aa223764ed454113d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 9 Jul 2018 12:28:39 -0400 Subject: [PATCH 1/3] spacing --- web/skins/classic/views/montage.php | 186 +++++++++++++++------------- 1 file changed, 103 insertions(+), 83 deletions(-) diff --git a/web/skins/classic/views/montage.php b/web/skins/classic/views/montage.php index 3c1110481..902ea1aae 100644 --- a/web/skins/classic/views/montage.php +++ b/web/skins/classic/views/montage.php @@ -27,7 +27,7 @@ require_once('includes/MontageLayout.php'); $showControl = false; $showZones = false; -if ( isset( $_REQUEST['showZones'] ) ) { +if ( isset($_REQUEST['showZones']) ) { if ( $_REQUEST['showZones'] == 1 ) { $showZones = true; } @@ -51,7 +51,7 @@ $scale = '100'; # actual if ( isset( $_REQUEST['scale'] ) ) { $scale = validInt($_REQUEST['scale']); Logger::Debug("Setting scale from request to $scale"); -} else if ( isset( $_COOKIE['zmMontageScale'] ) ) { +} else if ( isset($_COOKIE['zmMontageScale']) ) { $scale = $_COOKIE['zmMontageScale']; Logger::Debug("Setting scale from cookie to $scale"); } @@ -65,7 +65,6 @@ foreach ( $layouts as $l ) { $layoutsById[$l->Id()] = $l; } - session_start(); $layout_id = ''; @@ -80,28 +79,29 @@ $Layout = ''; $Positions = ''; if ( $layout_id and is_numeric($layout_id) and isset($layoutsById[$layout_id]) ) { $Layout = $layoutsById[$layout_id]; - $Positions = json_decode( $Layout->Positions(), true ); + $Positions = json_decode($Layout->Positions(), true); } if ( $Layout and ( $Layout->Name() != 'Freeform' ) ) { // Use layout instead of other options } - if ( isset($_COOKIE['zmMontageWidth']) and $_COOKIE['zmMontageWidth'] ) { - $_SESSION['zmMontageWidth'] = $options['width'] = $_COOKIE['zmMontageWidth']; - } elseif ( isset($_SESSION['zmMontageWidth']) and $_SESSION['zmMontageWidth'] ) { - $options['width'] = $_SESSION['zmMontageWidth']; - } else - $options['width'] = ''; +if ( isset($_COOKIE['zmMontageWidth']) and $_COOKIE['zmMontageWidth'] ) { + $_SESSION['zmMontageWidth'] = $options['width'] = $_COOKIE['zmMontageWidth']; +} elseif ( isset($_SESSION['zmMontageWidth']) and $_SESSION['zmMontageWidth'] ) { + $options['width'] = $_SESSION['zmMontageWidth']; +} else + $options['width'] = ''; - if ( isset($_COOKIE['zmMontageHeight']) and $_COOKIE['zmMontageHeight'] ) - $_SESSION['zmMontageHeight'] = $options['height'] = $_COOKIE['zmMontageHeight']; - else if ( isset($_SESSION['zmMontageHeight']) and $_SESSION['zmMontageHeight'] ) - $options['height'] = $_SESSION['zmMontageHeight']; - else - $options['height'] = ''; +if ( isset($_COOKIE['zmMontageHeight']) and $_COOKIE['zmMontageHeight'] ) + $_SESSION['zmMontageHeight'] = $options['height'] = $_COOKIE['zmMontageHeight']; +else if ( isset($_SESSION['zmMontageHeight']) and $_SESSION['zmMontageHeight'] ) + $options['height'] = $_SESSION['zmMontageHeight']; +else + $options['height'] = ''; + +if ( $scale ) + $options['scale'] = $scale; - if ( $scale ) - $options['scale'] = $scale; session_write_close(); ob_start(); @@ -120,16 +120,16 @@ foreach( $displayMonitors as &$row ) { if ( ZM_OPT_CONTROL && $row['ControlId'] && $row['Controllable'] ) $showControl = true; $row['connKey'] = generateConnKey(); - if ( ! isset( $widths[$row['Width']] ) ) { + if ( ! isset($widths[$row['Width']]) ) { $widths[$row['Width']] = $row['Width']; } - if ( ! isset( $heights[$row['Height']] ) ) { + if ( ! isset($heights[$row['Height']]) ) { $heights[$row['Height']] = $row['Height']; } - $monitors[] = new Monitor( $row ); + $monitors[] = new Monitor($row); } # end foreach Monitor -xhtmlHeaders(__FILE__, translate('Montage') ); +xhtmlHeaders(__FILE__, translate('Montage')); ?>
@@ -139,7 +139,7 @@ xhtmlHeaders(__FILE__, translate('Montage') ); - +
-
- - -
+
+ + +
- - - + + + + + + + + + + + + - 'selectLayout(this);', 'id'=>'zmMontageLayout') ); ?> + 'selectLayout(this);', 'id'=>'zmMontageLayout')); ?> @@ -185,9 +194,12 @@ if ( $showZones ) { foreach ( $monitors as $monitor ) { $connkey = $monitor->connKey(); // Minor hack ?> -
+
-
+
Type() == "WebSite" ) { - echo getWebSiteUrl( 'liveStream'.$monitor->Id(), $monitor->Path(), reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() ); - } else { - echo getStreamHTML( $monitor, $monitor_options ); - } - if ( $showZones ) { - $height = null; - $width = null; - if ( $options['width'] ) { - $width = $options['width']; - if ( ! $options['height'] ) { - $scale = (int)( 100 * $options['width'] / $monitor->Width() ); - $height = reScale( $monitor->Height(), $scale ); - } - } else if ( $options['height'] ) { - $height = $options['height']; - if ( ! $options['width'] ) { - $scale = (int)( 100 * $options['height'] / $monitor->Height() ); - $width = reScale( $monitor->Width(), $scale ); - } - } else if ( $scale ) { - $width = reScale( $monitor->Width(), $scale ); - $height = reScale( $monitor->Height(), $scale ); - } + if ( $monitor->Type() == 'WebSite' ) { + echo getWebSiteUrl( + 'liveStream'.$monitor->Id(), + $monitor->Path(), + reScale($monitor->Width(), $scale), + reScale($monitor->Height(), $scale), + $monitor->Name() + ); + } else { + echo getStreamHTML($monitor, $monitor_options); + } + if ( $showZones ) { + $height = null; + $width = null; + if ( $options['width'] ) { + $width = $options['width']; + if ( !$options['height'] ) { + $scale = (int)( 100 * $options['width'] / $monitor->Width() ); + $height = reScale($monitor->Height(), $scale); + } + } else if ( $options['height'] ) { + $height = $options['height']; + if ( !$options['width'] ) { + $scale = (int)( 100 * $options['height'] / $monitor->Height() ); + $width = reScale($monitor->Width(), $scale); + } + } else if ( $scale ) { + $width = reScale($monitor->Width(), $scale); + $height = reScale($monitor->Height(), $scale); + } - $zones = array(); - foreach( dbFetchAll( 'SELECT * FROM Zones WHERE MonitorId=? ORDER BY Area DESC', NULL, array($monitor->Id()) ) as $row ) { - $row['Points'] = coordsToPoints( $row['Coords'] ); + $zones = array(); + foreach( dbFetchAll('SELECT * FROM Zones WHERE MonitorId=? ORDER BY Area DESC', NULL, array($monitor->Id()) ) as $row ) { + $row['Points'] = coordsToPoints($row['Coords']); - if ( $scale ) { - limitPoints( $row['Points'], 0, 0, $monitor->Width(), $monitor->Height() ); - scalePoints( $row['Points'], $scale ); - } else { - limitPoints( $row['Points'], 0, 0, - ( $width ? $width-1 : $monitor->Width()-1 ), - ( $height ? $height-1 : $monitor->Height()-1 ) - ); - } - $row['Coords'] = pointsToCoords( $row['Points'] ); - $row['AreaCoords'] = preg_replace( '/\s+/', ',', $row['Coords'] ); - $zones[] = $row; - } // end foreach Zone + if ( $scale ) { + limitPoints($row['Points'], 0, 0, $monitor->Width(), $monitor->Height()); + scalePoints($row['Points'], $scale); + } else { + limitPoints($row['Points'], 0, 0, + ( $width ? $width-1 : $monitor->Width()-1 ), + ( $height ? $height-1 : $monitor->Height()-1 ) + ); + } + $row['Coords'] = pointsToCoords($row['Points']); + $row['AreaCoords'] = preg_replace('/\s+/', ',', $row['Coords']); + $zones[] = $row; + } // end foreach Zone ?> - - '; - } // end foreach zone + +'; +} // end foreach zone ?> Sorry, your browser does not support inline SVG - - + +
Type() != 'WebSite') ) { + if ( (!ZM_WEB_COMPACT_MONTAGE) && ($monitor->Type() != 'WebSite') ) { ?>
 -  fps
From ba8dc2059db5e950e1fd29292daaca77aa2fb639 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 9 Jul 2018 12:33:21 -0400 Subject: [PATCH 2/3] spacing --- web/skins/classic/views/cycle.php | 16 ++++++++-------- web/skins/classic/views/js/cycle.js | 6 +++--- web/skins/classic/views/watch.php | 3 +-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/web/skins/classic/views/cycle.php b/web/skins/classic/views/cycle.php index be5bf154c..b05319510 100644 --- a/web/skins/classic/views/cycle.php +++ b/web/skins/classic/views/cycle.php @@ -44,12 +44,12 @@ foreach( $displayMonitors as &$row ) { if ( isset($_REQUEST['mid']) && $row['Id'] == $_REQUEST['mid'] ) $monIdx = count($monitors); - $row['ScaledWidth'] = reScale( $row['Width'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); - $row['ScaledHeight'] = reScale( $row['Height'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); - $row['PopupScale'] = reScale( SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + $row['ScaledWidth'] = reScale($row['Width'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE); + $row['ScaledHeight'] = reScale($row['Height'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE); + $row['PopupScale'] = reScale(SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE); $row['connKey'] = generateConnKey(); - $monitors[] = new Monitor( $row ); + $monitors[] = new Monitor($row); } # end foreach Monitor if ( $monitors ) { @@ -63,14 +63,14 @@ if ( $monitors ) { } noCacheHeaders(); -xhtmlHeaders(__FILE__, translate('CycleWatch') ); +xhtmlHeaders(__FILE__, translate('CycleWatch')); ?>
- +