Fixed to work properly with MPEG cameras and presets
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2537 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
76345804e1
commit
bfd67f69fd
|
@ -46,3 +46,12 @@ function loadLocations( element )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initPage()
|
||||||
|
{
|
||||||
|
console.log( "T:"+$('contentForm').elements['newMonitor[Protocol]'].getTag() );
|
||||||
|
if ( $('contentForm').elements['newMonitor[Protocol]'].getTag() == 'select' )
|
||||||
|
updateMethods( $('contentForm').elements['newMonitor[Protocol]'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
window.addEvent( 'domready', initPage );
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<script type="text/javascript">
|
|
||||||
var optControl = <?= ZM_OPT_CONTROL ?>;
|
var optControl = <?= ZM_OPT_CONTROL ?>;
|
||||||
var defaultAspectRatio = '<?= ZM_DEFAULT_ASPECT_RATIO ?>';
|
var defaultAspectRatio = '<?= ZM_DEFAULT_ASPECT_RATIO ?>';
|
||||||
|
|
||||||
|
@ -36,9 +35,6 @@ controlOptions[<?= $row['Id'] ?>][<?= $i ?>] = '<?= $SLANG['Preset'].' '.$i ?>';
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
console.log( controlOptions );
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -69,8 +65,8 @@ function validateForm( form )
|
||||||
errors[errors.length] = "<?= $SLANG['BadHost'] ?>";
|
errors[errors.length] = "<?= $SLANG['BadHost'] ?>";
|
||||||
if ( form.elements['newMonitor[Port]'].value && !form.elements['newMonitor[Port]'].value.match( /^\d+$/ ) )
|
if ( form.elements['newMonitor[Port]'].value && !form.elements['newMonitor[Port]'].value.match( /^\d+$/ ) )
|
||||||
errors[errors.length] = "<?= $SLANG['BadPort'] ?>";
|
errors[errors.length] = "<?= $SLANG['BadPort'] ?>";
|
||||||
if ( !form.elements['newMonitor[Path]'].value )
|
//if ( !form.elements['newMonitor[Path]'].value )
|
||||||
errors[errors.length] = "<?= $SLANG['BadPath'] ?>";
|
//errors[errors.length] = "<?= $SLANG['BadPath'] ?>";
|
||||||
}
|
}
|
||||||
else if ( form.elements['newMonitor[Type]'].value == 'File' )
|
else if ( form.elements['newMonitor[Type]'].value == 'File' )
|
||||||
{
|
{
|
||||||
|
@ -115,3 +111,40 @@ function validateForm( form )
|
||||||
}
|
}
|
||||||
return( true );
|
return( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateMethods( element )
|
||||||
|
{
|
||||||
|
var form = element.form;
|
||||||
|
|
||||||
|
form.elements['newMonitor[Method]'].length = 0;
|
||||||
|
switch ( form.elements['newMonitor[Protocol]'].value )
|
||||||
|
{
|
||||||
|
case 'http' :
|
||||||
|
{
|
||||||
|
<?php
|
||||||
|
foreach( $httpMethods as $label=>$value )
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
form.elements['newMonitor[Method]'].options[form.elements['newMonitor[Method]'].length] = new Option( "<?= $value ?>", "<?= htmlspecialchars($label) ?>" );
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
form.elements['newMonitor[SubPath]'].parentNode.parentNode.style['display'] = 'none';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 'rtsp' :
|
||||||
|
{
|
||||||
|
<?php
|
||||||
|
foreach( $rtspMethods as $label=>$value )
|
||||||
|
{
|
||||||
|
?>
|
||||||
|
form.elements['newMonitor[Method]'].options[form.elements['newMonitor[Method]'].length] = new Option( "<?= $value ?>", "<?= htmlspecialchars($label) ?>" );
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
form.elements['newMonitor[SubPath]'].parentNode.parentNode.style['display'] = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return( true );
|
||||||
|
}
|
||||||
|
|
|
@ -30,13 +30,9 @@ $tabs["source"] = $SLANG['Source'];
|
||||||
$tabs["timestamp"] = $SLANG['Timestamp'];
|
$tabs["timestamp"] = $SLANG['Timestamp'];
|
||||||
$tabs["buffers"] = $SLANG['Buffers'];
|
$tabs["buffers"] = $SLANG['Buffers'];
|
||||||
if ( ZM_OPT_CONTROL && canView( 'Control' ) )
|
if ( ZM_OPT_CONTROL && canView( 'Control' ) )
|
||||||
{
|
|
||||||
$tabs["control"] = $SLANG['Control'];
|
$tabs["control"] = $SLANG['Control'];
|
||||||
}
|
|
||||||
if ( ZM_OPT_X10 )
|
if ( ZM_OPT_X10 )
|
||||||
{
|
|
||||||
$tabs["x10"] = $SLANG['X10'];
|
$tabs["x10"] = $SLANG['X10'];
|
||||||
}
|
|
||||||
$tabs["misc"] = $SLANG['Misc'];
|
$tabs["misc"] = $SLANG['Misc'];
|
||||||
|
|
||||||
if ( !isset($_REQUEST['tab']) )
|
if ( !isset($_REQUEST['tab']) )
|
||||||
|
@ -46,68 +42,91 @@ if ( !empty($_REQUEST['mid']) )
|
||||||
{
|
{
|
||||||
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
|
$monitor = dbFetchMonitor( $_REQUEST['mid'] );
|
||||||
if ( ZM_OPT_X10 )
|
if ( ZM_OPT_X10 )
|
||||||
{
|
$x10Monitor = dbFetchOne( "select * from TriggersX10 where MonitorId = '".dbEscape($_REQUEST['mid'])."'" );
|
||||||
$x10Monitor = dbFetchOne( "select * from TriggersX10 where MonitorId = '".$_REQUEST['mid']."'" );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$monitor = array();
|
$monitor = array(
|
||||||
$monitor['Name'] = $SLANG['New'];
|
'Id' => 0,
|
||||||
$monitor['Function'] = "None";
|
'Name' => $SLANG['New'],
|
||||||
$monitor['Enabled'] = true;
|
'Function' => "None",
|
||||||
$monitor['Type'] = "Local";
|
'Enabled' => true,
|
||||||
$monitor['Device'] = "/dev/video";
|
'LinkedMonitors' => "",
|
||||||
$monitor['Channel'] = "0";
|
'Type' => "Local",
|
||||||
$monitor['Format'] = "0";
|
'Device' => "/dev/video",
|
||||||
$monitor['Host'] = "";
|
'Channel' => "0",
|
||||||
$monitor['Path'] = "";
|
'Format' => "0",
|
||||||
$monitor['Port'] = "80";
|
'Protocol' => "",
|
||||||
$monitor['Palette'] = "4";
|
'Method' => "",
|
||||||
$monitor['Width'] = "";
|
'Host' => "",
|
||||||
$monitor['Height'] = "";
|
'Path' => "",
|
||||||
$monitor['Orientation'] = "0";
|
'SubPath' => "",
|
||||||
$monitor['LabelFormat'] = '%N - %y/%m/%d %H:%M:%S';
|
'Port' => "80",
|
||||||
$monitor['LabelX'] = 0;
|
'Palette' => "4",
|
||||||
$monitor['LabelY'] = 0;
|
'Width' => "",
|
||||||
$monitor['ImageBufferCount'] = 40;
|
'Height' => "",
|
||||||
$monitor['WarmupCount'] = 25;
|
'Orientation' => "0",
|
||||||
$monitor['PreEventCount'] = 10;
|
'LabelFormat' => '%N - %y/%m/%d %H:%M:%S',
|
||||||
$monitor['PostEventCount'] = 10;
|
'LabelX' => 0,
|
||||||
$monitor['StreamReplayBuffer'] = 1000;
|
'LabelY' => 0,
|
||||||
$monitor['AlarmFrameCount'] = 1;
|
'ImageBufferCount' => 40,
|
||||||
$monitor['Controllable'] = 0;
|
'WarmupCount' => 25,
|
||||||
$monitor['ControlType'] = 0;
|
'PreEventCount' => 10,
|
||||||
$monitor['ControlDevice'] = "";
|
'PostEventCount' => 10,
|
||||||
$monitor['ControlAddress'] = "";
|
'StreamReplayBuffer' => 1000,
|
||||||
$monitor['AutoStopTimeout'] = "";
|
'AlarmFrameCount' => 1,
|
||||||
$monitor['TrackMotion'] = 0;
|
'Controllable' => 0,
|
||||||
$monitor['TrackDelay'] = "";
|
'ControlId' => "",
|
||||||
$monitor['ReturnLocation'] = -1;
|
'ControlType' => 0,
|
||||||
$monitor['ReturnDelay'] = "";
|
'ControlDevice' => "",
|
||||||
$monitor['SectionLength'] = 600;
|
'ControlAddress' => "",
|
||||||
$monitor['FrameSkip'] = 0;
|
'AutoStopTimeout' => "",
|
||||||
$monitor['EventPrefix'] = 'Event-';
|
'TrackMotion' => 0,
|
||||||
$monitor['MaxFPS'] = "";
|
'TrackDelay' => "",
|
||||||
$monitor['AlarmMaxFPS'] = "";
|
'ReturnLocation' => -1,
|
||||||
$monitor['FPSReportInterval'] = 1000;
|
'ReturnDelay' => "",
|
||||||
$monitor['RefBlendPerc'] = 7;
|
'SectionLength' => 600,
|
||||||
$monitor['DefaultView'] = 'Events';
|
'FrameSkip' => 0,
|
||||||
$monitor['DefaultRate'] = '100';
|
'EventPrefix' => 'Event-',
|
||||||
$monitor['DefaultScale'] = '100';
|
'MaxFPS' => "",
|
||||||
$monitor['SignalCheckColour'] = '#0100BE';
|
'AlarmMaxFPS' => "",
|
||||||
$monitor['WebColour'] = 'red';
|
'FPSReportInterval' => 1000,
|
||||||
$monitor['Triggers'] = "";
|
'RefBlendPerc' => 7,
|
||||||
|
'DefaultView' => 'Events',
|
||||||
|
'DefaultRate' => '100',
|
||||||
|
'DefaultScale' => '100',
|
||||||
|
'SignalCheckColour' => '#0100BE',
|
||||||
|
'WebColour' => 'red',
|
||||||
|
'Triggers' => "",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if ( !isset( $newMonitor ) )
|
|
||||||
|
if ( ZM_OPT_X10 && empty($x10Monitor) )
|
||||||
|
{
|
||||||
|
$x10Monitor = array(
|
||||||
|
'Activation' => '',
|
||||||
|
'AlarmInput' => '',
|
||||||
|
'AlarmOutput' => '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isset( $_REQUEST['newMonitor'] ) )
|
||||||
|
{
|
||||||
|
$newMonitor = $_REQUEST['newMonitor'];
|
||||||
|
if ( ZM_OPT_X10 )
|
||||||
|
$newX10Monitor = $_REQUEST['newX10Monitor'];
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$newMonitor = $monitor;
|
$newMonitor = $monitor;
|
||||||
$newMonitor['Triggers'] = split( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
|
$newMonitor['Triggers'] = split( ',', isset($monitor['Triggers'])?$monitor['Triggers']:"" );
|
||||||
$newX10Monitor = isset($x10Monitor)?$x10Monitor:array();
|
if ( ZM_OPT_X10 )
|
||||||
|
$newX10Monitor = $x10Monitor;
|
||||||
}
|
}
|
||||||
if ( !empty($preset) )
|
|
||||||
|
if ( !empty($_REQUEST['preset']) )
|
||||||
{
|
{
|
||||||
$preset = dbFetchOne( "select Type, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale from MonitorPresets where Id = '$preset'" );
|
$preset = dbFetchOne( "select Type, Device, Channel, Format, Protocol, Method, Host, Port, Path, SubPath, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale from MonitorPresets where Id = '".dbEscape($_REQUEST['preset'])."'" );
|
||||||
foreach ( $preset as $name=>$value )
|
foreach ( $preset as $name=>$value )
|
||||||
{
|
{
|
||||||
if ( isset($value) )
|
if ( isset($value) )
|
||||||
|
@ -117,13 +136,70 @@ if ( !empty($preset) )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$device_formats = array( "PAL"=>0, "NTSC"=>1, "SECAM"=>2, "AUTO"=>3, "FMT4"=>4, "FMT5"=>5, "FMT6"=>6, "FMT7"=>7 );
|
$sourceTypes = array(
|
||||||
$device_channels = array();
|
'Local'=>$SLANG['Local'],
|
||||||
|
'Remote'=>$SLANG['Remote'],
|
||||||
|
'File'=>$SLANG['File']
|
||||||
|
);
|
||||||
|
|
||||||
|
$remoteProtocols = array(
|
||||||
|
"http"=>"HTTP",
|
||||||
|
"rtsp"=>"RTSP"
|
||||||
|
);
|
||||||
|
|
||||||
|
$rtspMethods = array(
|
||||||
|
"rtpUni"=>"RTP/Unicast",
|
||||||
|
"rtpMulti"=>"RTP/Multicast",
|
||||||
|
"rtpRtsp"=>"RTP/RTSP",
|
||||||
|
"rtpRtspHttp"=>"RTP/RTSP/HTTP"
|
||||||
|
);
|
||||||
|
|
||||||
|
$httpMethods = array(
|
||||||
|
"simple"=>"Simple",
|
||||||
|
"regexp"=>"Regexp",
|
||||||
|
"jpegTags"=>"JPEG Tags"
|
||||||
|
);
|
||||||
|
unset( $httpMethods['jpegTags'] );
|
||||||
|
|
||||||
|
$deviceFormats = array(
|
||||||
|
"PAL"=>0,
|
||||||
|
"NTSC"=>1,
|
||||||
|
"SECAM"=>2,
|
||||||
|
"AUTO"=>3,
|
||||||
|
"FMT4"=>4,
|
||||||
|
"FMT5"=>5,
|
||||||
|
"FMT6"=>6,
|
||||||
|
"FMT7"=>7
|
||||||
|
);
|
||||||
|
|
||||||
|
$deviceChannels = array();
|
||||||
for ( $i = 0; $i <= 15; $i++ )
|
for ( $i = 0; $i <= 15; $i++ )
|
||||||
$device_channels["$i"] = $i;
|
$deviceChannels["$i"] = $i;
|
||||||
$local_palettes = array( $SLANG['Grey']=>1, "RGB24"=>4, "RGB565"=>3, "RGB555"=>6, "YUV422"=>7, "YUYV"=>8, "YUV422P"=>13, "YUV420P"=>15 );
|
|
||||||
$remote_palettes = $file_palettes = array( $SLANG['8BitGrey']=>1, $SLANG['24BitColour']=>4 );
|
$localPalettes = array(
|
||||||
$orientations = array( $SLANG['Normal']=>'0', $SLANG['RotateRight']=>'90', $SLANG['Inverted']=>'180', $SLANG['RotateLeft']=>'270', $SLANG['FlippedHori']=>'hori', $SLANG['FlippedVert']=>'vert' );
|
$SLANG['Grey']=>1,
|
||||||
|
"RGB24"=>4,
|
||||||
|
"RGB565"=>3,
|
||||||
|
"RGB555"=>6,
|
||||||
|
"YUV422"=>7,
|
||||||
|
"YUYV"=>8,
|
||||||
|
"YUV422P"=>13,
|
||||||
|
"YUV420P"=>15
|
||||||
|
);
|
||||||
|
|
||||||
|
$remotePalettes = $filePalettes = array(
|
||||||
|
$SLANG['8BitGrey']=>1,
|
||||||
|
$SLANG['24BitColour']=>4
|
||||||
|
);
|
||||||
|
|
||||||
|
$orientations = array(
|
||||||
|
$SLANG['Normal']=>'0',
|
||||||
|
$SLANG['RotateRight']=>'90',
|
||||||
|
$SLANG['Inverted']=>'180',
|
||||||
|
$SLANG['RotateLeft']=>'270',
|
||||||
|
$SLANG['FlippedHori']=>'hori',
|
||||||
|
$SLANG['FlippedVert']=>'vert'
|
||||||
|
);
|
||||||
|
|
||||||
xhtmlHeaders(__FILE__, $SLANG['Monitor']." - ".$monitor['Name'] );
|
xhtmlHeaders(__FILE__, $SLANG['Monitor']." - ".$monitor['Name'] );
|
||||||
?>
|
?>
|
||||||
|
@ -135,7 +211,7 @@ if ( canEdit( 'Monitors' ) )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<div id="headerButtons">
|
<div id="headerButtons">
|
||||||
<a href="#" onclick="createPopup( '?view=monitorpreset&mid=<?= $_REQUEST['mid'] ?>', 'zmMonitorPreset<?= $_REQUEST['mid'] ?>', 'monitorpreset' ); return( false );"><?= $SLANG['Presets'] ?></a>
|
<a href="#" onclick="createPopup( '?view=monitorpreset&mid=<?= $monitor['Id'] ?>', 'zmMonitorPreset<?= $monitor['Id'] ?>', 'monitorpreset' ); return( false );"><?= $SLANG['Presets'] ?></a>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -166,7 +242,7 @@ foreach ( $tabs as $name=>$value )
|
||||||
<input type="hidden" name="view" value="<?= $_REQUEST['view'] ?>"/>
|
<input type="hidden" name="view" value="<?= $_REQUEST['view'] ?>"/>
|
||||||
<input type="hidden" name="tab" value="<?= $_REQUEST['tab'] ?>"/>
|
<input type="hidden" name="tab" value="<?= $_REQUEST['tab'] ?>"/>
|
||||||
<input type="hidden" name="action" value="monitor"/>
|
<input type="hidden" name="action" value="monitor"/>
|
||||||
<input type="hidden" name="mid" value="<?= $_REQUEST['mid'] ?>"/>
|
<input type="hidden" name="mid" value="<?= $monitor['Id'] ?>"/>
|
||||||
<?php
|
<?php
|
||||||
if ( $_REQUEST['tab'] != 'general' )
|
if ( $_REQUEST['tab'] != 'general' )
|
||||||
{
|
{
|
||||||
|
@ -175,7 +251,7 @@ if ( $_REQUEST['tab'] != 'general' )
|
||||||
<input Type="hidden" name="newMonitor[Type]" value="<?= $newMonitor['Type'] ?>"/>
|
<input Type="hidden" name="newMonitor[Type]" value="<?= $newMonitor['Type'] ?>"/>
|
||||||
<input type="hidden" name="newMonitor[Function]" value="<?= $newMonitor['Function'] ?>"/>
|
<input type="hidden" name="newMonitor[Function]" value="<?= $newMonitor['Function'] ?>"/>
|
||||||
<input type="hidden" name="newMonitor[Enabled]" value="<?= $newMonitor['Enabled'] ?>"/>
|
<input type="hidden" name="newMonitor[Enabled]" value="<?= $newMonitor['Enabled'] ?>"/>
|
||||||
<input type="hidden" name="newMonitor[LinkedMonitors]" value="<?= $newMonitor['LinkedMonitors'] ?>"/>
|
<input type="hidden" name="newMonitor[LinkedMonitors]" value="<?= isset($newMonitor['LinkedMonitors'])?$newMonitor['LinkedMonitors']:'' ?>"/>
|
||||||
<input type="hidden" name="newMonitor[RefBlendPerc]" value="<?= $newMonitor['RefBlendPerc'] ?>"/>
|
<input type="hidden" name="newMonitor[RefBlendPerc]" value="<?= $newMonitor['RefBlendPerc'] ?>"/>
|
||||||
<input type="hidden" name="newMonitor[MaxFPS]" value="<?= $newMonitor['MaxFPS'] ?>"/>
|
<input type="hidden" name="newMonitor[MaxFPS]" value="<?= $newMonitor['MaxFPS'] ?>"/>
|
||||||
<input type="hidden" name="newMonitor[AlarmMaxFPS]" value="<?= $newMonitor['AlarmMaxFPS'] ?>"/>
|
<input type="hidden" name="newMonitor[AlarmMaxFPS]" value="<?= $newMonitor['AlarmMaxFPS'] ?>"/>
|
||||||
|
@ -208,7 +284,10 @@ if ( $_REQUEST['tab'] != 'source' || $newMonitor['Type'] != 'Remote' )
|
||||||
if ( $_REQUEST['tab'] != 'source' || ($newMonitor['Type'] != 'Remote' && $newMonitor['Type'] != 'File') )
|
if ( $_REQUEST['tab'] != 'source' || ($newMonitor['Type'] != 'Remote' && $newMonitor['Type'] != 'File') )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
<input type="hidden" name="newMonitor[Protocol]" value="<?= $newMonitor['Protocol'] ?>"/>
|
||||||
|
<input type="hidden" name="newMonitor[Method]" value="<?= $newMonitor['Method'] ?>"/>
|
||||||
<input type="hidden" name="newMonitor[Path]" value="<?= $newMonitor['Path'] ?>"/>
|
<input type="hidden" name="newMonitor[Path]" value="<?= $newMonitor['Path'] ?>"/>
|
||||||
|
<input type="hidden" name="newMonitor[SubPath]" value="<?= $newMonitor['SubPath'] ?>"/>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
if ( $_REQUEST['tab'] != 'source' )
|
if ( $_REQUEST['tab'] != 'source' )
|
||||||
|
@ -290,33 +369,28 @@ switch ( $_REQUEST['tab'] )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr><td><?= $SLANG['Name'] ?></td><td><input type="text" name="newMonitor[Name]" value="<?= $newMonitor['Name'] ?>" size="16"/></td></tr>
|
<tr><td><?= $SLANG['Name'] ?></td><td><input type="text" name="newMonitor[Name]" value="<?= $newMonitor['Name'] ?>" size="16"/></td></tr>
|
||||||
<?php
|
<tr><td><?= $SLANG['SourceType'] ?></td><td><?= buildSelect( "newMonitor[Type]", $sourceTypes ); ?></td></tr>
|
||||||
$selectName = "newMonitor[Type]";
|
|
||||||
$sourceTypes = array(
|
|
||||||
'Local'=>$SLANG['Local'],
|
|
||||||
'Remote'=>$SLANG['Remote'],
|
|
||||||
'File'=>$SLANG['File']
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
<tr><td><?= $SLANG['SourceType'] ?></td><td><?= buildSelect( $selectName, $sourceTypes ); ?></td></tr>
|
|
||||||
<tr><td><?= $SLANG['Function'] ?></td><td><select name="newMonitor[Function]">
|
<tr><td><?= $SLANG['Function'] ?></td><td><select name="newMonitor[Function]">
|
||||||
<?php
|
<?php
|
||||||
foreach ( getEnumValues( 'Monitors', 'Function' ) as $opt_function )
|
foreach ( getEnumValues( 'Monitors', 'Function' ) as $optFunction )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<option value="<?= $opt_function ?>"<?php if ( $opt_function == $newMonitor['Function'] ) { ?> selected="selected"<?php } ?>><?= $opt_function ?></option>
|
<option value="<?= $optFunction ?>"<?php if ( $optFunction == $newMonitor['Function'] ) { ?> selected="selected"<?php } ?>><?= $optFunction ?></option>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</select></td></tr>
|
</select></td></tr>
|
||||||
<tr><td><?= $SLANG['Enabled'] ?></td><td><input type="checkbox" name="newMonitor[Enabled]" value="1"<?php if ( !empty($newMonitor['Enabled']) ) { ?> checked="checked"<?php } ?>></td></tr>
|
<tr><td><?= $SLANG['Enabled'] ?></td><td><input type="checkbox" name="newMonitor[Enabled]" value="1"<?php if ( !empty($newMonitor['Enabled']) ) { ?> checked="checked"<?php } ?>/></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $SLANG['LinkedMonitors'] ?></td>
|
<td><?= $SLANG['LinkedMonitors'] ?></td>
|
||||||
<td>
|
<td>
|
||||||
<select name="newMonitor[LinkedMonitors]" size="4" multiple="multiple">
|
<select name="newMonitor[LinkedMonitors]" size="4" multiple="multiple">
|
||||||
<?php
|
<?php
|
||||||
$monitors = dbFetchAll( "select Id,Name from Monitors order by Sequence asc" );
|
$monitors = dbFetchAll( "select Id,Name from Monitors order by Sequence asc" );
|
||||||
$monitorIds = array_flip( split( ',', $newMonitor['LinkedMonitors'] ) );
|
if ( !empty($newMonitor['LinkedMonitors']) )
|
||||||
|
$monitorIds = array_flip( split( ',', $newMonitor['LinkedMonitors'] ) );
|
||||||
|
else
|
||||||
|
$monitorIds = array();
|
||||||
foreach ( $monitors as $monitor )
|
foreach ( $monitors as $monitor )
|
||||||
{
|
{
|
||||||
if ( visibleMonitor( $monitor['Id'] ) )
|
if ( visibleMonitor( $monitor['Id'] ) )
|
||||||
|
@ -335,29 +409,29 @@ switch ( $_REQUEST['tab'] )
|
||||||
<tr><td><?= $SLANG['RefImageBlendPct'] ?></td><td><input type="text" name="newMonitor[RefBlendPerc]" value="<?= $newMonitor['RefBlendPerc'] ?>" size="4"/></td></tr>
|
<tr><td><?= $SLANG['RefImageBlendPct'] ?></td><td><input type="text" name="newMonitor[RefBlendPerc]" value="<?= $newMonitor['RefBlendPerc'] ?>" size="4"/></td></tr>
|
||||||
<tr><td><?= $SLANG['Triggers'] ?></td><td>
|
<tr><td><?= $SLANG['Triggers'] ?></td><td>
|
||||||
<?php
|
<?php
|
||||||
$opt_triggers = getSetValues( 'Monitors', 'Triggers' );
|
$optTriggers = getSetValues( 'Monitors', 'Triggers' );
|
||||||
$break_count = (int)(ceil(count($opt_triggers)));
|
$breakCount = (int)(ceil(count($optTriggers)));
|
||||||
$break_count = min( 3, $break_count );
|
$breakCount = min( 3, $breakCount );
|
||||||
$opt_count = 0;
|
$optCount = 0;
|
||||||
foreach( $opt_triggers as $opt_trigger )
|
foreach( $optTriggers as $optTrigger )
|
||||||
{
|
{
|
||||||
if ( !ZM_OPT_X10 && $opt_trigger == 'X10' )
|
if ( !ZM_OPT_X10 && $optTrigger == 'X10' )
|
||||||
continue;
|
continue;
|
||||||
if ( $opt_count && ($opt_count%$break_count == 0) )
|
if ( $optCount && ($optCount%$breakCount == 0) )
|
||||||
echo "</br>";
|
echo "</br>";
|
||||||
?>
|
?>
|
||||||
<input type="checkbox" name="newMonitor[Triggers][]" value="<?= $opt_trigger ?>"<?php if ( isset($newMonitor['Triggers']) && in_array( $opt_trigger, $newMonitor['Triggers'] ) ) { ?> checked="checked"<?php } ?>/><?= $opt_trigger ?>
|
<input type="checkbox" name="newMonitor[Triggers][]" value="<?= $optTrigger ?>"<?php if ( isset($newMonitor['Triggers']) && in_array( $optTrigger, $newMonitor['Triggers'] ) ) { ?> checked="checked"<?php } ?>/> <?= $optTrigger ?>
|
||||||
<?php
|
<?php
|
||||||
$opt_count ++;
|
$optCount ++;
|
||||||
}
|
}
|
||||||
if ( !$opt_count )
|
if ( !$optCount )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<em><?= $SLANG['NoneAvailable'] ?></em>
|
<em><?= $SLANG['NoneAvailable'] ?></em>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<?php
|
<?php
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -367,30 +441,33 @@ switch ( $_REQUEST['tab'] )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr><td><?= $SLANG['DevicePath'] ?></td><td><input type="text" name="newMonitor[Device]" value="<?= $newMonitor['Device'] ?>" size="24"/></td></tr>
|
<tr><td><?= $SLANG['DevicePath'] ?></td><td><input type="text" name="newMonitor[Device]" value="<?= $newMonitor['Device'] ?>" size="24"/></td></tr>
|
||||||
<tr><td><?= $SLANG['DeviceChannel'] ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $device_channels as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?= $SLANG['DeviceChannel'] ?></td><td><select name="newMonitor[Channel]"><?php foreach ( $deviceChannels as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Channel'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
||||||
<tr><td><?= $SLANG['DeviceFormat'] ?></td><td><select name="newMonitor[Format]"><?php foreach ( $device_formats as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?= $SLANG['DeviceFormat'] ?></td><td><select name="newMonitor[Format]"><?php foreach ( $deviceFormats as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Format'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
||||||
<tr><td><?= $SLANG['CapturePalette'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $local_palettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?= $SLANG['CapturePalette'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $localPalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
elseif ( $newMonitor['Type'] == "Remote" )
|
elseif ( $newMonitor['Type'] == "Remote" )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
|
<tr><td><?= $SLANG['RemoteProtocol'] ?></td><td><?= buildSelect( "newMonitor[Protocol]", $remoteProtocols, "updateMethods( this )" ); ?></td></tr>
|
||||||
|
<tr><td><?= $SLANG['RemoteMethod'] ?></td><td><?= buildSelect( "newMonitor[Method]", array() ); ?></td></tr>
|
||||||
<tr><td><?= $SLANG['RemoteHostName'] ?></td><td><input type="text" name="newMonitor[Host]" value="<?= $newMonitor['Host'] ?>" size="36"/></td></tr>
|
<tr><td><?= $SLANG['RemoteHostName'] ?></td><td><input type="text" name="newMonitor[Host]" value="<?= $newMonitor['Host'] ?>" size="36"/></td></tr>
|
||||||
<tr><td><?= $SLANG['RemoteHostPort'] ?></td><td><input type="text" name="newMonitor[Port]" value="<?= $newMonitor['Port'] ?>" size="6"/></td></tr>
|
<tr><td><?= $SLANG['RemoteHostPort'] ?></td><td><input type="text" name="newMonitor[Port]" value="<?= $newMonitor['Port'] ?>" size="6"/></td></tr>
|
||||||
<tr><td><?= $SLANG['RemoteHostPath'] ?></td><td><input type="text" name="newMonitor[Path]" value="<?= $newMonitor['Path'] ?>" size="36"/></td></tr>
|
<tr><td><?= $SLANG['RemoteHostPath'] ?></td><td><input type="text" name="newMonitor[Path]" value="<?= $newMonitor['Path'] ?>" size="36"/></td></tr>
|
||||||
<tr><td><?= $SLANG['RemoteImageColours'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $remote_palettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?= $SLANG['RemoteHostSubPath'] ?></td><td><input type="text" name="newMonitor[SubPath]" value="<?= $newMonitor['SubPath'] ?>" size="36"/></td></tr>
|
||||||
|
<tr><td><?= $SLANG['RemoteImageColours'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $remotePalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
elseif ( $newMonitor['Type'] == "File" )
|
elseif ( $newMonitor['Type'] == "File" )
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr><td><?= $SLANG['FilePath'] ?></td><td><input type="text" name="newMonitor[Path]" value="<?= $newMonitor['Path'] ?>" size="36"/></td></tr>
|
<tr><td><?= $SLANG['FilePath'] ?></td><td><input type="text" name="newMonitor[Path]" value="<?= $newMonitor['Path'] ?>" size="36"/></td></tr>
|
||||||
<tr><td><?= $SLANG['FileColours'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $file_palettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?= $SLANG['FileColours'] ?></td><td><select name="newMonitor[Palette]"><?php foreach ( $filePalettes as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Palette'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr><td><?= $SLANG['CaptureWidth'] ?> (<?= $SLANG['Pixels'] ?>)</td><td><input type="text" name="newMonitor[Width]" value="<?= $newMonitor['Width'] ?>" size="4" onkeyup="updateMonitorDimensions(this);"></td></tr>
|
<tr><td><?= $SLANG['CaptureWidth'] ?> (<?= $SLANG['Pixels'] ?>)</td><td><input type="text" name="newMonitor[Width]" value="<?= $newMonitor['Width'] ?>" size="4" onkeyup="updateMonitorDimensions(this);"/></td></tr>
|
||||||
<tr><td><?= $SLANG['CaptureHeight'] ?> (<?= $SLANG['Pixels'] ?>)</td><td><input type="text" name="newMonitor[Height]" value="<?= $newMonitor['Height'] ?>" size="4" onkeyup="updateMonitorDimensions(this);"></td></tr>
|
<tr><td><?= $SLANG['CaptureHeight'] ?> (<?= $SLANG['Pixels'] ?>)</td><td><input type="text" name="newMonitor[Height]" value="<?= $newMonitor['Height'] ?>" size="4" onkeyup="updateMonitorDimensions(this);"/></td></tr>
|
||||||
<tr><td><?= $SLANG['PreserveAspect'] ?></td><td><input type="checkbox" name="preserveAspectRatio" value="1"/></td></tr>
|
<tr><td><?= $SLANG['PreserveAspect'] ?></td><td><input type="checkbox" name="preserveAspectRatio" value="1"/></td></tr>
|
||||||
<tr><td><?= $SLANG['Orientation'] ?></td><td><select name="newMonitor[Orientation]"><?php foreach ( $orientations as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Orientation'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
<tr><td><?= $SLANG['Orientation'] ?></td><td><select name="newMonitor[Orientation]"><?php foreach ( $orientations as $name => $value ) { ?><option value="<?= $value ?>"<?php if ( $value == $newMonitor['Orientation'] ) { ?> selected="selected"<?php } ?>><?= $name ?></option><?php } ?></select></td></tr>
|
||||||
<?php
|
<?php
|
||||||
|
@ -420,12 +497,12 @@ switch ( $_REQUEST['tab'] )
|
||||||
case 'control' :
|
case 'control' :
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr><td><?= $SLANG['Controllable'] ?></td><td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( !empty($newMonitor['Controllable']) ) { ?> checked="checked"<?php } ?>></td></tr>
|
<tr><td><?= $SLANG['Controllable'] ?></td><td><input type="checkbox" name="newMonitor[Controllable]" value="1"<?php if ( !empty($newMonitor['Controllable']) ) { ?> checked="checked"<?php } ?>/></td></tr>
|
||||||
<tr><td><?= $SLANG['ControlType'] ?></td><td><?= buildSelect( "newMonitor[ControlId]", $controlTypes, 'loadLocations( this )' ); ?><?php if ( canEdit( 'Control' ) ) { ?> <a href="#" onlick="createPopup( '?view=controlcaps', 'zmControlCaps', 'controlcaps' );"><?= $SLANG['Edit'] ?></a><?php } ?></td></tr>
|
<tr><td><?= $SLANG['ControlType'] ?></td><td><?= buildSelect( "newMonitor[ControlId]", $controlTypes, 'loadLocations( this )' ); ?><?php if ( canEdit( 'Control' ) ) { ?> <a href="#" onlick="createPopup( '?view=controlcaps', 'zmControlCaps', 'controlcaps' );"><?= $SLANG['Edit'] ?></a><?php } ?></td></tr>
|
||||||
<tr><td><?= $SLANG['ControlDevice'] ?></td><td><input type="text" name="newMonitor[ControlDevice]" value="<?= $newMonitor['ControlDevice'] ?>" size="32"/></td></tr>
|
<tr><td><?= $SLANG['ControlDevice'] ?></td><td><input type="text" name="newMonitor[ControlDevice]" value="<?= $newMonitor['ControlDevice'] ?>" size="32"/></td></tr>
|
||||||
<tr><td><?= $SLANG['ControlAddress'] ?></td><td><input type="text" name="newMonitor[ControlAddress]" value="<?= $newMonitor['ControlAddress'] ?>" size="32"/></td></tr>
|
<tr><td><?= $SLANG['ControlAddress'] ?></td><td><input type="text" name="newMonitor[ControlAddress]" value="<?= $newMonitor['ControlAddress'] ?>" size="32"/></td></tr>
|
||||||
<tr><td><?= $SLANG['AutoStopTimeout'] ?></td><td><input type="text" name="newMonitor[AutoStopTimeout]" value="<?= $newMonitor['AutoStopTimeout'] ?>" size="4"/></td></tr>
|
<tr><td><?= $SLANG['AutoStopTimeout'] ?></td><td><input type="text" name="newMonitor[AutoStopTimeout]" value="<?= $newMonitor['AutoStopTimeout'] ?>" size="4"/></td></tr>
|
||||||
<tr><td><?= $SLANG['TrackMotion'] ?></td><td><input type="checkbox" name="newMonitor[TrackMotion]" value="1"<?php if ( !empty($newMonitor['TrackMotion']) ) { ?> checked="checked"<?php } ?>></td></tr>
|
<tr><td><?= $SLANG['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' => $SLANG['None'],
|
'-1' => $SLANG['None'],
|
||||||
|
@ -483,7 +560,6 @@ switch ( $_REQUEST['tab'] )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div id="contentButtons">
|
<div id="contentButtons">
|
||||||
|
|
Loading…
Reference in New Issue