Now correctly handles checkboxes in the control view.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1367 e3e1d417-86f3-4887-817a-d78f3d33393f
pull/27/merge
stan 2005-03-13 20:41:31 +00:00
parent 5b7f1a2085
commit e5a90f82f1
1 changed files with 14 additions and 3 deletions

View File

@ -202,15 +202,18 @@ if ( isset($action) )
// Define a field type for anything that's not simple text equivalent
$types = array(
'Triggers' => 'set'
'Triggers' => 'set',
'Controllable' => 'toggle',
);
$changes = getFormChanges( $monitor, $new_monitor, $types );
$columns = getTableColumns( 'Monitors' );
$changes = getFormChanges( $monitor, $new_monitor, $types, $columns );
if ( count( $changes ) )
{
if ( $mid > 0 )
{
echo( "update Monitors set ".implode( ", ", $changes )." where Id = '$mid'" );
simpleQuery( "update Monitors set ".implode( ", ", $changes )." where Id = '$mid'" );
if ( $changes['Name'] )
{
@ -1076,7 +1079,15 @@ if ( isset($action) )
// Empty
);
$changes = getFormChanges( $control, $new_control, $types );
$columns = getTableColumns( 'Controls' );
foreach ( $columns as $name=>$type )
{
if ( preg_match( '/^(Can|Has)/', $name ) )
{
$types[$name] = 'toggle';
}
}
$changes = getFormChanges( $control, $new_control, $types, $columns );
if ( count( $changes ) )
{