diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index 5571c4e5e..7b414d3e0 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -87,38 +87,37 @@ if (isset($_REQUEST['newMonitor'])) { } # What if it has less zeros? This is not robust code. -if ( $monitor->AnalysisFPSLimit() == '0.00' ) +if ($monitor->AnalysisFPSLimit() == '0.00') $monitor->AnalysisFPSLimit(''); -if ( $monitor->MaxFPS() == '0.00' ) +if ($monitor->MaxFPS() == '0.00') $monitor->MaxFPS(''); -if ( $monitor->AlarmMaxFPS() == '0.00' ) +if ($monitor->AlarmMaxFPS() == '0.00') $monitor->AlarmMaxFPS(''); -if ( !empty($_REQUEST['preset']) ) { - $preset = dbFetchOne( 'SELECT Type, Device, Channel, Format, Protocol, Method, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale FROM MonitorPresets WHERE Id = ?', NULL, array($_REQUEST['preset']) ); - foreach ( $preset as $name=>$value ) { +if (!empty($_REQUEST['preset'])) { + $preset = dbFetchOne('SELECT Type, Device, Channel, Format, Protocol, Method, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale FROM MonitorPresets WHERE Id = ?', NULL, array($_REQUEST['preset'])); + foreach ($preset as $name=>$value) { # Does isset handle NULL's? I don't think this code is correct. # Icon: It does, but this means we can't set a null value. - if ( isset($value) ) { + if (isset($value)) { $monitor->$name($value); } } } # end if preset -if ( !empty($_REQUEST['probe']) ) { +if (!empty($_REQUEST['probe'])) { $probe = json_decode(base64_decode($_REQUEST['probe'])); - foreach ( $probe as $name=>$value ) { - if ( isset($value) ) { - # Does isset handle NULL's? I don't think this code is correct. + foreach ($probe as $name=>$value) { + if (isset($value)) { $monitor->$name = urldecode($value); } } - if ( ZM_HAS_V4L2 && $monitor->Type() == 'Local' ) { - $monitor->Palette( fourCC( substr($monitor->Palette,0,1), substr($monitor->Palette,1,1), substr($monitor->Palette,2,1), substr($monitor->Palette,3,1) ) ); - if ( $monitor->Format() == 'PAL' ) - $monitor->Format( 0x000000ff ); - elseif ( $monitor->Format() == 'NTSC' ) - $monitor->Format( 0x0000b000 ); + if (ZM_HAS_V4L2 && ($monitor->Type() == 'Local')) { + $monitor->Palette(fourCC(substr($monitor->Palette,0,1), substr($monitor->Palette,1,1), substr($monitor->Palette,2,1), substr($monitor->Palette,3,1))); + if ($monitor->Format() == 'PAL') + $monitor->Format(0x000000ff); + else if ($monitor->Format() == 'NTSC') + $monitor->Format(0x0000b000); } } # end if apply probe settings @@ -133,14 +132,14 @@ $sourceTypes = array( 'NVSocket' => translate('NVSocket'), 'VNC' => translate('VNC'), ); -if ( !ZM_HAS_V4L2 ) +if (!ZM_HAS_V4L2) unset($sourceTypes['Local']); $localMethods = array( 'v4l2' => 'Video For Linux version 2', ); -if ( !ZM_HAS_V4L2 ) +if (!ZM_HAS_V4L2) unset($localMethods['v4l2']); $remoteProtocols = array( @@ -168,12 +167,12 @@ $httpMethods = array( 'jpegTags' => 'JPEG Tags' ); -if ( !ZM_PCRE ) +if (!ZM_PCRE) unset($httpMethods['regexp']); // Currently unsupported unset($httpMethods['jpegTags']); -if ( ZM_HAS_V4L2 ) { +if (ZM_HAS_V4L2) { $v4l2DeviceFormats = array( 0x000000ff => 'PAL', 0x0000b000 => 'NTSC', @@ -207,7 +206,7 @@ if ( ZM_HAS_V4L2 ) { $v4l2MaxChannels = 31; $v4l2DeviceChannels = array(); - for ( $i = 0; $i <= $v4l2MaxChannels; $i++ ) + for ($i = 0; $i <= $v4l2MaxChannels; $i++) $v4l2DeviceChannels[$i] = $i; $v4l2LocalPalettes = array( @@ -351,7 +350,7 @@ $label_size = array( $codecs = array( 'auto' => translate('Auto'), - 'MP4' => translate('MP4'), + 'MP4' => translate('MP4'), 'MJPEG' => translate('MJPEG'), ); @@ -362,11 +361,10 @@ xhtmlHeaders(__FILE__, translate('Monitor').' - '.validHtmlStr($monitor->Name()) getBodyTopHTML(); echo getNavBarHTML(); ?> -
- +
+ -
+
@@ -415,10 +413,10 @@ foreach ( $tabs as $name=>$value ) {
-

- Name()) ?>Id() ) { ?> (Id()?>)

+

Name()) .($monitor->Id()? $monitor->Id() : '') ?>

Configuration cloned from Monitor: @@ -438,19 +436,19 @@ if ( canEdit('Monitors') ) {
-
- - - -
+ + + + +
$value ) { +foreach ($tabs as $name=>$value) { echo '
'; ?> - - +
+ Id()) { @@ -477,25 +475,32 @@ switch ( $name ) { - +'lower(Name)')); + if (count($Servers)) { +?> + - + + Type() != 'WebSite' ) { + if ($monitor->Type() != 'WebSite') { ?> - + - - - + + - - - - + + + + - - - - - - - - + + + + + + + +
'None','auto'=>'Auto'); - foreach (ZM\Server::find(NULL, array('order'=>'lower(Name)')) as $Server) { + foreach ($Servers as $Server) { $servers[$Server->Id()] = $Server->Name(); } echo htmlSelect('newMonitor[ServerId]', $servers, $monitor->ServerId()); ?>
Type()); ?>
DecodingEnabled() ? ' checked="checked"' : '' ?>/> +
DecodingEnabled() ? ' checked="checked"' : '' ?>/> '.$OLANG['FUNCTION_DECODING_ENABLED']['Help'].''; - } + if (isset($OLANG['FUNCTION_DECODING_ENABLED'])) { + echo '
'.$OLANG['FUNCTION_DECODING_ENABLED']['Help'].'
'; + } ?> -
+
Id() || ($monitor->Id()!= $linked_monitor['Id'])) && visibleMonitor($linked_monitor['Id']) ) { $monitor_options[$linked_monitor['Id']] = validHtmlStr($linked_monitor['Name']); } @@ -540,17 +545,17 @@ switch ( $name ) { array('class'=>'chosen','multiple'=>'multiple') ); ?> -
+
Analysing(), array('on-change-this'=>'Analysing_onChange')); @@ -558,7 +563,7 @@ switch ( $name ) {
$translated) { - if ( isset($OLANG['ANALYSING_'.strtoupper($fn)]) ) { + if (isset($OLANG['ANALYSING_'.strtoupper($fn)])) { echo '
'.$OLANG['ANALYSING_'.strtoupper($fn)]['Help'].'
'; } }