From ac1ae911bf34da3afbf4e092f7b1528bf3a91ac9 Mon Sep 17 00:00:00 2001 From: plegall Date: Fri, 17 Dec 2010 00:09:34 +0000 Subject: [PATCH] bug 2031 fixed: redirection after category deletion preserves the current node in the category tree. + the confirmation message is displayed after redirect, thanks to session git-svn-id: http://piwigo.org/svn/branches/2.1@8167 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin.php | 6 ++++++ admin/cat_list.php | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/admin.php b/admin.php index 25eca3f6e..3b508fe4d 100644 --- a/admin.php +++ b/admin.php @@ -90,6 +90,12 @@ else $page['errors'] = array(); $page['infos'] = array(); +if (isset($_SESSION['page_infos'])) +{ + $page['infos'] = array_merge($page['infos'], $_SESSION['page_infos']); + unset($_SESSION['page_infos']); +} + $link_start = PHPWG_ROOT_PATH.'admin.php?page='; $conf_link = $link_start.'configuration&section='; //----------------------------------------------------- template initialization diff --git a/admin/cat_list.php b/admin/cat_list.php index 662edbc88..848df3eb3 100644 --- a/admin/cat_list.php +++ b/admin/cat_list.php @@ -87,9 +87,15 @@ $navigation.= ''; if (isset($_GET['delete']) and is_numeric($_GET['delete']) and !is_adviser()) { delete_categories(array($_GET['delete'])); - array_push($page['infos'], l10n('Virtual category deleted')); + $_SESSION['page_infos'] = array(l10n('Virtual category deleted')); update_global_rank(); - redirect(get_root_url().'admin.php?page=cat_list'); + + $redirect_url = get_root_url().'admin.php?page=cat_list'; + if (isset($_GET['parent_id'])) + { + $redirect_url.= '&parent_id='.$_GET['parent_id']; + } + redirect($redirect_url); } // request to add a virtual category else if (isset($_POST['submitAdd']))