mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-29 03:01:43 -04:00
Added "action" for the "delete" button (montage.php)
This commit is contained in:
@@ -21,9 +21,9 @@ require_once('includes/MontageLayout.php');
|
||||
|
||||
if ( isset($_REQUEST['object']) ) {
|
||||
if ( $_REQUEST['object'] == 'MontageLayout' ) {
|
||||
if ($action == 'Save') {
|
||||
$Layout = null;
|
||||
$Layout = null;
|
||||
|
||||
if ($action == 'Save') {
|
||||
# Name is only populated when creating a new layout
|
||||
if ( $_REQUEST['Name'] != '' ) {
|
||||
$Layout = new ZM\MontageLayout();
|
||||
@@ -44,7 +44,35 @@ if ( isset($_REQUEST['object']) ) {
|
||||
ZM\Warning('Need System permissions to edit layouts');
|
||||
return;
|
||||
}
|
||||
} // end if save
|
||||
} else if ($action == 'Delete') { // end if save
|
||||
if ( isset($_REQUEST['zmMontageLayout']) ) {
|
||||
$Layout = new ZM\MontageLayout($_REQUEST['zmMontageLayout']);
|
||||
} else {
|
||||
ZM\Warning('Name of layout to be deleted is not specified');
|
||||
return;
|
||||
}
|
||||
|
||||
if (canEdit('System')) {
|
||||
if ($Layout->Id()) {
|
||||
$Layout->delete();
|
||||
zm_session_start();
|
||||
unset($_SESSION["zmMontageLayout"]);
|
||||
$_SESSION['zmMontageLayout'] = '';
|
||||
session_write_close();
|
||||
unset($_COOKIE['zmMontageLayout']);
|
||||
zm_setcookie('zmMontageLayout', '', array('expires'=>time()-3600*24)); //!!! After this JS still sees cookies, strange !!!
|
||||
$redirect = '?view=montage';
|
||||
} else {
|
||||
ZM\Warning('Layout Id=' . $_REQUEST['zmMontageLayout'] . ' not found for delete');
|
||||
$redirect = '?view=montage';
|
||||
}
|
||||
} else {
|
||||
ZM\Warning('Need System permissions to delete layouts');
|
||||
$redirect = '?view=montage';
|
||||
}
|
||||
} else {// end if delete
|
||||
ZM\Warning("Unsupported action $action in montage");
|
||||
} // end if else
|
||||
} # end if isset($_REQUEST['object'] )
|
||||
} # end if isset($_REQUEST['object'] )
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user