From ede889104b4720655d590c928754c829c3cdd3f1 Mon Sep 17 00:00:00 2001 From: MatthieuLP Date: Mon, 27 Mar 2023 10:44:59 +0200 Subject: [PATCH] fixed #1887 Added code section for album deletion in php file. --- admin/albums.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/admin/albums.php b/admin/albums.php index d1654170e..30b0336cf 100644 --- a/admin/albums.php +++ b/admin/albums.php @@ -32,6 +32,34 @@ check_status(ACCESS_ADMINISTRATOR); $page['tab'] = 'list'; include(PHPWG_ROOT_PATH.'admin/include/albums_tab.inc.php'); +// +-----------------------------------------------------------------------+ +// | virtual categories management | +// +-----------------------------------------------------------------------+ + +// This code section is meant to be deleted after we implement the new album editor + +// request to delete a virtual category +if (isset($_GET['delete']) and is_numeric($_GET['delete'])) +{ + $photo_deletion_mode = 'no_delete'; + if (isset($_GET['photo_deletion_mode'])) + { + $photo_deletion_mode = $_GET['photo_deletion_mode']; + } + delete_categories(array($_GET['delete']), $photo_deletion_mode); + + $_SESSION['page_infos'] = array(l10n('Virtual album deleted')); + update_global_rank(); + invalidate_user_cache(); + + $redirect_url = get_root_url().'admin.php?page=albums'; + if (isset($_GET['parent_id'])) + { + $redirect_url.= '&parent_id='.$_GET['parent_id']; + } + redirect($redirect_url); +} + // +-----------------------------------------------------------------------+ // | categories auto order | // +-----------------------------------------------------------------------+