diff --git a/web/skins/classic/views/montage.php b/web/skins/classic/views/montage.php index e2e5e7b9d..2fa91b167 100644 --- a/web/skins/classic/views/montage.php +++ b/web/skins/classic/views/montage.php @@ -27,46 +27,36 @@ if ( !canView( 'Stream' ) ) require_once( 'includes/Monitor.php' ); $groupSql = ""; -if ( !empty($_REQUEST['group']) ) -{ - $row = dbFetchOne( 'select * from Groups where Id = ?', NULL, array($_REQUEST['group']) ); +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"; } else { $sql = "select * from Monitors where Function != 'None' order by Sequence"; } -$maxWidth = 0; -$maxHeight = 0; $showControl = false; -$index = 0; $monitors = array(); -foreach( dbFetchAll( $sql ) as $row ) -{ - if ( !visibleMonitor( $row['Id'] ) ) - { - continue; - } - - 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 ); - $scaleWidth = reScale( $row['Width'], $scale ); - $scaleHeight = reScale( $row['Height'], $scale ); - if ( $maxWidth < $scaleWidth ) - $maxWidth = $scaleWidth; - if ( $maxHeight < $scaleHeight ) - $maxHeight = $scaleHeight; - if ( ZM_OPT_CONTROL && $row['ControlId'] ) - $showControl = true; - $row['index'] = $index++; - $row['scaleWidth'] = $scaleWidth; - $row['scaleHeight'] = $scaleHeight; - $row['connKey'] = generateConnKey(); - $monitors[] = new Monitor( $row ); + +foreach( dbFetchAll( $sql ) as $row ) { + if ( !visibleMonitor( $row['Id'] ) ) { + continue; + } + + 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 ); + + if ( ZM_OPT_CONTROL && $row['ControlId'] ) + $showControl = true; + $row['connKey'] = generateConnKey(); + $monitors[] = new Monitor( $row ); } $focusWindow = true; @@ -110,37 +100,17 @@ if ( $showControl ) foreach ( $monitors as $monitor ) { $connkey = $monitor->connKey(); // Minor hack - if ( !isset( $scale ) ) - $scale = reScale( SCALE_BASE, $monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE ); -?> -