adjust spacing

This commit is contained in:
Isaac Connor 2017-05-31 22:01:35 -04:00
parent 17c8224733
commit 1df147e183
1 changed files with 303 additions and 306 deletions

View File

@ -38,9 +38,9 @@ if ( ZM_OPT_X10 )
$tabs['misc'] = translate('Misc'); $tabs['misc'] = translate('Misc');
if ( isset($_REQUEST['tab']) ) if ( isset($_REQUEST['tab']) )
$tab = validHtmlStr($_REQUEST['tab']); $tab = validHtmlStr($_REQUEST['tab']);
else else
$tab = "general"; $tab = 'general';
$Server = null; $Server = null;
if ( defined( 'ZM_SERVER_ID' ) ) { if ( defined( 'ZM_SERVER_ID' ) ) {
@ -205,7 +205,7 @@ $sourceTypes = array(
'Ffmpeg' => translate('Ffmpeg'), 'Ffmpeg' => translate('Ffmpeg'),
'Libvlc' => translate('Libvlc'), 'Libvlc' => translate('Libvlc'),
'cURL' => 'cURL (HTTP(S) only)' 'cURL' => 'cURL (HTTP(S) only)'
); );
if ( !ZM_HAS_V4L ) if ( !ZM_HAS_V4L )
unset($sourceTypes['Local']); unset($sourceTypes['Local']);
@ -213,6 +213,7 @@ $localMethods = array(
'v4l2' => 'Video For Linux version 2', 'v4l2' => 'Video For Linux version 2',
'v4l1' => 'Video For Linux version 1', 'v4l1' => 'Video For Linux version 1',
); );
if ( !ZM_HAS_V4L2 ) if ( !ZM_HAS_V4L2 )
unset($localMethods['v4l2']); unset($localMethods['v4l2']);
if ( !ZM_HAS_V4L1 ) if ( !ZM_HAS_V4L1 )
@ -221,174 +222,174 @@ if ( !ZM_HAS_V4L1 )
$remoteProtocols = array( $remoteProtocols = array(
'http' => 'HTTP', 'http' => 'HTTP',
'rtsp' => 'RTSP' 'rtsp' => 'RTSP'
); );
$rtspMethods = array( $rtspMethods = array(
'rtpUni' => 'RTP/Unicast', 'rtpUni' => 'RTP/Unicast',
'rtpMulti' => 'RTP/Multicast', 'rtpMulti' => 'RTP/Multicast',
'rtpRtsp' => 'RTP/RTSP', 'rtpRtsp' => 'RTP/RTSP',
'rtpRtspHttp' => 'RTP/RTSP/HTTP' 'rtpRtspHttp' => 'RTP/RTSP/HTTP'
); );
$rtspFFMpegMethods = array( $rtspFFMpegMethods = array(
'rtpRtsp' => 'TCP', 'rtpRtsp' => 'TCP',
'rtpUni' => 'UDP', 'rtpUni' => 'UDP',
'rtpMulti' => 'UDP Multicast', 'rtpMulti' => 'UDP Multicast',
'rtpRtspHttp' => 'HTTP Tunnel' 'rtpRtspHttp' => 'HTTP Tunnel'
); );
$httpMethods = array( $httpMethods = array(
'simple' => "Simple", 'simple' => "Simple",
'regexp' => "Regexp", 'regexp' => "Regexp",
'jpegTags' => "JPEG Tags" 'jpegTags' => "JPEG Tags"
); );
if ( !ZM_PCRE ) if ( !ZM_PCRE )
unset($httpMethods['regexp']); unset($httpMethods['regexp']);
// Currently unsupported // Currently unsupported
unset($httpMethods['jpegTags']); unset($httpMethods['jpegTags']);
if ( ZM_HAS_V4L1 ) if ( ZM_HAS_V4L1 ) {
{ $v4l1DeviceFormats = array(
$v4l1DeviceFormats = array( 'PAL' => 0,
'PAL' => 0, 'NTSC' => 1,
'NTSC' => 1, 'SECAM' => 2,
'SECAM' => 2, 'AUTO' => 3,
'AUTO' => 3, 'FMT4' => 4,
'FMT4' => 4, 'FMT5' => 5,
'FMT5' => 5, 'FMT6' => 6,
'FMT6' => 6, 'FMT7' => 7
'FMT7' => 7 );
);
$v4l1MaxChannels = 15; $v4l1MaxChannels = 15;
$v4l1DeviceChannels = array(); $v4l1DeviceChannels = array();
for ( $i = 0; $i <= $v4l1MaxChannels; $i++ ) for ( $i = 0; $i <= $v4l1MaxChannels; $i++ )
$v4l1DeviceChannels['$i'] = $i; $v4l1DeviceChannels['$i'] = $i;
$v4l1LocalPalettes = array( $v4l1LocalPalettes = array(
translate('Grey') => 1, translate('Grey') => 1,
'BGR32' => 5, 'BGR32' => 5,
'BGR24' => 4, 'BGR24' => 4,
'*YUYV' => 8, '*YUYV' => 8,
'*RGB565' => 3, '*RGB565' => 3,
'*RGB555' => 6, '*RGB555' => 6,
'*YUV422' => 7, '*YUV422' => 7,
'*YUV422P' => 13, '*YUV422P' => 13,
'*YUV420P' => 15 '*YUV420P' => 15
); );
} }
if ( ZM_HAS_V4L2 ) { if ( ZM_HAS_V4L2 ) {
$v4l2DeviceFormats = array( $v4l2DeviceFormats = array(
'PAL' => 0x000000ff, 'PAL' => 0x000000ff,
'NTSC' => 0x0000b000, 'NTSC' => 0x0000b000,
'PAL B' => 0x00000001, 'PAL B' => 0x00000001,
'PAL B1' => 0x00000002, 'PAL B1' => 0x00000002,
'PAL G' => 0x00000004, 'PAL G' => 0x00000004,
'PAL H' => 0x00000008, 'PAL H' => 0x00000008,
'PAL I' => 0x00000010, 'PAL I' => 0x00000010,
'PAL D' => 0x00000020, 'PAL D' => 0x00000020,
'PAL D1' => 0x00000040, 'PAL D1' => 0x00000040,
'PAL K' => 0x00000080, 'PAL K' => 0x00000080,
'PAL M' => 0x00000100, 'PAL M' => 0x00000100,
'PAL N' => 0x00000200, 'PAL N' => 0x00000200,
'PAL Nc' => 0x00000400, 'PAL Nc' => 0x00000400,
'PAL 60' => 0x00000800, 'PAL 60' => 0x00000800,
'NTSC M' => 0x00001000, 'NTSC M' => 0x00001000,
'NTSC M JP' => 0x00002000, 'NTSC M JP' => 0x00002000,
'NTSC 443' => 0x00004000, 'NTSC 443' => 0x00004000,
'NTSC M KR' => 0x00008000, 'NTSC M KR' => 0x00008000,
'SECAM B' => 0x00010000, 'SECAM B' => 0x00010000,
'SECAM D' => 0x00020000, 'SECAM D' => 0x00020000,
'SECAM G' => 0x00040000, 'SECAM G' => 0x00040000,
'SECAM H' => 0x00080000, 'SECAM H' => 0x00080000,
'SECAM K' => 0x00100000, 'SECAM K' => 0x00100000,
'SECAM K1' => 0x00200000, 'SECAM K1' => 0x00200000,
'SECAM L' => 0x00400000, 'SECAM L' => 0x00400000,
'SECAM LC' => 0x00800000, 'SECAM LC' => 0x00800000,
'ATSC 8 VSB' => 0x01000000, 'ATSC 8 VSB' => 0x01000000,
'ATSC 16 VSB' => 0x02000000, 'ATSC 16 VSB' => 0x02000000,
); );
$v4l2MaxChannels = 31; $v4l2MaxChannels = 31;
$v4l2DeviceChannels = array(); $v4l2DeviceChannels = array();
for ( $i = 0; $i <= $v4l2MaxChannels; $i++ ) for ( $i = 0; $i <= $v4l2MaxChannels; $i++ )
$v4l2DeviceChannels[$i] = $i; $v4l2DeviceChannels[$i] = $i;
$v4l2LocalPalettes = array( $v4l2LocalPalettes = array(
'Auto' => 0, /* Automatic palette selection */ 'Auto' => 0, /* Automatic palette selection */
/* Pixel format FOURCC depth Description */ /* Pixel format FOURCC depth Description */
translate('Grey') => fourcc('G','R','E','Y'), /* 8 Greyscale */ translate('Grey') => fourcc('G','R','E','Y'), /* 8 Greyscale */
'BGR32' => fourcc('B','G','R','4'), /* 32 BGR-8-8-8-8 */ 'BGR32' => fourcc('B','G','R','4'), /* 32 BGR-8-8-8-8 */
'RGB32' => fourcc('R','G','B','4'), /* 32 RGB-8-8-8-8 */ 'RGB32' => fourcc('R','G','B','4'), /* 32 RGB-8-8-8-8 */
'BGR24' => fourcc('B','G','R','3'), /* 24 BGR-8-8-8 */ 'BGR24' => fourcc('B','G','R','3'), /* 24 BGR-8-8-8 */
'RGB24' => fourcc('R','G','B','3'), /* 24 RGB-8-8-8 */ 'RGB24' => fourcc('R','G','B','3'), /* 24 RGB-8-8-8 */
'*YUYV' => fourcc('Y','U','Y','V'), /* 16 YUV 4:2:2 */ '*YUYV' => fourcc('Y','U','Y','V'), /* 16 YUV 4:2:2 */
/* compressed formats */ /* compressed formats */
'*JPEG' => fourcc('J','P','E','G'), /* JFIF JPEG */ '*JPEG' => fourcc('J','P','E','G'), /* JFIF JPEG */
'*MJPEG' => fourcc('M','J','P','G'), /* Motion-JPEG */ '*MJPEG' => fourcc('M','J','P','G'), /* Motion-JPEG */
//'DV' => fourcc('d','v','s','d'), /* 1394 */ //'DV' => fourcc('d','v','s','d'), /* 1394 */
//'MPEG' => fourcc('M','P','E','G'), /* MPEG-1/2/4 */ //'MPEG' => fourcc('M','P','E','G'), /* MPEG-1/2/4 */
//'RGB332' => fourcc('R','G','B','1'), /* 8 RGB-3-3-2 */ //'RGB332' => fourcc('R','G','B','1'), /* 8 RGB-3-3-2 */
'*RGB444' => fourcc('R','4','4','4'), /* 16 xxxxrrrr ggggbbbb */ '*RGB444' => fourcc('R','4','4','4'), /* 16 xxxxrrrr ggggbbbb */
'*RGB555' => fourcc('R','G','B','O'), /* 16 RGB-5-5-5 */ '*RGB555' => fourcc('R','G','B','O'), /* 16 RGB-5-5-5 */
'*RGB565' => fourcc('R','G','B','P'), /* 16 RGB-5-6-5 */ '*RGB565' => fourcc('R','G','B','P'), /* 16 RGB-5-6-5 */
//'RGB555X' => fourcc('R','G','B','Q'), /* 16 RGB-5-5-5 BE */ //'RGB555X' => fourcc('R','G','B','Q'), /* 16 RGB-5-5-5 BE */
//'RGB565X' => fourcc('R','G','B','R'), /* 16 RGB-5-6-5 BE */ //'RGB565X' => fourcc('R','G','B','R'), /* 16 RGB-5-6-5 BE */
//'Y16' => fourcc('Y','1','6',''), /* 16 Greyscale */ //'Y16' => fourcc('Y','1','6',''), /* 16 Greyscale */
//'PAL8' => fourcc('P','A','L','8'), /* 8 8-bit palette */ //'PAL8' => fourcc('P','A','L','8'), /* 8 8-bit palette */
//'YVU410' => fourcc('Y','V','U','9'), /* 9 YVU 4:1:0 */ //'YVU410' => fourcc('Y','V','U','9'), /* 9 YVU 4:1:0 */
//'YVU420' => fourcc('Y','V','1','2'), /* 12 YVU 4:2:0 */ //'YVU420' => fourcc('Y','V','1','2'), /* 12 YVU 4:2:0 */
'*UYVY' => fourcc('U','Y','V','Y'), /* 16 YUV 4:2:2 */ '*UYVY' => fourcc('U','Y','V','Y'), /* 16 YUV 4:2:2 */
'*YUV422P' => fourcc('4','2','2','P'), /* 16 YVU422 planar */ '*YUV422P' => fourcc('4','2','2','P'), /* 16 YVU422 planar */
'*YUV411P' => fourcc('4','1','1','P'), /* 16 YVU411 planar */ '*YUV411P' => fourcc('4','1','1','P'), /* 16 YVU411 planar */
//'Y41P' => fourcc('Y','4','1','P'), /* 12 YUV 4:1:1 */ //'Y41P' => fourcc('Y','4','1','P'), /* 12 YUV 4:1:1 */
'*YUV444' => fourcc('Y','4','4','4'), /* 16 xxxxyyyy uuuuvvvv */ '*YUV444' => fourcc('Y','4','4','4'), /* 16 xxxxyyyy uuuuvvvv */
//'YUV555' => fourcc('Y','U','V','O'), /* 16 YUV-5-5-5 */ //'YUV555' => fourcc('Y','U','V','O'), /* 16 YUV-5-5-5 */
//'YUV565' => fourcc('Y','U','V','P'), /* 16 YUV-5-6-5 */ //'YUV565' => fourcc('Y','U','V','P'), /* 16 YUV-5-6-5 */
//'YUV32' => fourcc('Y','U','V','4'), /* 32 YUV-8-8-8-8 */ //'YUV32' => fourcc('Y','U','V','4'), /* 32 YUV-8-8-8-8 */
/* two planes -- one Y, one Cr + Cb interleaved */ /* two planes -- one Y, one Cr + Cb interleaved */
//'NV12' => fourcc('N','V','1','2'), /* 12 Y/CbCr 4:2:0 */ //'NV12' => fourcc('N','V','1','2'), /* 12 Y/CbCr 4:2:0 */
//'NV21' => fourcc('N','V','2','1'), /* 12 Y/CrCb 4:2:0 */ //'NV21' => fourcc('N','V','2','1'), /* 12 Y/CrCb 4:2:0 */
/* The following formats are not defined in the V4L2 specification */ /* The following formats are not defined in the V4L2 specification */
'*YUV410' => fourcc('Y','U','V','9'), /* 9 YUV 4:1:0 */ '*YUV410' => fourcc('Y','U','V','9'), /* 9 YUV 4:1:0 */
'*YUV420' => fourcc('Y','U','1','2'), /* 12 YUV 4:2:0 */ '*YUV420' => fourcc('Y','U','1','2'), /* 12 YUV 4:2:0 */
//'YYUV' => fourcc('Y','Y','U','V'), /* 16 YUV 4:2:2 */ //'YYUV' => fourcc('Y','Y','U','V'), /* 16 YUV 4:2:2 */
//'HI240' => fourcc('H','I','2','4'), /* 8 8-bit color */ //'HI240' => fourcc('H','I','2','4'), /* 8 8-bit color */
//'HM12' => fourcc('H','M','1','2'), /* 8 YUV 4:2:0 16x16 macroblocks */ //'HM12' => fourcc('H','M','1','2'), /* 8 YUV 4:2:0 16x16 macroblocks */
/* see http://www.siliconimaging.com/RGB%20Bayer.htm */ /* see http://www.siliconimaging.com/RGB%20Bayer.htm */
//'SBGGR8' => fourcc('B','A','8','1'), /* 8 BGBG.. GRGR.. */ //'SBGGR8' => fourcc('B','A','8','1'), /* 8 BGBG.. GRGR.. */
//'SGBRG8' => fourcc('G','B','R','G'), /* 8 GBGB.. RGRG.. */ //'SGBRG8' => fourcc('G','B','R','G'), /* 8 GBGB.. RGRG.. */
//'SBGGR16' => fourcc('B','Y','R','2'), /* 16 BGBG.. GRGR.. */ //'SBGGR16' => fourcc('B','Y','R','2'), /* 16 BGBG.. GRGR.. */
/* Vendor-specific formats */ /* Vendor-specific formats */
//'WNVA' => fourcc('W','N','V','A'), /* Winnov hw compress */ //'WNVA' => fourcc('W','N','V','A'), /* Winnov hw compress */
//'SN9C10X' => fourcc('S','9','1','0'), /* SN9C10x compression */ //'SN9C10X' => fourcc('S','9','1','0'), /* SN9C10x compression */
//'PWC1' => fourcc('P','W','C','1'), /* pwc older webcam */ //'PWC1' => fourcc('P','W','C','1'), /* pwc older webcam */
//'PWC2' => fourcc('P','W','C','2'), /* pwc newer webcam */ //'PWC2' => fourcc('P','W','C','2'), /* pwc newer webcam */
//'ET61X251' => fourcc('E','6','2','5'), /* ET61X251 compression */ //'ET61X251' => fourcc('E','6','2','5'), /* ET61X251 compression */
//'SPCA501' => fourcc('S','5','0','1'), /* YUYV per line */ //'SPCA501' => fourcc('S','5','0','1'), /* YUYV per line */
//'SPCA505' => fourcc('S','5','0','5'), /* YYUV per line */ //'SPCA505' => fourcc('S','5','0','5'), /* YYUV per line */
//'SPCA508' => fourcc('S','5','0','8'), /* YUVY per line */ //'SPCA508' => fourcc('S','5','0','8'), /* YUVY per line */
//'SPCA561' => fourcc('S','5','6','1'), /* compressed GBRG bayer */ //'SPCA561' => fourcc('S','5','6','1'), /* compressed GBRG bayer */
//'PAC207' => fourcc('P','2','0','7'), /* compressed BGGR bayer */ //'PAC207' => fourcc('P','2','0','7'), /* compressed BGGR bayer */
//'PJPG' => fourcc('P','J','P','G'), /* Pixart 73xx JPEG */ //'PJPG' => fourcc('P','J','P','G'), /* Pixart 73xx JPEG */
//'YVYU' => fourcc('Y','V','Y','U'), /* 16 YVU 4:2:2 */ //'YVYU' => fourcc('Y','V','Y','U'), /* 16 YVU 4:2:2 */
); );
} }
$Colours = array( $Colours = array(
translate('8BitGrey') => 1, translate('8BitGrey') => 1,
translate('24BitColour') => 3, translate('24BitColour') => 3,
translate('32BitColour') => 4 translate('32BitColour') => 4
); );
$orientations = array( $orientations = array(
translate('Normal') => '0', translate('Normal') => '0',
@ -397,7 +398,7 @@ $orientations = array(
translate('RotateLeft') => '270', translate('RotateLeft') => '270',
translate('FlippedHori') => 'hori', translate('FlippedHori') => 'hori',
translate('FlippedVert') => 'vert' translate('FlippedVert') => 'vert'
); );
$deinterlaceopts = array( $deinterlaceopts = array(
'Disabled' => 0x00000000, 'Disabled' => 0x00000000,
@ -408,7 +409,7 @@ $deinterlaceopts = array(
'Linear' => 0x00000002, 'Linear' => 0x00000002,
'Blend' => 0x00000003, 'Blend' => 0x00000003,
'Blend (25%)' => 0x00000205 'Blend (25%)' => 0x00000205
); );
$deinterlaceopts_v4l2 = array( $deinterlaceopts_v4l2 = array(
'Disabled' => 0x00000000, 'Disabled' => 0x00000000,
@ -424,7 +425,7 @@ $deinterlaceopts_v4l2 = array(
'V4L2: Alternate fields (Bob)' => 0x07000000, 'V4L2: Alternate fields (Bob)' => 0x07000000,
'V4L2: Progressive' => 0x01000000, 'V4L2: Progressive' => 0x01000000,
'V4L2: Interlaced' => 0x04000000 'V4L2: Interlaced' => 0x04000000
); );
$fastblendopts = array( $fastblendopts = array(
'No blending' => 0, 'No blending' => 0,
@ -434,7 +435,7 @@ $fastblendopts = array(
'12.5% (Outdoor)' => 12, '12.5% (Outdoor)' => 12,
'25%' => 25, '25%' => 25,
'50%' => 50 '50%' => 50
); );
$fastblendopts_alarm = array( $fastblendopts_alarm = array(
'No blending (Alarm lasts forever)' => 0, 'No blending (Alarm lasts forever)' => 0,
@ -444,12 +445,12 @@ $fastblendopts_alarm = array(
'12.5%' => 12, '12.5%' => 12,
'25%' => 25, '25%' => 25,
'50% (Alarm lasts a moment)' => 50 '50% (Alarm lasts a moment)' => 50
); );
$label_size = array( $label_size = array(
'Default' => 1, 'Default' => 1,
'Large' => 2 'Large' => 2
); );
$savejpegopts = array( $savejpegopts = array(
'Disabled' => 0, 'Disabled' => 0,
@ -457,13 +458,13 @@ $savejpegopts = array(
'Analysis images only (if available)' => 2, 'Analysis images only (if available)' => 2,
'Frames + Analysis images (if available)' => 3, 'Frames + Analysis images (if available)' => 3,
'Snapshot Only' => 4 'Snapshot Only' => 4
); );
$videowriteropts = array( $videowriteropts = array(
'Disabled' => 0, 'Disabled' => 0,
'X264 Encode' => 1, 'X264 Encode' => 1,
'H264 Camera Passthrough' => 2 'H264 Camera Passthrough' => 2
); );
xhtmlHeaders(__FILE__, translate('Monitor')." - ".validHtmlStr($monitor['Name']) ); xhtmlHeaders(__FILE__, translate('Monitor')." - ".validHtmlStr($monitor['Name']) );
?> ?>
@ -545,146 +546,146 @@ if ( canEdit( 'Monitors' ) ) {
} }
if ( ZM_HAS_V4L && ($tab != 'source' || $newMonitor['Type'] != 'Local') ) { if ( ZM_HAS_V4L && ($tab != 'source' || $newMonitor['Type'] != 'Local') ) {
?> ?>
<input type="hidden" name="newMonitor[Device]" value="<?php echo validHtmlStr($newMonitor['Device']) ?>"/> <input type="hidden" name="newMonitor[Device]" value="<?php echo validHtmlStr($newMonitor['Device']) ?>"/>
<input type="hidden" name="newMonitor[Channel]" value="<?php echo validHtmlStr($newMonitor['Channel']) ?>"/> <input type="hidden" name="newMonitor[Channel]" value="<?php echo validHtmlStr($newMonitor['Channel']) ?>"/>
<input type="hidden" name="newMonitor[Format]" value="<?php echo validHtmlStr($newMonitor['Format']) ?>"/> <input type="hidden" name="newMonitor[Format]" value="<?php echo validHtmlStr($newMonitor['Format']) ?>"/>
<input type="hidden" name="newMonitor[Palette]" value="<?php echo validHtmlStr($newMonitor['Palette']) ?>"/> <input type="hidden" name="newMonitor[Palette]" value="<?php echo validHtmlStr($newMonitor['Palette']) ?>"/>
<input type="hidden" name="newMonitor[V4LMultiBuffer]" value="<?php echo validHtmlStr($newMonitor['V4LMultiBuffer']) ?>"/> <input type="hidden" name="newMonitor[V4LMultiBuffer]" value="<?php echo validHtmlStr($newMonitor['V4LMultiBuffer']) ?>"/>
<input type="hidden" name="newMonitor[V4LCapturesPerFrame]" value="<?php echo validHtmlStr($newMonitor['V4LCapturesPerFrame']) ?>"/> <input type="hidden" name="newMonitor[V4LCapturesPerFrame]" value="<?php echo validHtmlStr($newMonitor['V4LCapturesPerFrame']) ?>"/>
<?php <?php
} }
if ( $tab != 'source' || $newMonitor['Type'] != 'Remote' ) { if ( $tab != 'source' || $newMonitor['Type'] != 'Remote' ) {
?> ?>
<input type="hidden" name="newMonitor[Protocol]" value="<?php echo validHtmlStr($newMonitor['Protocol']) ?>"/> <input type="hidden" name="newMonitor[Protocol]" value="<?php echo validHtmlStr($newMonitor['Protocol']) ?>"/>
<input type="hidden" name="newMonitor[Host]" value="<?php echo validHtmlStr($newMonitor['Host']) ?>"/> <input type="hidden" name="newMonitor[Host]" value="<?php echo validHtmlStr($newMonitor['Host']) ?>"/>
<input type="hidden" name="newMonitor[Port]" value="<?php echo validHtmlStr($newMonitor['Port']) ?>"/> <input type="hidden" name="newMonitor[Port]" value="<?php echo validHtmlStr($newMonitor['Port']) ?>"/>
<?php <?php
} }
if ( $tab != 'source' || ($newMonitor['Type'] != 'Local' && $newMonitor['Type'] != 'Remote' && $newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc') ) { if ( $tab != 'source' || ($newMonitor['Type'] != 'Local' && $newMonitor['Type'] != 'Remote' && $newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc') ) {
?> ?>
<input type="hidden" name="newMonitor[Method]" value="<?php echo validHtmlStr($newMonitor['Method']) ?>"/> <input type="hidden" name="newMonitor[Method]" value="<?php echo validHtmlStr($newMonitor['Method']) ?>"/>
<?php <?php
} }
if ( $tab != 'source' || ($newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc' )) { if ( $tab != 'source' || ($newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc' )) {
?> ?>
<input type="hidden" name="newMonitor[Options]" value="<?php echo validHtmlStr($newMonitor['Options']) ?>"/> <input type="hidden" name="newMonitor[Options]" value="<?php echo validHtmlStr($newMonitor['Options']) ?>"/>
<?php <?php
} }
if ( $tab != 'source' || ($newMonitor['Type'] != 'Remote' && $newMonitor['Type'] != 'File' && $newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc' && $newMonitor['Type'] != 'cURL') ) { if ( $tab != 'source' || ($newMonitor['Type'] != 'Remote' && $newMonitor['Type'] != 'File' && $newMonitor['Type'] != 'Ffmpeg' && $newMonitor['Type'] != 'Libvlc' && $newMonitor['Type'] != 'cURL') ) {
?> ?>
<input type="hidden" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>"/> <input type="hidden" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>"/>
<input type="hidden" name="newMonitor[User]" value="<?php echo validHtmlStr($newMonitor['User']) ?>"/> <input type="hidden" name="newMonitor[User]" value="<?php echo validHtmlStr($newMonitor['User']) ?>"/>
<input type="hidden" name="newMonitor[Pass]" value="<?php echo validHtmlStr($newMonitor['Pass']) ?>"/> <input type="hidden" name="newMonitor[Pass]" value="<?php echo validHtmlStr($newMonitor['Pass']) ?>"/>
<?php <?php
} }
if ( $tab != 'source' ) { if ( $tab != 'source' ) {
?> ?>
<input type="hidden" name="newMonitor[Colours]" value="<?php echo validHtmlStr($newMonitor['Colours']) ?>"/> <input type="hidden" name="newMonitor[Colours]" value="<?php echo validHtmlStr($newMonitor['Colours']) ?>"/>
<input type="hidden" name="newMonitor[Width]" value="<?php echo validHtmlStr($newMonitor['Width']) ?>"/> <input type="hidden" name="newMonitor[Width]" value="<?php echo validHtmlStr($newMonitor['Width']) ?>"/>
<input type="hidden" name="newMonitor[Height]" value="<?php echo validHtmlStr($newMonitor['Height']) ?>"/> <input type="hidden" name="newMonitor[Height]" value="<?php echo validHtmlStr($newMonitor['Height']) ?>"/>
<input type="hidden" name="newMonitor[Orientation]" value="<?php echo validHtmlStr($newMonitor['Orientation']) ?>"/> <input type="hidden" name="newMonitor[Orientation]" value="<?php echo validHtmlStr($newMonitor['Orientation']) ?>"/>
<input type="hidden" name="newMonitor[Deinterlacing]" value="<?php echo validHtmlStr($newMonitor['Deinterlacing']) ?>"/> <input type="hidden" name="newMonitor[Deinterlacing]" value="<?php echo validHtmlStr($newMonitor['Deinterlacing']) ?>"/>
<?php <?php
} }
if ( $tab != 'storage' ) { if ( $tab != 'storage' ) {
?> ?>
<input type="hidden" name="newMonitor[SaveJPEGs]" value="<?php echo validHtmlStr($newMonitor['SaveJPEGs']) ?>"/> <input type="hidden" name="newMonitor[SaveJPEGs]" value="<?php echo validHtmlStr($newMonitor['SaveJPEGs']) ?>"/>
<input type="hidden" name="newMonitor[VideoWriter]" value="<?php echo validHtmlStr($newMonitor['VideoWriter']) ?>"/> <input type="hidden" name="newMonitor[VideoWriter]" value="<?php echo validHtmlStr($newMonitor['VideoWriter']) ?>"/>
<input type="hidden" name="newMonitor[EncoderParameters]" value="<?php echo validHtmlStr($newMonitor['EncoderParameters']) ?>"/> <input type="hidden" name="newMonitor[EncoderParameters]" value="<?php echo validHtmlStr($newMonitor['EncoderParameters']) ?>"/>
<input type="hidden" name="newMonitor[RecordAudio]" value="<?php echo validHtmlStr($newMonitor['RecordAudio']) ?>"/> <input type="hidden" name="newMonitor[RecordAudio]" value="<?php echo validHtmlStr($newMonitor['RecordAudio']) ?>"/>
<?php <?php
} }
if ( $tab != 'source' || ($newMonitor['Type'] != 'Remote' && $newMonitor['Protocol'] != 'RTSP')) { if ( $tab != 'source' || ($newMonitor['Type'] != 'Remote' && $newMonitor['Protocol'] != 'RTSP')) {
?> ?>
<input type="hidden" name="newMonitor[RTSPDescribe]" value="<?php echo validHtmlStr($newMonitor['RTSPDescribe']) ?>"/> <input type="hidden" name="newMonitor[RTSPDescribe]" value="<?php echo validHtmlStr($newMonitor['RTSPDescribe']) ?>"/>
<?php <?php
} }
if ( $tab != 'timestamp' ) { if ( $tab != 'timestamp' ) {
?> ?>
<input type="hidden" name="newMonitor[LabelFormat]" value="<?php echo validHtmlStr($newMonitor['LabelFormat']) ?>"/> <input type="hidden" name="newMonitor[LabelFormat]" value="<?php echo validHtmlStr($newMonitor['LabelFormat']) ?>"/>
<input type="hidden" name="newMonitor[LabelX]" value="<?php echo validHtmlStr($newMonitor['LabelX']) ?>"/> <input type="hidden" name="newMonitor[LabelX]" value="<?php echo validHtmlStr($newMonitor['LabelX']) ?>"/>
<input type="hidden" name="newMonitor[LabelY]" value="<?php echo validHtmlStr($newMonitor['LabelY']) ?>"/> <input type="hidden" name="newMonitor[LabelY]" value="<?php echo validHtmlStr($newMonitor['LabelY']) ?>"/>
<input type="hidden" name="newMonitor[LabelSize]" value="<?php echo validHtmlStr($newMonitor['LabelSize']) ?>"/> <input type="hidden" name="newMonitor[LabelSize]" value="<?php echo validHtmlStr($newMonitor['LabelSize']) ?>"/>
<?php <?php
} }
if ( $tab != 'buffers' ) { if ( $tab != 'buffers' ) {
?> ?>
<input type="hidden" name="newMonitor[ImageBufferCount]" value="<?php echo validHtmlStr($newMonitor['ImageBufferCount']) ?>"/> <input type="hidden" name="newMonitor[ImageBufferCount]" value="<?php echo validHtmlStr($newMonitor['ImageBufferCount']) ?>"/>
<input type="hidden" name="newMonitor[WarmupCount]" value="<?php echo validHtmlStr($newMonitor['WarmupCount']) ?>"/> <input type="hidden" name="newMonitor[WarmupCount]" value="<?php echo validHtmlStr($newMonitor['WarmupCount']) ?>"/>
<input type="hidden" name="newMonitor[PreEventCount]" value="<?php echo validHtmlStr($newMonitor['PreEventCount']) ?>"/> <input type="hidden" name="newMonitor[PreEventCount]" value="<?php echo validHtmlStr($newMonitor['PreEventCount']) ?>"/>
<input type="hidden" name="newMonitor[PostEventCount]" value="<?php echo validHtmlStr($newMonitor['PostEventCount']) ?>"/> <input type="hidden" name="newMonitor[PostEventCount]" value="<?php echo validHtmlStr($newMonitor['PostEventCount']) ?>"/>
<input type="hidden" name="newMonitor[StreamReplayBuffer]" value="<?php echo validHtmlStr($newMonitor['StreamReplayBuffer']) ?>"/> <input type="hidden" name="newMonitor[StreamReplayBuffer]" value="<?php echo validHtmlStr($newMonitor['StreamReplayBuffer']) ?>"/>
<input type="hidden" name="newMonitor[AlarmFrameCount]" value="<?php echo validHtmlStr($newMonitor['AlarmFrameCount']) ?>"/> <input type="hidden" name="newMonitor[AlarmFrameCount]" value="<?php echo validHtmlStr($newMonitor['AlarmFrameCount']) ?>"/>
<?php <?php
} }
if ( ZM_OPT_CONTROL && $tab != 'control' ) { if ( ZM_OPT_CONTROL && $tab != 'control' ) {
?> ?>
<input type="hidden" name="newMonitor[Controllable]" value="<?php echo validHtmlStr($newMonitor['Controllable']) ?>"/> <input type="hidden" name="newMonitor[Controllable]" value="<?php echo validHtmlStr($newMonitor['Controllable']) ?>"/>
<input type="hidden" name="newMonitor[ControlId]" value="<?php echo validHtmlStr($newMonitor['ControlId']) ?>"/> <input type="hidden" name="newMonitor[ControlId]" value="<?php echo validHtmlStr($newMonitor['ControlId']) ?>"/>
<input type="hidden" name="newMonitor[ControlDevice]" value="<?php echo validHtmlStr($newMonitor['ControlDevice']) ?>"/> <input type="hidden" name="newMonitor[ControlDevice]" value="<?php echo validHtmlStr($newMonitor['ControlDevice']) ?>"/>
<input type="hidden" name="newMonitor[ControlAddress]" value="<?php echo validHtmlStr($newMonitor['ControlAddress']) ?>"/> <input type="hidden" name="newMonitor[ControlAddress]" value="<?php echo validHtmlStr($newMonitor['ControlAddress']) ?>"/>
<input type="hidden" name="newMonitor[AutoStopTimeout]" value="<?php echo validHtmlStr($newMonitor['AutoStopTimeout']) ?>"/> <input type="hidden" name="newMonitor[AutoStopTimeout]" value="<?php echo validHtmlStr($newMonitor['AutoStopTimeout']) ?>"/>
<input type="hidden" name="newMonitor[TrackMotion]" value="<?php echo validHtmlStr($newMonitor['TrackMotion']) ?>"/> <input type="hidden" name="newMonitor[TrackMotion]" value="<?php echo validHtmlStr($newMonitor['TrackMotion']) ?>"/>
<input type="hidden" name="newMonitor[TrackDelay]" value="<?php echo validHtmlStr($newMonitor['TrackDelay']) ?>"/> <input type="hidden" name="newMonitor[TrackDelay]" value="<?php echo validHtmlStr($newMonitor['TrackDelay']) ?>"/>
<input type="hidden" name="newMonitor[ReturnLocation]" value="<?php echo validHtmlStr($newMonitor['ReturnLocation']) ?>"/> <input type="hidden" name="newMonitor[ReturnLocation]" value="<?php echo validHtmlStr($newMonitor['ReturnLocation']) ?>"/>
<input type="hidden" name="newMonitor[ReturnDelay]" value="<?php echo validHtmlStr($newMonitor['ReturnDelay']) ?>"/> <input type="hidden" name="newMonitor[ReturnDelay]" value="<?php echo validHtmlStr($newMonitor['ReturnDelay']) ?>"/>
<?php <?php
} }
if ( ZM_OPT_X10 && $tab != 'x10' ) { if ( ZM_OPT_X10 && $tab != 'x10' ) {
?> ?>
<input type="hidden" name="newX10Monitor[Activation]" value="<?php echo validHtmlStr($newX10Monitor['Activation']) ?>"/> <input type="hidden" name="newX10Monitor[Activation]" value="<?php echo validHtmlStr($newX10Monitor['Activation']) ?>"/>
<input type="hidden" name="newX10Monitor[AlarmInput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmInput']) ?>"/> <input type="hidden" name="newX10Monitor[AlarmInput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmInput']) ?>"/>
<input type="hidden" name="newX10Monitor[AlarmOutput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmOutput']) ?>"/> <input type="hidden" name="newX10Monitor[AlarmOutput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmOutput']) ?>"/>
<?php <?php
} }
if ( $tab != 'misc' ) { if ( $tab != 'misc' ) {
?> ?>
<input type="hidden" name="newMonitor[EventPrefix]" value="<?php echo validHtmlStr($newMonitor['EventPrefix']) ?>"/> <input type="hidden" name="newMonitor[EventPrefix]" value="<?php echo validHtmlStr($newMonitor['EventPrefix']) ?>"/>
<input type="hidden" name="newMonitor[SectionLength]" value="<?php echo validHtmlStr($newMonitor['SectionLength']) ?>"/> <input type="hidden" name="newMonitor[SectionLength]" value="<?php echo validHtmlStr($newMonitor['SectionLength']) ?>"/>
<input type="hidden" name="newMonitor[FrameSkip]" value="<?php echo validHtmlStr($newMonitor['FrameSkip']) ?>"/> <input type="hidden" name="newMonitor[FrameSkip]" value="<?php echo validHtmlStr($newMonitor['FrameSkip']) ?>"/>
<input type="hidden" name="newMonitor[MotionFrameSkip]" value="<?php echo validHtmlStr($newMonitor['MotionFrameSkip']) ?>"/> <input type="hidden" name="newMonitor[MotionFrameSkip]" value="<?php echo validHtmlStr($newMonitor['MotionFrameSkip']) ?>"/>
<input type="hidden" name="newMonitor[AnalysisUpdateDelay]" value="<?php echo validHtmlStr($newMonitor['AnalysisUpdateDelay']) ?>"/> <input type="hidden" name="newMonitor[AnalysisUpdateDelay]" value="<?php echo validHtmlStr($newMonitor['AnalysisUpdateDelay']) ?>"/>
<input type="hidden" name="newMonitor[FPSReportInterval]" value="<?php echo validHtmlStr($newMonitor['FPSReportInterval']) ?>"/> <input type="hidden" name="newMonitor[FPSReportInterval]" value="<?php echo validHtmlStr($newMonitor['FPSReportInterval']) ?>"/>
<input type="hidden" name="newMonitor[DefaultView]" value="<?php echo validHtmlStr($newMonitor['DefaultView']) ?>"/> <input type="hidden" name="newMonitor[DefaultView]" value="<?php echo validHtmlStr($newMonitor['DefaultView']) ?>"/>
<input type="hidden" name="newMonitor[DefaultRate]" value="<?php echo validHtmlStr($newMonitor['DefaultRate']) ?>"/> <input type="hidden" name="newMonitor[DefaultRate]" value="<?php echo validHtmlStr($newMonitor['DefaultRate']) ?>"/>
<input type="hidden" name="newMonitor[DefaultScale]" value="<?php echo validHtmlStr($newMonitor['DefaultScale']) ?>"/> <input type="hidden" name="newMonitor[DefaultScale]" value="<?php echo validHtmlStr($newMonitor['DefaultScale']) ?>"/>
<input type="hidden" name="newMonitor[WebColour]" value="<?php echo validHtmlStr($newMonitor['WebColour']) ?>"/> <input type="hidden" name="newMonitor[WebColour]" value="<?php echo validHtmlStr($newMonitor['WebColour']) ?>"/>
<input type="hidden" name="newMonitor[Exif]" value="<?php echo validHtmlStr($newMonitor['Exif']) ?>"/> <input type="hidden" name="newMonitor[Exif]" value="<?php echo validHtmlStr($newMonitor['Exif']) ?>"/>
<?php <?php
} }
if ( ZM_HAS_V4L && ($tab != 'misc' || $newMonitor['Type'] != 'Local') ) { if ( ZM_HAS_V4L && ($tab != 'misc' || $newMonitor['Type'] != 'Local') ) {
?> ?>
<input type="hidden" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($newMonitor['SignalCheckColour']) ?>"/> <input type="hidden" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($newMonitor['SignalCheckColour']) ?>"/>
<?php <?php
} }
?> ?>
<table id="contentTable" class="major" cellspacing="0"> <table id="contentTable" class="major" cellspacing="0">
<tbody> <tbody>
<?php <?php
switch ( $tab ) { switch ( $tab ) {
case 'general' : case 'general' :
{ {
?> ?>
<tr><td><?php echo translate('Name') ?></td><td><input type="text" name="newMonitor[Name]" value="<?php echo validHtmlStr($newMonitor['Name']) ?>" size="16"/></td></tr> <tr><td><?php echo translate('Name') ?></td><td><input type="text" name="newMonitor[Name]" value="<?php echo validHtmlStr($newMonitor['Name']) ?>" size="16"/></td></tr>
<tr><td><?php echo translate('Server') ?></td><td> <tr><td><?php echo translate('Server') ?></td><td>
<?php <?php
$servers = array(''=>'None'); $servers = array(''=>'None');
$result = dbQuery( 'SELECT * FROM Servers ORDER BY Name'); $result = dbQuery( 'SELECT * FROM Servers ORDER BY Name');
$results = $result->fetchALL(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Server' ); $results = $result->fetchALL(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Server' );
foreach ( $results as $row => $server_obj ) { foreach ( $results as $row => $server_obj ) {
$servers[$server_obj->Id] = $server_obj->Name(); $servers[$server_obj->Id] = $server_obj->Name();
} }
?> ?>
<?php echo buildSelect( "newMonitor[ServerId]", $servers ); ?> <?php echo buildSelect( "newMonitor[ServerId]", $servers ); ?>
</td></tr> </td></tr>
<tr><td><?php echo translate('SourceType') ?></td><td><?php echo buildSelect( "newMonitor[Type]", $sourceTypes ); ?></td></tr> <tr><td><?php echo translate('SourceType') ?></td><td><?php echo buildSelect( "newMonitor[Type]", $sourceTypes ); ?></td></tr>
<tr><td><?php echo translate('Function') ?></td><td><select name="newMonitor[Function]"> <tr><td><?php echo translate('Function') ?></td><td><select name="newMonitor[Function]">
<?php <?php
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction ) { foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction ) {
?> ?>
<option value="<?php echo $optFunction ?>"<?php if ( $optFunction == $newMonitor['Function'] ) { ?> selected="selected"<?php } ?>><?php echo translate('Fn'.$optFunction) ?></option> <option value="<?php echo $optFunction ?>"<?php if ( $optFunction == $newMonitor['Function'] ) { ?> selected="selected"<?php } ?>><?php echo translate('Fn'.$optFunction) ?></option>
<?php <?php
} }
?> ?>
</select></td></tr> </select></td></tr>
<tr><td><?php echo translate('Enabled') ?></td><td><input type="checkbox" name="newMonitor[Enabled]" value="1"<?php if ( !empty($newMonitor['Enabled']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('Enabled') ?></td><td><input type="checkbox" name="newMonitor[Enabled]" value="1"<?php if ( !empty($newMonitor['Enabled']) ) { ?> checked="checked"<?php } ?>/></td></tr>
@ -693,140 +694,139 @@ switch ( $tab ) {
<td> <td>
<select name="monitorIds" size="4" multiple="multiple" onchange="updateLinkedMonitors( this )"> <select name="monitorIds" size="4" multiple="multiple" onchange="updateLinkedMonitors( this )">
<?php <?php
$monitors = dbFetchAll( "select Id,Name from Monitors order by Sequence asc" ); $monitors = dbFetchAll( "select Id,Name from Monitors order by Sequence asc" );
if ( !empty($newMonitor['LinkedMonitors']) ) if ( !empty($newMonitor['LinkedMonitors']) )
$monitorIds = array_flip( explode( ',', $newMonitor['LinkedMonitors'] ) ); $monitorIds = array_flip( explode( ',', $newMonitor['LinkedMonitors'] ) );
else else
$monitorIds = array(); $monitorIds = array();
foreach ( $monitors as $monitor ) { foreach ( $monitors as $monitor ) {
if ( (empty($newMonitor['Id']) || ($monitor['Id'] != $newMonitor['Id'])) && visibleMonitor( $monitor['Id'] ) ) { if ( (empty($newMonitor['Id']) || ($monitor['Id'] != $newMonitor['Id'])) && visibleMonitor( $monitor['Id'] ) ) {
?> ?>
<option value="<?php echo $monitor['Id'] ?>"<?php if ( array_key_exists( $monitor['Id'], $monitorIds ) ) { ?> selected="selected"<?php } ?>><?php echo validHtmlStr($monitor['Name']) ?></option> <option value="<?php echo $monitor['Id'] ?>"<?php if ( array_key_exists( $monitor['Id'], $monitorIds ) ) { ?> selected="selected"<?php } ?>><?php echo validHtmlStr($monitor['Name']) ?></option>
<?php <?php
} }
} }
?> ?>
</select> </select>
</td> </td>
</tr> </tr>
<tr><td><?php echo translate('AnalysisFPS') ?></td><td><input type="text" name="newMonitor[AnalysisFPS]" value="<?php echo validHtmlStr($newMonitor['AnalysisFPS']) ?>" size="6"/></td></tr> <tr><td><?php echo translate('AnalysisFPS') ?></td><td><input type="text" name="newMonitor[AnalysisFPS]" value="<?php echo validHtmlStr($newMonitor['AnalysisFPS']) ?>" size="6"/></td></tr>
<?php <?php
if ( $newMonitor['Type'] != 'Local' && $newMonitor['Type'] != 'File' ) { if ( $newMonitor['Type'] != 'Local' && $newMonitor['Type'] != 'File' ) {
?> ?>
<tr><td><?php echo translate('MaximumFPS') ?>&nbsp;(<?php echo makePopupLink('?view=optionhelp&amp;option=OPTIONS_MAXFPS', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" onclick="document.getElementById('newMonitor[MaxFPS]').innerHTML= ' CAUTION: See the help text'" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="5"/><span id="newMonitor[MaxFPS]" style="color:red"></span></td></tr> <tr><td><?php echo translate('MaximumFPS') ?>&nbsp;(<?php echo makePopupLink('?view=optionhelp&amp;option=OPTIONS_MAXFPS', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" onclick="document.getElementById('newMonitor[MaxFPS]').innerHTML= ' CAUTION: See the help text'" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="5"/><span id="newMonitor[MaxFPS]" style="color:red"></span></td></tr>
<tr><td><?php echo translate('AlarmMaximumFPS') ?>&nbsp;(<?php echo makePopupLink('?view=optionhelp&amp;option=OPTIONS_MAXFPS', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" onclick="document.getElementById('newMonitor[AlarmMaxFPS]').innerHTML= ' CAUTION: See the help text'" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/><span id="newMonitor[AlarmMaxFPS]" style="color:red"></span></td></tr> <tr><td><?php echo translate('AlarmMaximumFPS') ?>&nbsp;(<?php echo makePopupLink('?view=optionhelp&amp;option=OPTIONS_MAXFPS', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" onclick="document.getElementById('newMonitor[AlarmMaxFPS]').innerHTML= ' CAUTION: See the help text'" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/><span id="newMonitor[AlarmMaxFPS]" style="color:red"></span></td></tr>
<?php <?php
} else { } else {
?> ?>
<tr><td><?php echo translate('MaximumFPS') ?></td><td><input type="text" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="5"/></td></tr> <tr><td><?php echo translate('MaximumFPS') ?></td><td><input type="text" name="newMonitor[MaxFPS]" value="<?php echo validHtmlStr($newMonitor['MaxFPS']) ?>" size="5"/></td></tr>
<tr><td><?php echo translate('AlarmMaximumFPS') ?></td><td><input type="text" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/></td></tr> <tr><td><?php echo translate('AlarmMaximumFPS') ?></td><td><input type="text" name="newMonitor[AlarmMaxFPS]" value="<?php echo validHtmlStr($newMonitor['AlarmMaxFPS']) ?>" size="5"/></td></tr>
<?php <?php
} }
if ( ZM_FAST_IMAGE_BLENDS ) if ( ZM_FAST_IMAGE_BLENDS ) {
{
?> ?>
<tr><td><?php echo translate('RefImageBlendPct') ?></td><td><select name="newMonitor[RefBlendPerc]"><?php foreach ( $fastblendopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['RefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('RefImageBlendPct') ?></td><td><select name="newMonitor[RefBlendPerc]"><?php foreach ( $fastblendopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['RefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('AlarmRefImageBlendPct') ?></td><td><select name="newMonitor[AlarmRefBlendPerc]"><?php foreach ( $fastblendopts_alarm as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['AlarmRefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('AlarmRefImageBlendPct') ?></td><td><select name="newMonitor[AlarmRefBlendPerc]"><?php foreach ( $fastblendopts_alarm as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['AlarmRefBlendPerc'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<?php <?php
} else { } else {
?> ?>
<tr><td><?php echo translate('RefImageBlendPct') ?></td><td><input type="text" name="newMonitor[RefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['RefBlendPerc']) ?>" size="4"/></td></tr> <tr><td><?php echo translate('RefImageBlendPct') ?></td><td><input type="text" name="newMonitor[RefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['RefBlendPerc']) ?>" size="4"/></td></tr>
<tr><td><?php echo translate('AlarmRefImageBlendPct') ?></td><td><input type="text" name="newMonitor[AlarmRefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['AlarmRefBlendPerc']) ?>" size="4"/></td></tr> <tr><td><?php echo translate('AlarmRefImageBlendPct') ?></td><td><input type="text" name="newMonitor[AlarmRefBlendPerc]" value="<?php echo validHtmlStr($newMonitor['AlarmRefBlendPerc']) ?>" size="4"/></td></tr>
<?php <?php
} }
?> ?>
<tr><td><?php echo translate('Triggers') ?></td><td> <tr><td><?php echo translate('Triggers') ?></td><td>
<?php <?php
$optTriggers = getSetValues( 'Monitors', 'Triggers' ); $optTriggers = getSetValues( 'Monitors', 'Triggers' );
$breakCount = (int)(ceil(count($optTriggers))); $breakCount = (int)(ceil(count($optTriggers)));
$breakCount = min( 3, $breakCount ); $breakCount = min( 3, $breakCount );
$optCount = 0; $optCount = 0;
foreach( $optTriggers as $optTrigger ) { foreach( $optTriggers as $optTrigger ) {
if ( !ZM_OPT_X10 && $optTrigger == 'X10' ) if ( !ZM_OPT_X10 && $optTrigger == 'X10' )
continue; continue;
if ( $optCount && ($optCount%$breakCount == 0) ) if ( $optCount && ($optCount%$breakCount == 0) )
echo "</br>"; echo '</br>';
?> ?>
<input type="checkbox" name="newMonitor[Triggers][]" value="<?php echo $optTrigger ?>"<?php if ( isset($newMonitor['Triggers']) && in_array( $optTrigger, $newMonitor['Triggers'] ) ) { ?> checked="checked"<?php } ?>/>&nbsp;<?php echo $optTrigger ?> <input type="checkbox" name="newMonitor[Triggers][]" value="<?php echo $optTrigger ?>"<?php if ( isset($newMonitor['Triggers']) && in_array( $optTrigger, $newMonitor['Triggers'] ) ) { ?> checked="checked"<?php } ?>/>&nbsp;<?php echo $optTrigger ?>
<?php <?php
$optCount ++; $optCount ++;
} } // end foreach $optTrigger
if ( !$optCount ) { if ( !$optCount ) {
?> ?>
<em><?php echo translate('NoneAvailable') ?></em> <em><?php echo translate('NoneAvailable') ?></em>
<?php <?php
} }
?> ?>
</td></tr> </td></tr>
<?php <?php
break; break;
} }
case 'source' : case 'source' :
{ {
if ( ZM_HAS_V4L && $newMonitor['Type'] == 'Local' ) { if ( ZM_HAS_V4L && $newMonitor['Type'] == 'Local' ) {
?> ?>
<tr><td><?php echo translate('DevicePath') ?></td><td><input type="text" name="newMonitor[Device]" value="<?php echo validHtmlStr($newMonitor['Device']) ?>" size="24"/></td></tr> <tr><td><?php echo translate('DevicePath') ?></td><td><input type="text" name="newMonitor[Device]" value="<?php echo validHtmlStr($newMonitor['Device']) ?>" size="24"/></td></tr>
<tr><td><?php echo translate('CaptureMethod') ?></td><td><?php echo buildSelect( "newMonitor[Method]", $localMethods, "submitTab( '$tab' )" ); ?></td></tr> <tr><td><?php echo translate('CaptureMethod') ?></td><td><?php echo buildSelect( "newMonitor[Method]", $localMethods, "submitTab( '$tab' )" ); ?></td></tr>
<?php <?php
if ( ZM_HAS_V4L1 && $newMonitor['Method'] == 'v4l1' ) { if ( ZM_HAS_V4L1 && $newMonitor['Method'] == 'v4l1' ) {
?> ?>
<tr><td><?php echo translate('DeviceChannel') ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l1DeviceChannels as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('DeviceChannel') ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l1DeviceChannels as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('DeviceFormat') ?></td><td><select name="newMonitor[Format]"><?php foreach ( $v4l1DeviceFormats as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('DeviceFormat') ?></td><td><select name="newMonitor[Format]"><?php foreach ( $v4l1DeviceFormats as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('CapturePalette') ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l1LocalPalettes as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('CapturePalette') ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l1LocalPalettes as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<?php <?php
} else { } else {
?> ?>
<tr><td><?php echo translate('DeviceChannel') ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l2DeviceChannels as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('DeviceChannel') ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $v4l2DeviceChannels as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('DeviceFormat') ?></td><td><select name="newMonitor[Format]"><?php foreach ( $v4l2DeviceFormats as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('DeviceFormat') ?></td><td><select name="newMonitor[Format]"><?php foreach ( $v4l2DeviceFormats as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('CapturePalette') ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('CapturePalette') ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $v4l2LocalPalettes as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<?php <?php
} }
?> ?>
<tr><td><?php echo translate('V4LMultiBuffer') ?></td><td> <tr><td><?php echo translate('V4LMultiBuffer') ?></td><td>
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]1" value="1" <?php echo ( $newMonitor['V4LMultiBuffer'] == 1 ? 'checked="checked"' : '' ) ?>/> <input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]1" value="1" <?php echo ( $newMonitor['V4LMultiBuffer'] == 1 ? 'checked="checked"' : '' ) ?>/>
<label for="newMonitor[V4LMultiBuffer]1">Yes</label> <label for="newMonitor[V4LMultiBuffer]1">Yes</label>
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]0" value="0" <?php echo ( $newMonitor['V4LMultiBuffer'] == 0 ? 'checked="checked"' : '' ) ?>/> <input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]0" value="0" <?php echo ( $newMonitor['V4LMultiBuffer'] == 0 ? 'checked="checked"' : '' ) ?>/>
<label for="newMonitor[V4LMultiBuffer]0">No</label> <label for="newMonitor[V4LMultiBuffer]0">No</label>
<input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]" value="" <?php echo ( empty($newMonitor['V4LMultiBuffer']) ? 'checked="checked"' : '' ) ?>/> <input type="radio" name="newMonitor[V4LMultiBuffer]" id="newMonitor[V4LMultiBuffer]" value="" <?php echo ( empty($newMonitor['V4LMultiBuffer']) ? 'checked="checked"' : '' ) ?>/>
<label for="newMonitor[V4LMultiBuffer]">Use Config Value</label> <label for="newMonitor[V4LMultiBuffer]">Use Config Value</label>
</td></tr> </td></tr>
<tr><td><?php echo translate('V4LCapturesPerFrame') ?></td><td><input type="number" name="newMonitor[V4LCapturesPerFrame]" value="<?php echo $newMonitor['V4LCapturesPerFrame'] ?>"/></td></tr> <tr><td><?php echo translate('V4LCapturesPerFrame') ?></td><td><input type="number" name="newMonitor[V4LCapturesPerFrame]" value="<?php echo $newMonitor['V4LCapturesPerFrame'] ?>"/></td></tr>
<?php <?php
} elseif ( $newMonitor['Type'] == 'Remote' ) { } elseif ( $newMonitor['Type'] == 'Remote' ) {
?> ?>
<tr><td><?php echo translate('RemoteProtocol') ?></td><td><?php echo buildSelect( "newMonitor[Protocol]", $remoteProtocols, "updateMethods( this );if(this.value=='rtsp'){\$('RTSPDescribe').setStyle('display','table-row');}else{\$('RTSPDescribe').hide();}" ); ?></td></tr> <tr><td><?php echo translate('RemoteProtocol') ?></td><td><?php echo buildSelect( "newMonitor[Protocol]", $remoteProtocols, "updateMethods( this );if(this.value=='rtsp'){\$('RTSPDescribe').setStyle('display','table-row');}else{\$('RTSPDescribe').hide();}" ); ?></td></tr>
<?php <?php
if ( empty($newMonitor['Protocol']) || $newMonitor['Protocol'] == 'http' ) { if ( empty($newMonitor['Protocol']) || $newMonitor['Protocol'] == 'http' ) {
?> ?>
<tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo buildSelect( 'newMonitor[Method]', $httpMethods ); ?></td></tr> <tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo buildSelect( 'newMonitor[Method]', $httpMethods ); ?></td></tr>
<?php <?php
} else { } else {
?> ?>
<tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo buildSelect( 'newMonitor[Method]', $rtspMethods ); ?></td></tr> <tr><td><?php echo translate('RemoteMethod') ?></td><td><?php echo buildSelect( 'newMonitor[Method]', $rtspMethods ); ?></td></tr>
<?php <?php
} }
?> ?>
<tr><td><?php echo translate('RemoteHostName') ?></td><td><input type="text" name="newMonitor[Host]" value="<?php echo validHtmlStr($newMonitor['Host']) ?>" size="36"/></td></tr> <tr><td><?php echo translate('RemoteHostName') ?></td><td><input type="text" name="newMonitor[Host]" value="<?php echo validHtmlStr($newMonitor['Host']) ?>" size="36"/></td></tr>
<tr><td><?php echo translate('RemoteHostPort') ?></td><td><input type="text" name="newMonitor[Port]" value="<?php echo validHtmlStr($newMonitor['Port']) ?>" size="6"/></td></tr> <tr><td><?php echo translate('RemoteHostPort') ?></td><td><input type="text" name="newMonitor[Port]" value="<?php echo validHtmlStr($newMonitor['Port']) ?>" size="6"/></td></tr>
<tr><td><?php echo translate('RemoteHostPath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr> <tr><td><?php echo translate('RemoteHostPath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
<?php <?php
} elseif ( $newMonitor['Type'] == 'File' ) { } elseif ( $newMonitor['Type'] == 'File' ) {
?> ?>
<tr><td><?php echo translate('SourcePath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr> <tr><td><?php echo translate('SourcePath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
<?php <?php
} elseif ( $newMonitor['Type'] == 'cURL' ) { } elseif ( $newMonitor['Type'] == 'cURL' ) {
?> ?>
<tr><td><?php echo 'URL' ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr> <tr><td><?php echo 'URL' ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
<tr><td><?php echo 'Username' ?></td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($newMonitor['User']) ?>" size="12"/></td></tr> <tr><td><?php echo 'Username' ?></td><td><input type="text" name="newMonitor[User]" value="<?php echo validHtmlStr($newMonitor['User']) ?>" size="12"/></td></tr>
<tr><td><?php echo 'Password' ?></td><td><input type="text" name="newMonitor[Pass]" value="<?php echo validHtmlStr($newMonitor['Pass']) ?>" size="12"/></td></tr> <tr><td><?php echo 'Password' ?></td><td><input type="text" name="newMonitor[Pass]" value="<?php echo validHtmlStr($newMonitor['Pass']) ?>" size="12"/></td></tr>
<?php <?php
} elseif ( $newMonitor['Type'] == 'Ffmpeg' || $newMonitor['Type'] == 'Libvlc') { } elseif ( $newMonitor['Type'] == 'Ffmpeg' || $newMonitor['Type'] == 'Libvlc' ) {
?> ?>
<tr><td><?php echo translate('SourcePath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr> <tr><td><?php echo translate('SourcePath') ?></td><td><input type="text" name="newMonitor[Path]" value="<?php echo validHtmlStr($newMonitor['Path']) ?>" size="36"/></td></tr>
<tr><td><?php echo translate('RemoteMethod') ?>&nbsp;(<?php echo makePopupLink('?view=optionhelp&amp;option=OPTIONS_RTSPTrans', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><?php echo buildSelect( "newMonitor[Method]", $rtspFFMpegMethods ); ?></td></tr> <tr><td><?php echo translate('RemoteMethod') ?>&nbsp;(<?php echo makePopupLink('?view=optionhelp&amp;option=OPTIONS_RTSPTrans', 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><?php echo buildSelect( "newMonitor[Method]", $rtspFFMpegMethods ); ?></td></tr>
<tr><td><?php echo translate('Options') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_'.strtoupper($newMonitor['Type']), 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" name="newMonitor[Options]" value="<?php echo validHtmlStr($newMonitor['Options']) ?>" size="36"/></td></tr> <tr><td><?php echo translate('Options') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_'.strtoupper($newMonitor['Type']), 'zmOptionHelp', 'optionhelp', '?' ) ?>)</td><td><input type="text" name="newMonitor[Options]" value="<?php echo validHtmlStr($newMonitor['Options']) ?>" size="36"/></td></tr>
<?php <?php
} }
?> ?>
<tr><td><?php echo translate('TargetColorspace') ?></td><td><select name="newMonitor[Colours]"><?php foreach ( $Colours as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Colours'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('TargetColorspace') ?></td><td><select name="newMonitor[Colours]"><?php foreach ( $Colours as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Colours'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('CaptureWidth') ?> (<?php echo translate('Pixels') ?>)</td><td><input type="text" name="newMonitor[Width]" value="<?php echo validHtmlStr($newMonitor['Width']) ?>" size="4" onkeyup="updateMonitorDimensions(this);"/></td></tr> <tr><td><?php echo translate('CaptureWidth') ?> (<?php echo translate('Pixels') ?>)</td><td><input type="text" name="newMonitor[Width]" value="<?php echo validHtmlStr($newMonitor['Width']) ?>" size="4" onkeyup="updateMonitorDimensions(this);"/></td></tr>
@ -834,35 +834,31 @@ switch ( $tab ) {
<tr><td><?php echo translate('PreserveAspect') ?></td><td><input type="checkbox" name="preserveAspectRatio" value="1"/></td></tr> <tr><td><?php echo translate('PreserveAspect') ?></td><td><input type="checkbox" name="preserveAspectRatio" value="1"/></td></tr>
<tr><td><?php echo translate('Orientation') ?></td><td><select name="newMonitor[Orientation]"><?php foreach ( $orientations as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Orientation'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('Orientation') ?></td><td><select name="newMonitor[Orientation]"><?php foreach ( $orientations as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Orientation'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<?php <?php
if ( $newMonitor['Type'] == 'Local' ) { if ( $newMonitor['Type'] == 'Local' ) {
?> ?>
<tr><td><?php echo translate('Deinterlacing') ?></td><td><select name="newMonitor[Deinterlacing]"><?php foreach ( $deinterlaceopts_v4l2 as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Deinterlacing'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('Deinterlacing') ?></td><td><select name="newMonitor[Deinterlacing]"><?php foreach ( $deinterlaceopts_v4l2 as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Deinterlacing'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<?php <?php
} else { } else {
?> ?>
<tr><td><?php echo translate('Deinterlacing') ?></td><td><select name="newMonitor[Deinterlacing]"><?php foreach ( $deinterlaceopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Deinterlacing'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('Deinterlacing') ?></td><td><select name="newMonitor[Deinterlacing]"><?php foreach ( $deinterlaceopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['Deinterlacing'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<?php <?php
} }
?> if ( $newMonitor['Type'] == 'Remote' ) {
<?php
if ( $newMonitor['Type'] == 'Remote' ) {
?> ?>
<tr id="RTSPDescribe"<?php if ( $newMonitor['Protocol'] != 'rtsp' ) { echo ' style="display:none;"'; } ?>><td><?php echo translate('RTSPDescribe') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_RTSPDESCRIBE', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td><td><input type="checkbox" name="newMonitor[RTSPDescribe]" value="1"<?php if ( !empty($newMonitor['RTSPDescribe']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr id="RTSPDescribe"<?php if ( $newMonitor['Protocol'] != 'rtsp' ) { echo ' style="display:none;"'; } ?>><td><?php echo translate('RTSPDescribe') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_RTSPDESCRIBE', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td><td><input type="checkbox" name="newMonitor[RTSPDescribe]" value="1"<?php if ( !empty($newMonitor['RTSPDescribe']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php <?php
} }
?> break;
<?php
break;
} }
case 'storage' : case 'storage' :
?> ?>
<tr><td><?php echo translate('SaveJPEGs') ?></td><td><select name="newMonitor[SaveJPEGs]"><?php foreach ( $savejpegopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['SaveJPEGs'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('SaveJPEGs') ?></td><td><select name="newMonitor[SaveJPEGs]"><?php foreach ( $savejpegopts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['SaveJPEGs'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('VideoWriter') ?></td><td><select name="newMonitor[VideoWriter]"><?php foreach ( $videowriteropts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['VideoWriter'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('VideoWriter') ?></td><td><select name="newMonitor[VideoWriter]"><?php foreach ( $videowriteropts as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['VideoWriter'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<tr><td><?php echo translate('OptionalEncoderParam') ?></td><td><textarea name="newMonitor[EncoderParameters]" rows="4" cols="36"><?php echo validHtmlStr($newMonitor['EncoderParameters']) ?></textarea></td></tr> <tr><td><?php echo translate('OptionalEncoderParam') ?></td><td><textarea name="newMonitor[EncoderParameters]" rows="4" cols="36"><?php echo validHtmlStr($newMonitor['EncoderParameters']) ?></textarea></td></tr>
<tr><td><?php echo translate('RecordAudio') ?></td><td><input type="checkbox" name="newMonitor[RecordAudio]" value="1"<?php if ( !empty($newMonitor['RecordAudio']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('RecordAudio') ?></td><td><input type="checkbox" name="newMonitor[RecordAudio]" value="1"<?php if ( !empty($newMonitor['RecordAudio']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php <?php
break; break;
case 'timestamp' : case 'timestamp' :
{ {
?> ?>
<tr><td><?php echo translate('TimestampLabelFormat') ?></td><td><input type="text" name="newMonitor[LabelFormat]" value="<?php echo validHtmlStr($newMonitor['LabelFormat']) ?>" size="32"/></td></tr> <tr><td><?php echo translate('TimestampLabelFormat') ?></td><td><input type="text" name="newMonitor[LabelFormat]" value="<?php echo validHtmlStr($newMonitor['LabelFormat']) ?>" size="32"/></td></tr>
@ -870,9 +866,9 @@ switch ( $tab ) {
<tr><td><?php echo translate('TimestampLabelY') ?></td><td><input type="text" name="newMonitor[LabelY]" value="<?php echo validHtmlStr($newMonitor['LabelY']) ?>" size="4"/></td></tr> <tr><td><?php echo translate('TimestampLabelY') ?></td><td><input type="text" name="newMonitor[LabelY]" value="<?php echo validHtmlStr($newMonitor['LabelY']) ?>" size="4"/></td></tr>
<tr><td><?php echo translate('TimestampLabelSize') ?></td><td><select name="newMonitor[LabelSize]"><?php foreach ( $label_size as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['LabelSize'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr> <tr><td><?php echo translate('TimestampLabelSize') ?></td><td><select name="newMonitor[LabelSize]"><?php foreach ( $label_size as $name => $value ) { ?><option value="<?php echo $value ?>"<?php if ( $value == $newMonitor['LabelSize'] ) { ?> selected="selected"<?php } ?>><?php echo $name ?></option><?php } ?></select></td></tr>
<?php <?php
break; break;
} }
case 'buffers' : case 'buffers' :
{ {
?> ?>
<tr><td><?php echo translate('ImageBufferSize') ?></td><td><input type="text" name="newMonitor[ImageBufferCount]" value="<?php echo validHtmlStr($newMonitor['ImageBufferCount']) ?>" size="6"/></td></tr> <tr><td><?php echo translate('ImageBufferSize') ?></td><td><input type="text" name="newMonitor[ImageBufferCount]" value="<?php echo validHtmlStr($newMonitor['ImageBufferCount']) ?>" size="6"/></td></tr>
@ -882,9 +878,9 @@ switch ( $tab ) {
<tr><td><?php echo translate('StreamReplayBuffer') ?></td><td><input type="text" name="newMonitor[StreamReplayBuffer]" value="<?php echo validHtmlStr($newMonitor['StreamReplayBuffer']) ?>" size="6"/></td></tr> <tr><td><?php echo translate('StreamReplayBuffer') ?></td><td><input type="text" name="newMonitor[StreamReplayBuffer]" value="<?php echo validHtmlStr($newMonitor['StreamReplayBuffer']) ?>" size="6"/></td></tr>
<tr><td><?php echo translate('AlarmFrameCount') ?></td><td><input type="text" name="newMonitor[AlarmFrameCount]" value="<?php echo validHtmlStr($newMonitor['AlarmFrameCount']) ?>" size="4"/></td></tr> <tr><td><?php echo translate('AlarmFrameCount') ?></td><td><input type="text" name="newMonitor[AlarmFrameCount]" value="<?php echo validHtmlStr($newMonitor['AlarmFrameCount']) ?>" size="4"/></td></tr>
<?php <?php
break; break;
} }
case 'control' : case 'control' :
{ {
?> ?>
<tr><td><?php echo translate('Controllable') ?></td><td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( !empty($newMonitor['Controllable']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('Controllable') ?></td><td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( !empty($newMonitor['Controllable']) ) { ?> checked="checked"<?php } ?>/></td></tr>
@ -894,28 +890,28 @@ switch ( $tab ) {
<tr><td><?php echo translate('AutoStopTimeout') ?></td><td><input type="text" name="newMonitor[AutoStopTimeout]" value="<?php echo validHtmlStr($newMonitor['AutoStopTimeout']) ?>" size="4"/></td></tr> <tr><td><?php echo translate('AutoStopTimeout') ?></td><td><input type="text" name="newMonitor[AutoStopTimeout]" value="<?php echo validHtmlStr($newMonitor['AutoStopTimeout']) ?>" size="4"/></td></tr>
<tr><td><?php echo translate('TrackMotion') ?></td><td><input type="checkbox" name="newMonitor[TrackMotion]" value="1"<?php if ( !empty($newMonitor['TrackMotion']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('TrackMotion') ?></td><td><input type="checkbox" name="newMonitor[TrackMotion]" value="1"<?php if ( !empty($newMonitor['TrackMotion']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php <?php
$return_options = array( $return_options = array(
'-1' => translate('None'), '-1' => translate('None'),
'0' => translate('Home'), '0' => translate('Home'),
'1' => translate('Preset')." 1", '1' => translate('Preset')." 1",
); );
?> ?>
<tr><td><?php echo translate('TrackDelay') ?></td><td><input type="text" name="newMonitor[TrackDelay]" value="<?php echo validHtmlStr($newMonitor['TrackDelay']) ?>" size="4"/></td></tr> <tr><td><?php echo translate('TrackDelay') ?></td><td><input type="text" name="newMonitor[TrackDelay]" value="<?php echo validHtmlStr($newMonitor['TrackDelay']) ?>" size="4"/></td></tr>
<tr><td><?php echo translate('ReturnLocation') ?></td><td><?php echo buildSelect( "newMonitor[ReturnLocation]", $return_options ); ?></td></tr> <tr><td><?php echo translate('ReturnLocation') ?></td><td><?php echo buildSelect( "newMonitor[ReturnLocation]", $return_options ); ?></td></tr>
<tr><td><?php echo translate('ReturnDelay') ?></td><td><input type="text" name="newMonitor[ReturnDelay]" value="<?php echo validHtmlStr($newMonitor['ReturnDelay']) ?>" size="4"/></td></tr> <tr><td><?php echo translate('ReturnDelay') ?></td><td><input type="text" name="newMonitor[ReturnDelay]" value="<?php echo validHtmlStr($newMonitor['ReturnDelay']) ?>" size="4"/></td></tr>
<?php <?php
break; break;
} }
case 'x10' : case 'x10' :
{ {
?> ?>
<tr><td><?php echo translate('X10ActivationString') ?></td><td><input type="text" name="newX10Monitor[Activation]" value="<?php echo validHtmlStr($newX10Monitor['Activation']) ?>" size="20"/></td></tr> <tr><td><?php echo translate('X10ActivationString') ?></td><td><input type="text" name="newX10Monitor[Activation]" value="<?php echo validHtmlStr($newX10Monitor['Activation']) ?>" size="20"/></td></tr>
<tr><td><?php echo translate('X10InputAlarmString') ?></td><td><input type="text" name="newX10Monitor[AlarmInput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmInput']) ?>" size="20"/></td></tr> <tr><td><?php echo translate('X10InputAlarmString') ?></td><td><input type="text" name="newX10Monitor[AlarmInput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmInput']) ?>" size="20"/></td></tr>
<tr><td><?php echo translate('X10OutputAlarmString') ?></td><td><input type="text" name="newX10Monitor[AlarmOutput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmOutput']) ?>" size="20"/></td></tr> <tr><td><?php echo translate('X10OutputAlarmString') ?></td><td><input type="text" name="newX10Monitor[AlarmOutput]" value="<?php echo validHtmlStr($newX10Monitor['AlarmOutput']) ?>" size="20"/></td></tr>
<?php <?php
break; break;
} }
case 'misc' : case 'misc' :
{ {
?> ?>
<tr><td><?php echo translate('EventPrefix') ?></td><td><input type="text" name="newMonitor[EventPrefix]" value="<?php echo validHtmlStr($newMonitor['EventPrefix']) ?>" size="24"/></td></tr> <tr><td><?php echo translate('EventPrefix') ?></td><td><input type="text" name="newMonitor[EventPrefix]" value="<?php echo validHtmlStr($newMonitor['EventPrefix']) ?>" size="24"/></td></tr>
@ -926,35 +922,36 @@ switch ( $tab ) {
<tr><td><?php echo translate('FPSReportInterval') ?></td><td><input type="text" name="newMonitor[FPSReportInterval]" value="<?php echo validHtmlStr($newMonitor['FPSReportInterval']) ?>" size="6"/></td></tr> <tr><td><?php echo translate('FPSReportInterval') ?></td><td><input type="text" name="newMonitor[FPSReportInterval]" value="<?php echo validHtmlStr($newMonitor['FPSReportInterval']) ?>" size="6"/></td></tr>
<tr><td><?php echo translate('DefaultView') ?></td><td><select name="newMonitor[DefaultView]"> <tr><td><?php echo translate('DefaultView') ?></td><td><select name="newMonitor[DefaultView]">
<?php <?php
foreach ( getEnumValues( 'Monitors', 'DefaultView' ) as $opt_view ) { foreach ( getEnumValues( 'Monitors', 'DefaultView' ) as $opt_view ) {
if ( $opt_view == 'Control' && ( !ZM_OPT_CONTROL || !$monitor['Controllable'] ) ) if ( $opt_view == 'Control' && ( !ZM_OPT_CONTROL || !$monitor['Controllable'] ) )
continue; continue;
?> ?>
<option value="<?php echo $opt_view ?>"<?php if ( $opt_view == $newMonitor['DefaultView'] ) { ?> selected="selected"<?php } ?>><?php echo $opt_view ?></option> <option value="<?php echo $opt_view ?>"<?php if ( $opt_view == $newMonitor['DefaultView'] ) { ?> selected="selected"<?php } ?>><?php echo $opt_view ?></option>
<?php <?php
} } // end foreach
?> ?>
</select></td></tr> </select></td></tr>
<tr><td><?php echo translate('DefaultRate') ?></td><td><?php echo buildSelect( "newMonitor[DefaultRate]", $rates ); ?></td></tr> <tr><td><?php echo translate('DefaultRate') ?></td><td><?php echo buildSelect( "newMonitor[DefaultRate]", $rates ); ?></td></tr>
<tr><td><?php echo translate('DefaultScale') ?></td><td><?php echo buildSelect( "newMonitor[DefaultScale]", $scales ); ?></td></tr> <tr><td><?php echo translate('DefaultScale') ?></td><td><?php echo buildSelect( "newMonitor[DefaultScale]", $scales ); ?></td></tr>
<?php <?php
if ( ZM_HAS_V4L && $newMonitor['Type'] == 'Local' ) { if ( ZM_HAS_V4L && $newMonitor['Type'] == 'Local' ) {
?> ?>
<tr><td><?php echo translate('SignalCheckColour') ?></td><td><input type="text" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($newMonitor['SignalCheckColour']) ?>" size="10" onchange="$('SignalCheckSwatch').setStyle( 'backgroundColor', this.value )"/><span id="SignalCheckSwatch" class="swatch" style="background-color: <?php echo $newMonitor['SignalCheckColour'] ?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr> <tr><td><?php echo translate('SignalCheckColour') ?></td><td><input type="text" name="newMonitor[SignalCheckColour]" value="<?php echo validHtmlStr($newMonitor['SignalCheckColour']) ?>" size="10" onchange="$('SignalCheckSwatch').setStyle( 'backgroundColor', this.value )"/><span id="SignalCheckSwatch" class="swatch" style="background-color: <?php echo $newMonitor['SignalCheckColour'] ?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
<?php <?php
} }
?> ?>
<tr><td><?php echo translate('WebColour') ?></td><td><input type="text" name="newMonitor[WebColour]" value="<?php echo validHtmlStr($newMonitor['WebColour']) ?>" size="10" onchange="$('WebSwatch').setStyle( 'backgroundColor', this.value )"/><span id="WebSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($newMonitor['WebColour']) ?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr> <tr><td><?php echo translate('WebColour') ?></td><td><input type="text" name="newMonitor[WebColour]" value="<?php echo validHtmlStr($newMonitor['WebColour']) ?>" size="10" onchange="$('WebSwatch').setStyle( 'backgroundColor', this.value )"/><span id="WebSwatch" class="swatch" style="background-color: <?php echo validHtmlStr($newMonitor['WebColour']) ?>;">&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
<tr><td><?php echo translate('Exif') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_EXIF', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td><td><input type="checkbox" name="newMonitor[Exif]" value="1"<?php if ( !empty($newMonitor['Exif']) ) { ?> checked="checked"<?php } ?>/></td></tr> <tr><td><?php echo translate('Exif') ?>&nbsp;(<?php echo makePopupLink( '?view=optionhelp&amp;option=OPTIONS_EXIF', 'zmOptionHelp', 'optionhelp', '?' ) ?>) </td><td><input type="checkbox" name="newMonitor[Exif]" value="1"<?php if ( !empty($newMonitor['Exif']) ) { ?> checked="checked"<?php } ?>/></td></tr>
<?php <?php
break; break;
} }
} // end switch tab } // end switch tab
?> ?>
</tbody> </tbody>
</table> </table>
<div id="contentButtons"> <div id="contentButtons">
<input type="submit" value="<?php echo translate('Save') ?>"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/><input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow()"/> <input type="submit" value="<?php echo translate('Save') ?>"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/>
<input type="button" value="<?php echo translate('Cancel') ?>" onclick="closeWindow()"/>
</div> </div>
</form> </form>