aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_list.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-06-11 14:10:04 +0000
committerplegall <plg@piwigo.org>2005-06-11 14:10:04 +0000
commite851f504acebc9422b79f58da25420666da6e296 (patch)
treef90d0104a9799caa29bcd47d0bd2c6edabcefe79 /admin/cat_list.php
parent4fedaac43ac404dc50193d6032307697412bb2c9 (diff)
- errors and informations boxes : management centralized in admin.php,
$errors and $infos arrays replaced by $page['errors'] and $page['infos'], special management for admin/update.php (more complex management) git-svn-id: http://piwigo.org/svn/trunk@792 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/cat_list.php29
1 files changed, 4 insertions, 25 deletions
diff --git a/admin/cat_list.php b/admin/cat_list.php
index 1706eaff8..a4fa4b5ce 100644
--- a/admin/cat_list.php
+++ b/admin/cat_list.php
@@ -33,8 +33,6 @@ include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php');
// +-----------------------------------------------------------------------+
// | initialization |
// +-----------------------------------------------------------------------+
-$errors = array();
-$infos = array();
$categories = array();
$navigation = $lang['home'];
// +-----------------------------------------------------------------------+
@@ -44,7 +42,7 @@ $navigation = $lang['home'];
if (isset($_GET['delete']) and is_numeric($_GET['delete']))
{
delete_categories(array($_GET['delete']));
- array_push($infos, $lang['cat_virtual_deleted']);
+ array_push($page['infos'], $lang['cat_virtual_deleted']);
ordering();
update_global_rank();
}
@@ -54,10 +52,10 @@ else if (isset($_POST['submit']))
// is the given category name only containing blank spaces ?
if (preg_match('/^\s*$/', $_POST['virtual_name']))
{
- array_push($errors, $lang['cat_error_name']);
+ array_push($page['errors'], $lang['cat_error_name']);
}
- if (!count($errors))
+ if (!count($page['errors']))
{
$parent_id = !empty($_GET['parent_id'])?$_GET['parent_id']:'NULL';
@@ -136,7 +134,7 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1)
'uppercats','global_rank');
mass_inserts(CATEGORIES_TABLE, $dbfields, $inserts);
- array_push($infos, $lang['cat_virtual_added']);
+ array_push($page['infos'], $lang['cat_virtual_added']);
}
}
// +-----------------------------------------------------------------------+
@@ -344,25 +342,6 @@ $template->assign_vars(array(
$tpl = array('cat_first','cat_last');
// +-----------------------------------------------------------------------+
-// | errors & infos |
-// +-----------------------------------------------------------------------+
-if (count($errors) != 0)
-{
- $template->assign_block_vars('errors',array());
- foreach ($errors as $error)
- {
- $template->assign_block_vars('errors.error',array('ERROR'=>$error));
- }
-}
-if (count($infos) != 0)
-{
- $template->assign_block_vars('infos',array());
- foreach ($infos as $info)
- {
- $template->assign_block_vars('infos.info',array('INFO'=>$info));
- }
-}
-// +-----------------------------------------------------------------------+
// | Categories display |
// +-----------------------------------------------------------------------+
$ranks = array();