Skip to content

Commit

Permalink
feature 2761: Pass all kind of messages through session on admin
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@18463 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Oct 4, 2012
1 parent b1cec7b commit b3e71e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
31 changes: 2 additions & 29 deletions admin.php
Expand Up @@ -156,16 +156,6 @@
$page['page'] = 'intro';
}

$page['errors'] = array();
$page['infos'] = array();
$page['warnings'] = 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=';

Expand Down Expand Up @@ -290,27 +280,8 @@ function UC_name_compare($a, $b)
trigger_action('loc_begin_admin_page');
include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');

// +-----------------------------------------------------------------------+
// | Errors, Infos & Warnings |
// +-----------------------------------------------------------------------+

$template->assign('ACTIVE_MENU', get_active_menu($page['page']));

if (count($page['errors']) != 0)
{
$template->assign('errors', $page['errors']);
}

if (count($page['infos']) != 0)
{
$template->assign('infos', $page['infos']);
}

if (count($page['warnings']) != 0)
{
$template->assign('warnings', $page['warnings']);
}

// +-----------------------------------------------------------------------+
// | Sending html code |
// +-----------------------------------------------------------------------+
Expand All @@ -322,6 +293,8 @@ function UC_name_compare($a, $b)

trigger_action('loc_end_admin');

include(PHPWG_ROOT_PATH.'include/page_messages.php');

$template->pparse('admin');

include(PHPWG_ROOT_PATH.'include/page_tail.php');
Expand Down
1 change: 1 addition & 0 deletions include/common.inc.php
Expand Up @@ -64,6 +64,7 @@ function sanitize_mysql_kv(&$v, $k)
$page = array(
'infos' => array(),
'errors' => array(),
'warnings' => array(),
);
$user = array();
$lang = array();
Expand Down
2 changes: 1 addition & 1 deletion include/page_messages.php
Expand Up @@ -24,7 +24,7 @@
// messages only if no redirection
if ($template->get_template_vars('page_refresh') === null)
{
foreach (array('errors','infos') as $mode)
foreach (array('errors','infos','warnings') as $mode)
{
if (isset($_SESSION['page_'.$mode]))
{
Expand Down

0 comments on commit b3e71e4

Please sign in to comment.