header_redirect(url_add_param($admin_url, 'ctrl=chapters&action=edit&blog=' . $cat_coll_ID . '&cat_ID=' . $cat_ID, '&')); // will save $Messages /* EXIT */ // In case we changed the redirect someday: unset($edited_Chapter); $cat_ID = NULL; $action = 'list'; break; case 'delete': // Delete entry: param($ChapterCache->dbIDname, 'integer', true); if (param('confirm', 'integer', 0)) { // confirmed, Delete from DB: $parent_ID = $edited_Chapter->parent_ID; $msg = sprintf(T_('Chapter «%s» deleted.'), $edited_Chapter->dget('name')); $ChapterCache->dbdelete_by_ID($edited_Chapter->ID); unset($edited_Chapter); forget_param($ChapterCache->dbIDname); $Messages->add($msg, 'success'); // Redirect so that a reload doesn't write to the DB twice: $redirect_to = get_chapter_redirect_url(param('redirect_page', 'string', ''), $parent_ID); header_redirect($redirect_to, 303); // Will EXIT // We have EXITed already at this point!! } else { // not confirmed, Check for restrictions: // TODO: dh> allow to delete a category which has links (and unbreak those after confirmation). // Get the page number we come from: $previous_page = param('results_' . $ChapterCache->dbprefix . 'page', 'integer', 1, true); if (!$edited_Chapter->check_delete(sprintf(T_('Cannot delete element «%s»'), $edited_Chapter->dget('name')))) { // There are restrictions:
header_redirect(url_add_param($admin_url, 'ctrl=chapters&action=edit&blog=' . $cat_coll_ID . '&cat_ID=' . $cat_ID, '&')); // will save $Messages /* EXIT */ // In case we changed the redirect someday: unset($edited_GenericCategory); $cat_ID = NULL; $action = 'list'; break; case 'delete': // Delete entry: param($GenericCategoryCache->dbIDname, 'integer', true); if (param('confirm', 'integer', 0)) { // confirmed, Delete from DB: $parent_ID = $edited_GenericCategory->parent_ID; $msg = sprintf(T_('Chapter «%s» deleted.'), $edited_GenericCategory->dget('name')); $GenericCategoryCache->dbdelete_by_ID($edited_GenericCategory->ID); unset($edited_GenericCategory); forget_param($GenericCategoryCache->dbIDname); $Messages->add($msg, 'success'); // Redirect so that a reload doesn't write to the DB twice: $redirect_to = get_chapter_redirect_url(param('redirect_page', 'string', ''), $parent_ID); header_redirect($redirect_to, 303); // Will EXIT // We have EXITed already at this point!! } else { // not confirmed, Check for restrictions: // TODO: dh> allow to delete a category which has links (and unbreak those after confirmation). // Get the page number we come from: $previous_page = param('results_' . $GenericCategoryCache->dbprefix . 'page', 'integer', 1, true); if (!$edited_GenericCategory->check_delete(sprintf(T_('Cannot delete element «%s»'), $edited_GenericCategory->dget('name')))) { // There are restrictions: