diff --git a/web/skins/classic/views/montage.php b/web/skins/classic/views/montage.php index a18a6dd7f..24e363edb 100644 --- a/web/skins/classic/views/montage.php +++ b/web/skins/classic/views/montage.php @@ -27,55 +27,55 @@ require_once( 'includes/Monitor.php' ); $groupSql = ''; if ( !empty($_REQUEST['group']) ) { - $row = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_REQUEST['group']) ); - $sql = "select * from Monitors where Function != 'None' and find_in_set( Id, '".$row['MonitorIds']."' ) order by Sequence"; + $row = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_REQUEST['group']) ); + $sql = "select * from Monitors where Function != 'None' and find_in_set( Id, '".$row['MonitorIds']."' ) order by Sequence"; } else { - $sql = "select * from Monitors where Function != 'None' order by Sequence"; + $sql = "select * from Monitors where Function != 'None' order by Sequence"; } $showControl = false; $monitors = array(); $widths = array( - '' => 'auto', - 160 => 160, - 320 => 320, - 352 => 352, - 640 => 640, - 1280 => 1280 ); + '' => 'auto', + 160 => 160, + 320 => 320, + 352 => 352, + 640 => 640, + 1280 => 1280 ); $heights = array( - '' => 'auto', - 240 => 240, - 480 => 480, + '' => 'auto', + 240 => 240, + 480 => 480, ); - + foreach( dbFetchAll( $sql ) as $row ) { - if ( !visibleMonitor( $row['Id'] ) ) { - continue; - } + if ( !visibleMonitor( $row['Id'] ) ) { + continue; + } $scale = null; - if ( isset( $_REQUEST['scale'] ) ) - $scale = validInt($_REQUEST['scale']); - else if ( isset( $_COOKIE['zmMontageScale'] ) ) - $scale = $_COOKIE['zmMontageScale']; - #else - #$scale = reScale( SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + if ( isset( $_REQUEST['scale'] ) ) + $scale = validInt($_REQUEST['scale']); + else if ( isset( $_COOKIE['zmMontageScale'] ) ) + $scale = $_COOKIE['zmMontageScale']; + #else + #$scale = reScale( SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); - $row['Scale'] = $scale; - $row['PopupScale'] = reScale( SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); + $row['Scale'] = $scale; + $row['PopupScale'] = reScale( SCALE_BASE, $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE ); - if ( ZM_OPT_CONTROL && $row['ControlId'] ) - $showControl = true; - $row['connKey'] = generateConnKey(); - $monitors[] = new Monitor( $row ); - if ( ! isset( $widths[$row['Width']] ) ) { - $widths[$row['Width']] = $row['Width']; - } - if ( ! isset( $heights[$row['Height']] ) ) { - $heights[$row['Height']] = $row['Height']; - } + if ( ZM_OPT_CONTROL && $row['ControlId'] ) + $showControl = true; + $row['connKey'] = generateConnKey(); + $monitors[] = new Monitor( $row ); + if ( ! isset( $widths[$row['Width']] ) ) { + $widths[$row['Width']] = $row['Width']; + } + if ( ! isset( $heights[$row['Height']] ) ) { + $heights[$row['Height']] = $row['Height']; + } } $focusWindow = true; @@ -94,8 +94,12 @@ if ( isset($_COOKIE['zmMontageLayout']) ) $options = array(); if ( isset($_COOKIE['zmMontageWidth']) and $_COOKIE['zmMontageWidth'] ) $options['width'] = $_COOKIE['zmMontageWidth']; +else + $options['width'] = ''; if ( isset($_COOKIE['zmMontageHeight']) and $_COOKIE['zmMontageHeight'] ) - $options['height'] = $_COOKIE['zmMontageHeight']; + $options['height'] = $_COOKIE['zmMontageHeight']; +else + $options['height'] = ''; if ( $scale ) $options['scale'] = $scale; @@ -116,8 +120,8 @@ if ( $showControl ) {