put () after property names of Monitor object

This commit is contained in:
Isaac Connor 2015-12-01 14:30:24 -05:00
parent e85ba683e1
commit 382ad0f390
2 changed files with 19 additions and 16 deletions

View File

@ -44,9 +44,9 @@ var showMode = "<?php echo ($showPtzControls && !empty($control))?"control":"eve
var connKey = '<?php echo $connkey ?>';
var maxDisplayEvents = <?php echo 2 * MAX_EVENTS ?>;
var monitorId = <?php echo $monitor->Id ?>;
var monitorWidth = <?php echo $monitor->Width ?>;
var monitorHeight = <?php echo $monitor->Height ?>;
var monitorId = <?php echo $monitor->Id() ?>;
var monitorWidth = <?php echo $monitor->Width() ?>;
var monitorHeight = <?php echo $monitor->Height() ?>;
var scale = <?php echo $scale ?>;
@ -61,11 +61,11 @@ var canStreamNative = <?php echo canStreamNative()?'true':'false' ?>;
var canPlayPauseAudio = Browser.ie;
<?php if ( $monitor->CanMoveMap ) { ?>
<?php if ( $monitor->CanMoveMap() ) { ?>
var imageControlMode = "moveMap";
<?php } elseif ( $monitor->CanMoveRel ) { ?>
<?php } elseif ( $monitor->CanMoveRel() ) { ?>
var imageControlMode = "movePseudoMap";
<?php } elseif ( $monitor->CanMoveCon ) { ?>
<?php } elseif ( $monitor->CanMoveCon() ) { ?>
var imageControlMode = "moveConMap";
<?php } else { ?>
var imageControlMode = null;

View File

@ -25,21 +25,24 @@ if ( !canView( 'Stream' ) )
$view = "error";
return;
}
if ( ! visibleMonitor( $_REQUEST['mid'] ) ) {
// This is for input sanitation
$mid = intval( $_REQUEST['mid'] );
if ( ! visibleMonitor( $mid ) ) {
$view = "error";
return;
}
$sql = 'SELECT C.*, M.* FROM Monitors AS M LEFT JOIN Controls AS C ON (M.ControlId = C.Id ) WHERE M.Id = ?';
$monitor = new Monitor( $_REQUEST['mid'] );
$monitor = new Monitor( $mid );
#dbFetchOne( $sql, NULL, array( $_REQUEST['mid'] ) );
if ( isset($_REQUEST['showControls']) )
$showControls = validInt($_REQUEST['showControls']);
else
$showControls = (canView( 'Control' ) && ($monitor->DefaultView == 'Control'));
$showControls = (canView( 'Control' ) && ($monitor->DefaultView() == 'Control'));
$showPtzControls = ( ZM_OPT_CONTROL && $monitor->Controllable && canView( 'Control' ) );
$showPtzControls = ( ZM_OPT_CONTROL && $monitor->Controllable() && canView( 'Control' ) );
if ( isset( $_REQUEST['scale'] ) )
$scale = validInt($_REQUEST['scale']);
@ -56,7 +59,7 @@ if ( ZM_WEB_STREAM_METHOD == 'mpeg' && ZM_MPEG_LIVE_FORMAT )
elseif ( canStream() )
{
$streamMode = "jpeg";
$streamSrc = $monitor->getStreamSrc( array( "mode=".$streamMode, "scale=".$scale, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "buffer=".$monitor->StreamReplayBuffer ) );
$streamSrc = $monitor->getStreamSrc( array( "mode=".$streamMode, "scale=".$scale, "maxfps=".ZM_WEB_VIDEO_MAXFPS, "buffer=".$monitor->StreamReplayBuffer() ) );
}
else
{
@ -99,7 +102,7 @@ if ( $showPtzControls )
if ( canView( 'Control' ) && $monitor->Type() == "Local" )
{
?>
<div id="settingsControl"><?php echo makePopupLink( '?view=settings&amp;mid='.$monitor->Id, 'zmSettings'.$monitor->Id, 'settings', translate('Settings'), true, 'id="settingsLink"' ) ?></div>
<div id="settingsControl"><?php echo makePopupLink( '?view=settings&amp;mid='.$monitor->Id(), 'zmSettings'.$monitor->Id(), 'settings', translate('Settings'), true, 'id="settingsLink"' ) ?></div>
<?php
}
?>
@ -110,18 +113,18 @@ if ( canView( 'Control' ) && $monitor->Type() == "Local" )
<?php
if ( $streamMode == "mpeg" )
{
outputVideoStream( "liveStream", $streamSrc, reScale( $monitor->Width, $scale ), reScale( $monitor->Height, $scale ), ZM_MPEG_LIVE_FORMAT, $monitor->Name );
outputVideoStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), ZM_MPEG_LIVE_FORMAT, $monitor->Name() );
}
elseif ( $streamMode == "jpeg" )
{
if ( canStreamNative() )
outputImageStream( "liveStream", $streamSrc, reScale( $monitor->Width, $scale ), reScale( $monitor->Height, $scale ), $monitor->Name );
outputImageStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() );
elseif ( canStreamApplet() )
outputHelperStream( "liveStream", $streamSrc, reScale( $monitor->Width, $scale ), reScale( $monitor->Height, $scale ), $monitor->Name );
outputHelperStream( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() );
}
else
{
outputImageStill( "liveStream", $streamSrc, reScale( $monitor->Width, $scale ), reScale( $monitor->Height, $scale ), $monitor->Name );
outputImageStill( "liveStream", $streamSrc, reScale( $monitor->Width(), $scale ), reScale( $monitor->Height(), $scale ), $monitor->Name() );
}
?>
</div>