Skip to content

Commit

Permalink
merge r8167 from branch 2.1 to trunk
Browse files Browse the repository at this point in the history
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/trunk@8168 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
plegall committed Dec 17, 2010
1 parent d5549a0 commit cfd6851
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions admin.php
Expand Up @@ -90,6 +90,12 @@
$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
Expand Down
10 changes: 8 additions & 2 deletions admin/cat_list.php
Expand Up @@ -106,9 +106,15 @@ function save_categories_order($categories)
if (isset($_GET['delete']) and is_numeric($_GET['delete']))
{
delete_categories(array($_GET['delete']));
array_push($page['infos'], l10n('Virtual album deleted'));
$_SESSION['page_infos'] = array(l10n('Virtual album 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']))
Expand Down

0 comments on commit cfd6851

Please sign in to comment.