Fixed issue with control edit screen losing changes.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2734 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2009-01-28 17:25:05 +00:00
parent c753214450
commit c2cf6e31bc
1 changed files with 108 additions and 104 deletions

View File

@ -40,118 +40,122 @@ if ( isset($_REQUEST['tab']) )
else
$tab = "main";
if ( !empty($_REQUEST['cid']) )
if ( isset( $_REQUEST['newControl'] ) )
{
$control = dbFetchOne( "select * from Controls where Id = '".dbEscape($_REQUEST['cid'])."'" );
$newControl = $_REQUEST['newControl'];
}
else
{
$control = array(
'Name' => $SLANG['New'],
'Type' => "Local",
'Protocol' => "",
'CanWake' => "",
'CanSleep' => "",
'CanReset' => "",
'CanMove' => "",
'CanMoveDiag' => "",
'CanMoveMap' => "",
'CanMoveAbs' => "",
'CanMoveRel' => "",
'CanMoveCon' => "",
'CanPan' => "",
'MinPanRange' => "",
'MaxPanRange' => "",
'MinPanStep' => "",
'MaxPanStep' => "",
'HasPanSpeed' => "",
'MinPanSpeed' => "",
'MaxPanSpeed' => "",
'HasTurboPan' => "",
'TurboPanSpeed' => "",
'CanTilt' => "",
'MinTiltRange' => "",
'MaxTiltRange' => "",
'MinTiltStep' => "",
'MaxTiltStep' => "",
'HasTiltSpeed' => "",
'MinTiltSpeed' => "",
'MaxTiltSpeed' => "",
'HasTurboTilt' => "",
'TurboTiltSpeed' => "",
'CanZoom' => "",
'CanZoomAbs' => "",
'CanZoomRel' => "",
'CanZoomCon' => "",
'MinZoomRange' => "",
'MaxZoomRange' => "",
'MinZoomStep' => "",
'MaxZoomStep' => "",
'HasZoomSpeed' => "",
'MinZoomSpeed' => "",
'MaxZoomSpeed' => "",
'CanFocus' => "",
'CanAutoFocus' => "",
'CanFocusAbs' => "",
'CanFocusRel' => "",
'CanFocusCon' => "",
'MinFocusRange' => "",
'MaxFocusRange' => "",
'MinFocusStep' => "",
'MaxFocusStep' => "",
'HasFocusSpeed' => "",
'MinFocusSpeed' => "",
'MaxFocusSpeed' => "",
'CanIris' => "",
'CanAutoIris' => "",
'CanIrisAbs' => "",
'CanIrisRel' => "",
'CanIrisCon' => "",
'MinIrisRange' => "",
'MaxIrisRange' => "",
'MinIrisStep' => "",
'MaxIrisStep' => "",
'HasIrisSpeed' => "",
'MinIrisSpeed' => "",
'MaxIrisSpeed' => "",
'CanGain' => "",
'CanAutoGain' => "",
'CanGainAbs' => "",
'CanGainRel' => "",
'CanGainCon' => "",
'MinGainRange' => "",
'MaxGainRange' => "",
'MinGainStep' => "",
'MaxGainStep' => "",
'HasGainSpeed' => "",
'MinGainSpeed' => "",
'MaxGainSpeed' => "",
'CanWhite' => "",
'CanAutoWhite' => "",
'CanWhiteAbs' => "",
'CanWhiteRel' => "",
'CanWhiteCon' => "",
'MinWhiteRange' => "",
'MaxWhiteRange' => "",
'MinWhiteStep' => "",
'MaxWhiteStep' => "",
'HasWhiteSpeed' => "",
'MinWhiteSpeed' => "",
'MaxWhiteSpeed' => "",
'HasPresets' => "",
'NumPresets' => "",
'HasHomePreset' => "",
'CanSetPresets' => "",
);
}
if ( !isset( $newControl ) )
{
if ( !empty($_REQUEST['cid']) )
{
$control = dbFetchOne( "select * from Controls where Id = '".dbEscape($_REQUEST['cid'])."'" );
}
else
{
$control = array(
'Name' => $SLANG['New'],
'Type' => "Local",
'Protocol' => "",
'CanWake' => "",
'CanSleep' => "",
'CanReset' => "",
'CanMove' => "",
'CanMoveDiag' => "",
'CanMoveMap' => "",
'CanMoveAbs' => "",
'CanMoveRel' => "",
'CanMoveCon' => "",
'CanPan' => "",
'MinPanRange' => "",
'MaxPanRange' => "",
'MinPanStep' => "",
'MaxPanStep' => "",
'HasPanSpeed' => "",
'MinPanSpeed' => "",
'MaxPanSpeed' => "",
'HasTurboPan' => "",
'TurboPanSpeed' => "",
'CanTilt' => "",
'MinTiltRange' => "",
'MaxTiltRange' => "",
'MinTiltStep' => "",
'MaxTiltStep' => "",
'HasTiltSpeed' => "",
'MinTiltSpeed' => "",
'MaxTiltSpeed' => "",
'HasTurboTilt' => "",
'TurboTiltSpeed' => "",
'CanZoom' => "",
'CanZoomAbs' => "",
'CanZoomRel' => "",
'CanZoomCon' => "",
'MinZoomRange' => "",
'MaxZoomRange' => "",
'MinZoomStep' => "",
'MaxZoomStep' => "",
'HasZoomSpeed' => "",
'MinZoomSpeed' => "",
'MaxZoomSpeed' => "",
'CanFocus' => "",
'CanAutoFocus' => "",
'CanFocusAbs' => "",
'CanFocusRel' => "",
'CanFocusCon' => "",
'MinFocusRange' => "",
'MaxFocusRange' => "",
'MinFocusStep' => "",
'MaxFocusStep' => "",
'HasFocusSpeed' => "",
'MinFocusSpeed' => "",
'MaxFocusSpeed' => "",
'CanIris' => "",
'CanAutoIris' => "",
'CanIrisAbs' => "",
'CanIrisRel' => "",
'CanIrisCon' => "",
'MinIrisRange' => "",
'MaxIrisRange' => "",
'MinIrisStep' => "",
'MaxIrisStep' => "",
'HasIrisSpeed' => "",
'MinIrisSpeed' => "",
'MaxIrisSpeed' => "",
'CanGain' => "",
'CanAutoGain' => "",
'CanGainAbs' => "",
'CanGainRel' => "",
'CanGainCon' => "",
'MinGainRange' => "",
'MaxGainRange' => "",
'MinGainStep' => "",
'MaxGainStep' => "",
'HasGainSpeed' => "",
'MinGainSpeed' => "",
'MaxGainSpeed' => "",
'CanWhite' => "",
'CanAutoWhite' => "",
'CanWhiteAbs' => "",
'CanWhiteRel' => "",
'CanWhiteCon' => "",
'MinWhiteRange' => "",
'MaxWhiteRange' => "",
'MinWhiteStep' => "",
'MaxWhiteStep' => "",
'HasWhiteSpeed' => "",
'MinWhiteSpeed' => "",
'MaxWhiteSpeed' => "",
'HasPresets' => "",
'NumPresets' => "",
'HasHomePreset' => "",
'CanSetPresets' => "",
);
}
$newControl = $control;
}
$focusWindow = true;
xhtmlHeaders(__FILE__, $SLANG['ControlCap']." - ".$control['Name'] );
xhtmlHeaders(__FILE__, $SLANG['ControlCap']." - ".$newControl['Name'] );
?>
<body>
<div id="page">
@ -172,7 +176,7 @@ foreach ( $tabs as $name=>$value )
else
{
?>
<li><a href="?view=<?= $view ?>&cid=<?= requestVar( 'cid' ) ?>&tab=<?= $name ?>"><?= $value ?></a></li>
<li><a href="#" onclick="submitTab( '<?= $name ?>' ); return( false );"><?= $value ?></a></li>
<?php
}
}