diff --git a/web/skins/classic/views/js/zone.js.php b/web/skins/classic/views/js/zone.js.php index 7e3145378..3ed7b1669 100644 --- a/web/skins/classic/views/js/zone.js.php +++ b/web/skins/classic/views/js/zone.js.php @@ -46,8 +46,8 @@ zone['Points'][] = { 'x': -var maxX = ; -var maxY = ; +var maxX = Width()-1 ?>; +var maxY = Height()-1 ?>; var selfIntersecting = ; var selfIntersectingString = ''; diff --git a/web/skins/classic/views/zone.php b/web/skins/classic/views/zone.php index 01d5464bf..910faa50a 100644 --- a/web/skins/classic/views/zone.php +++ b/web/skins/classic/views/zone.php @@ -62,25 +62,25 @@ foreach ( getEnumValues( 'Zones', 'CheckMethod' ) as $optCheckMethod ) $monitor = new Monitor( $mid ); $minX = 0; -$maxX = $monitor['Width']-1; +$maxX = $monitor->Width()-1; $minY = 0; -$maxY = $monitor['Height']-1; +$maxY = $monitor->Height()-1; if ( !isset($newZone) ) { if ( $zid > 0 ) { - $zone = dbFetchOne( 'SELECT * FROM Zones WHERE MonitorId = ? AND Id=?', NULL, array( $monitor['Id'], $zid ) ); + $zone = dbFetchOne( 'SELECT * FROM Zones WHERE MonitorId = ? AND Id=?', NULL, array( $monitor->Id(), $zid ) ); } else { $zone = array( 'Name' => translate('New'), 'Id' => 0, - 'MonitorId' => $monitor['Id'], + 'MonitorId' => $monitor->Id(), 'NumCoords' => 4, 'Coords' => sprintf( "%d,%d %d,%d, %d,%d %d,%d", $minX, $minY, $maxX, $minY, $maxX, $maxY, $minX, $maxY ), - 'Area' => $monitor['Width'] * $monitor['Height'], + 'Area' => $monitor->Width() * $monitor->Height(), 'AlarmRGB' => 0xff0000, 'CheckMethod' => 'Blobs', 'MinPixelThreshold' => '', @@ -123,7 +123,7 @@ xhtmlHeaders(__FILE__, translate('Zone') );