From e851f504acebc9422b79f58da25420666da6e296 Mon Sep 17 00:00:00 2001 From: plegall Date: Sat, 11 Jun 2005 14:10:04 +0000 Subject: [PATCH] - 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 --- admin.php | 23 ++++++++++ admin/cat_list.php | 29 ++----------- admin/cat_modify.php | 3 +- admin/configuration.php | 33 +++++--------- admin/element_set_global.php | 1 - admin/element_set_unit.php | 1 - admin/group_list.php | 22 +++------- admin/picture_modify.php | 17 ++------ admin/remote_site.php | 50 +++++++--------------- admin/thumbnail.php | 26 +++-------- admin/update.php | 8 ++-- admin/user_list.php | 12 +++--- admin/waiting.php | 7 +-- doc/ChangeLog | 7 +++ template/default/admin.tpl | 21 +++++++++ template/default/admin/cat_list.tpl | 16 ------- template/default/admin/cat_modify.tpl | 4 -- template/default/admin/configuration.tpl | 12 ------ template/default/admin/group_list.tpl | 11 +---- template/default/admin/images/errors.png | Bin 0 -> 3248 bytes template/default/admin/images/infos.png | Bin 0 -> 2249 bytes template/default/admin/picture_modify.tpl | 9 ---- template/default/admin/remote_site.tpl | 14 ------ template/default/admin/thumbnail.tpl | 10 ----- template/default/admin/update.tpl | 20 ++++----- template/default/admin/waiting.tpl | 3 -- template/default/default.css | 32 ++++++++++++++ 27 files changed, 150 insertions(+), 241 deletions(-) create mode 100644 template/default/admin/images/errors.png create mode 100644 template/default/admin/images/infos.png diff --git a/admin.php b/admin.php index 60a6b25db..ade076020 100644 --- a/admin.php +++ b/admin.php @@ -265,6 +265,9 @@ $template->assign_vars(array( //--------------------------------------------------------------------- summary $link_start = PHPWG_ROOT_PATH.'admin.php?page='; //------------------------------------------------------------- content display +$page['errors'] = array(); +$page['infos'] = array(); + if ($page_valide) { switch ($_GET['page']) @@ -294,6 +297,26 @@ else ) ); } +// +-----------------------------------------------------------------------+ +// | errors & infos | +// +-----------------------------------------------------------------------+ +if (count($page['errors']) != 0) +{ + $template->assign_block_vars('errors',array()); + foreach ($page['errors'] as $error) + { + $template->assign_block_vars('errors.error',array('ERROR'=>$error)); + } +} +if (count($page['infos']) != 0) +{ + $template->assign_block_vars('infos',array()); + foreach ($page['infos'] as $info) + { + $template->assign_block_vars('infos.info',array('INFO'=>$info)); + } +} + $template->parse('admin'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); // +-----------------------------------------------------------------------+ 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(); diff --git a/admin/cat_modify.php b/admin/cat_modify.php index 97217ab99..44c07ad85 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -81,7 +81,7 @@ if ( isset( $_POST['submit'] ) ) set_cat_visible(array($_GET['cat_id']), $_POST['visible']); set_cat_status(array($_GET['cat_id']), $_POST['status']); - $template->assign_block_vars('confirmation' ,array()); + array_push($infos, $lang['editcat_confirm']); } else if (isset($_POST['set_random_representant'])) { @@ -144,7 +144,6 @@ $template->assign_vars(array( $commentable=>'checked="checked"', $uploadable=>'checked="checked"', - 'L_EDIT_CONFIRM'=>$lang['editcat_confirm'], 'L_EDIT_NAME'=>$lang['name'], 'L_STORAGE'=>$lang['storage'], 'L_REMOTE_SITE'=>$lang['remote_site'], diff --git a/admin/configuration.php b/admin/configuration.php index 9b3ca801a..5d3864937 100644 --- a/admin/configuration.php +++ b/admin/configuration.php @@ -53,7 +53,6 @@ while ($row = mysql_fetch_array($result)) } } //------------------------------ verification and registration of modifications -$errors = array(); if (isset($_POST['submit'])) { $int_pattern = '/^\d+$/'; @@ -64,13 +63,13 @@ if (isset($_POST['submit'])) // thumbnail prefix must only contain simple ASCII characters if (!preg_match('/^[\w-]*$/', $_POST['prefix_thumbnail'])) { - array_push($errors, $lang['conf_prefix_thumbnail_error']); + array_push($page['errors'], $lang['conf_prefix_thumbnail_error']); } // mail must be formatted as follows : name@server.com $pattern = '/^[\w-]+(\.[\w-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/'; if (!preg_match($pattern, $_POST['mail_webmaster'])) { - array_push($errors, $lang['conf_mail_webmaster_error']); + array_push($page['errors'], $lang['conf_mail_webmaster_error']); } break; } @@ -82,7 +81,7 @@ if (isset($_POST['submit'])) or $_POST['nb_comment_page'] < 5 or $_POST['nb_comment_page'] > 50) { - array_push($errors, $lang['conf_nb_comment_page_error']); + array_push($page['errors'], $lang['conf_nb_comment_page_error']); } break; } @@ -92,7 +91,7 @@ if (isset($_POST['submit'])) if (!preg_match($int_pattern, $_POST['recent_period']) or $_POST['recent_period'] <= 0) { - array_push($errors, $lang['periods_error']); + array_push($page['errors'], $lang['periods_error']); } break; } @@ -103,7 +102,7 @@ if (isset($_POST['submit'])) or $_POST['upload_maxfilesize'] < 10 or $_POST['upload_maxfilesize'] > 1000) { - array_push($errors, $lang['conf_upload_maxfilesize_error']); + array_push($page['errors'], $lang['conf_upload_maxfilesize_error']); } foreach (array('upload_maxwidth', @@ -113,9 +112,9 @@ if (isset($_POST['submit'])) as $field) { if (!preg_match($int_pattern, $_POST[$field]) - or $_POST[$field] < 10) + or $_POST[$field] < 10) { - array_push($errors, $lang['conf_'.$field.'_error']); + array_push($page['errors'], $lang['conf_'.$field.'_error']); } } break; @@ -123,8 +122,9 @@ if (isset($_POST['submit'])) } // updating configuration if no error found - if (count($errors) == 0) + if (count($page['errors']) == 0) { + echo '
'; print_r($_POST); echo '
'; $result = pwg_query('SELECT * FROM '.CONFIG_TABLE); while ($row = mysql_fetch_array($result)) { @@ -138,6 +138,7 @@ UPDATE '.CONFIG_TABLE.' pwg_query($query); } } + array_push($page['infos'], $lang['conf_confirmation']); } } @@ -149,7 +150,6 @@ $action.= '&section='.$page['section']; $template->assign_vars( array( - 'L_CONFIRM'=>$lang['conf_confirmation'], 'L_YES'=>$lang['yes'], 'L_NO'=>$lang['no'], 'L_SUBMIT'=>$lang['submit'], @@ -343,19 +343,6 @@ switch ($page['section']) break; } } -//-------------------------------------------------------------- errors display -if ( sizeof( $errors ) != 0 ) -{ - $template->assign_block_vars('errors',array()); - for ( $i = 0; $i < sizeof( $errors ); $i++ ) - { - $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i])); - } -} -elseif ( isset( $_POST['submit'] ) ) -{ - $template->assign_block_vars('confirmation' ,array()); -} //----------------------------------------------------------- sending html code $template->assign_var_from_handle('ADMIN_CONTENT', 'config'); ?> diff --git a/admin/element_set_global.php b/admin/element_set_global.php index 1c1315a0b..33ede7dfc 100644 --- a/admin/element_set_global.php +++ b/admin/element_set_global.php @@ -74,7 +74,6 @@ SELECT keywords // +-----------------------------------------------------------------------+ // | global mode form submission | // +-----------------------------------------------------------------------+ -$errors = array(); if (isset($_POST['submit'])) { diff --git a/admin/element_set_unit.php b/admin/element_set_unit.php index b72c370fe..74aaf1eb0 100644 --- a/admin/element_set_unit.php +++ b/admin/element_set_unit.php @@ -40,7 +40,6 @@ include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php'); // +-----------------------------------------------------------------------+ // | unit mode form submission | // +-----------------------------------------------------------------------+ -$errors = array(); if (isset($_POST['submit'])) { diff --git a/admin/group_list.php b/admin/group_list.php index cdf123f4e..f789a6b27 100644 --- a/admin/group_list.php +++ b/admin/group_list.php @@ -31,7 +31,6 @@ if( !defined("PHPWG_ROOT_PATH") ) include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); //-------------------------------------------------------------- delete a group -$error = array(); if ( isset( $_POST['delete'] ) && isset( $_POST['confirm_delete'] ) ) { // destruction of the access linked to the group @@ -57,9 +56,9 @@ elseif ( isset( $_POST['new'] ) ) if ( empty($_POST['newgroup']) || preg_match( "/'/", $_POST['newgroup'] ) or preg_match( '/"/', $_POST['newgroup'] ) ) { - array_push( $error, $lang['group_add_error1'] ); + array_push( $page['errors'], $lang['group_add_error1'] ); } - if ( count( $error ) == 0 ) + if ( count( $page['errors'] ) == 0 ) { // is the group not already existing ? $query = 'SELECT id FROM '.GROUPS_TABLE; @@ -68,10 +67,10 @@ elseif ( isset( $_POST['new'] ) ) $result = pwg_query( $query ); if ( mysql_num_rows( $result ) > 0 ) { - array_push( $error, $lang['group_add_error2'] ); + array_push( $page['errors'], $lang['group_add_error2'] ); } } - if ( count( $error ) == 0 ) + if ( count( $page['errors'] ) == 0 ) { // creating the group $query = ' INSERT INTO '.GROUPS_TABLE; @@ -80,13 +79,13 @@ elseif ( isset( $_POST['new'] ) ) pwg_query( $query ); } } -//--------------------------------------------------------------- user management +//------------------------------------------------------------- user management elseif ( isset( $_POST['add'] ) ) { $userdata = getuserdata($_POST['username']); if (!$userdata) { - array_push($error, $lang['user_err_unknown']); + array_push($page['errors'], $lang['user_err_unknown']); } else { @@ -113,15 +112,6 @@ elseif (isset( $_POST['deny_user'] )) $query.= ') AND group_id = '.$_POST['edit_group_id']; pwg_query( $query ); } -//-------------------------------------------------------------- errors display -if ( sizeof( $error ) != 0 ) -{ - $template->assign_block_vars('errors',array()); - for ( $i = 0; $i < sizeof( $error ); $i++ ) - { - $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i])); - } -} //----------------------------------------------------------------- groups list $query = 'SELECT id,name FROM '.GROUPS_TABLE; diff --git a/admin/picture_modify.php b/admin/picture_modify.php index fc2e2eb51..64d6cf04b 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -31,16 +31,15 @@ if(!defined("PHPWG_ROOT_PATH")) } include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php'); //--------------------------------------------------------- update informations -$errors = array(); // first, we verify whether there is a mistake on the given creation date if (isset($_POST['date_creation']) and !empty($_POST['date_creation'])) { if (!check_date_format($_POST['date_creation'])) { - array_push($errors, $lang['err_date']); + array_push($page['errors'], $lang['err_date']); } } -if (isset($_POST['submit']) and count($errors) == 0) +if (isset($_POST['submit']) and count($page['errors']) == 0) { $query = 'UPDATE '.IMAGES_TABLE.' SET name = '; if ($_POST['name'] == '') @@ -160,7 +159,7 @@ $thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']); $url_img = PHPWG_ROOT_PATH.'picture.php?image_id='.$_GET['image_id']; $url_img .= '&cat='.$row['storage_category_id']; -$date = isset($_POST['date_creation']) && empty($errors) +$date = isset($_POST['date_creation']) && empty($page['errors']) ?$_POST['date_creation']:date_convert_back(@$row['date_creation']); $url = PHPWG_ROOT_PATH.'admin.php?page=cat_modify&cat_id='; @@ -212,16 +211,6 @@ $template->assign_vars(array( 'F_ACTION'=>add_session_id(PHPWG_ROOT_PATH.'admin.php?'.$_SERVER['QUERY_STRING']) )); -//-------------------------------------------------------------- errors display -if (count($errors) != 0) -{ - $template->assign_block_vars('errors',array()); - foreach ($errors as $error) - { - $template->assign_block_vars('errors.error',array('ERROR'=>$error)); - } -} - // associate to another category ? $query = ' SELECT id,name,uppercats,global_rank diff --git a/admin/remote_site.php b/admin/remote_site.php index 37f9458fc..ba8dc67ce 100644 --- a/admin/remote_site.php +++ b/admin/remote_site.php @@ -45,7 +45,7 @@ define('CURRENT_DATE', date('Y-m-d')); */ function remote_output($url) { - global $template, $errors, $lang; + global $template, $page, $lang; if($lines = @file($url)) { @@ -68,7 +68,7 @@ function remote_output($url) } else { - array_push($errors, $lang['remote_site_file_not_found']); + array_push($page['errors'], $lang['remote_site_file_not_found']); } } @@ -120,7 +120,7 @@ SELECT id,dir */ function update_remote_site($listing_file, $site_id) { - global $lang, $counts, $template, $removes, $errors; + global $lang, $counts, $template, $removes, $page; if (@fopen($listing_file, 'r')) { @@ -159,7 +159,7 @@ function update_remote_site($listing_file, $site_id) } else { - array_push($errors, $lang['remote_site_listing_not_found']); + array_push($page['errors'], $lang['remote_site_listing_not_found']); } } @@ -518,14 +518,12 @@ $template->assign_vars( // +-----------------------------------------------------------------------+ // | new site creation form | // +-----------------------------------------------------------------------+ -$errors = array(); - if (isset($_POST['submit'])) { // site must start by http:// or https:// if (!preg_match('/^https?:\/\/[~\/\.\w-]+$/', $_POST['galleries_url'])) { - array_push($errors, $lang['remote_site_uncorrect_url']); + array_push($page['errors'], $lang['remote_site_uncorrect_url']); } else { @@ -542,11 +540,11 @@ SELECT COUNT(id) AS count $row = mysql_fetch_array(pwg_query($query)); if ($row['count'] > 0) { - array_push($errors, $lang['remote_site_already_exists']); + array_push($page['errors'], $lang['remote_site_already_exists']); } } - if (count($errors) == 0) + if (count($page['errors']) == 0) { $url = $page['galleries_url'].'create_listing_file.php'; $url.= '?action=test'; @@ -556,16 +554,17 @@ SELECT COUNT(id) AS count $first_line = strip_tags($lines[0]); if (!preg_match('/^PWG-INFO-2:/', $first_line)) { - array_push($errors, $lang['remote_site_error'].' : '.$first_line); + array_push($page['errors'], + $lang['remote_site_error'].' : '.$first_line); } } else { - array_push($errors, $lang['remote_site_file_not_found']); + array_push($page['errors'], $lang['remote_site_file_not_found']); } } - if (count($errors) == 0) + if (count($page['errors']) == 0) { $query = ' INSERT INTO '.SITES_TABLE.' @@ -575,11 +574,8 @@ INSERT INTO '.SITES_TABLE.' ;'; pwg_query($query); - $template->assign_block_vars( - 'confirmation', - array( - 'CONTENT'=>$page['galleries_url'].' '.$lang['remote_site_created'] - )); + array_push($page['infos'], + $page['galleries_url'].' '.$lang['remote_site_created']); } } // +-----------------------------------------------------------------------+ @@ -607,13 +603,8 @@ SELECT galleries_url case 'delete' : { delete_site($page['site']); - - $template->assign_block_vars( - 'confirmation', - array( - 'CONTENT'=>$galleries_url.' '.$lang['remote_site_deleted'] - )); - + array_push($page['infos'], + $galleries_url.' '.$lang['remote_site_deleted']); break; } case 'generate' : @@ -738,17 +729,6 @@ while ($row = mysql_fetch_array($result)) ); } // +-----------------------------------------------------------------------+ -// | errors display | -// +-----------------------------------------------------------------------+ -if (count($errors) != 0) -{ - $template->assign_block_vars('errors',array()); - foreach ($errors as $error) - { - $template->assign_block_vars('errors.error',array('ERROR'=>$error)); - } -} -// +-----------------------------------------------------------------------+ // | sending html code | // +-----------------------------------------------------------------------+ $template->assign_var_from_handle('ADMIN_CONTENT', 'remote_site'); diff --git a/admin/thumbnail.php b/admin/thumbnail.php index 7cdb1711a..64a6797e3 100644 --- a/admin/thumbnail.php +++ b/admin/thumbnail.php @@ -31,7 +31,7 @@ include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' ); // "thumbnail". function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) { - global $conf, $lang, $errors; + global $conf, $lang, $page; $filename = basename($path); $dirname = dirname($path); @@ -100,7 +100,8 @@ function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) { if (!is_writable($dirname)) { - array_push($errors, '['.$dirname.'] : '.$lang['no_write_access']); + array_push($page['errors'], + '['.$dirname.'] : '.$lang['no_write_access']); return false; } umask(0000); @@ -114,7 +115,7 @@ function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) // creation and backup of final picture if (!is_writable($tndir)) { - array_push($errors, '['.$tndir.'] : '.$lang['no_write_access']); + array_push($page['errors'], '['.$tndir.'] : '.$lang['no_write_access']); return false; } imagejpeg($destImage, $dest_file); @@ -148,7 +149,6 @@ function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) } } -$errors = array(); $pictures = array(); $stats = array(); // +-----------------------------------------------------------------------+ @@ -247,22 +247,21 @@ foreach ($fs['elements'] as $path) // +-----------------------------------------------------------------------+ if (isset($_POST['submit'])) { - $errors = array(); $times = array(); $infos = array(); // checking criteria if (!ereg('^[0-9]{2,3}$', $_POST['width']) or $_POST['width'] < 10) { - array_push($errors, $lang['tn_err_width'].' 10'); + array_push($page['errors'], $lang['tn_err_width'].' 10'); } if (!ereg('^[0-9]{2,3}$', $_POST['height']) or $_POST['height'] < 10) { - array_push($errors, $lang['tn_err_height'].' 10'); + array_push($page['errors'], $lang['tn_err_height'].' 10'); } // picture miniaturization - if (count($errors) == 0) + if (count($page['errors']) == 0) { $num = 1; foreach ($wo_thumbnails as $path) @@ -345,17 +344,6 @@ if (isset($_POST['submit'])) } } // +-----------------------------------------------------------------------+ -// | errors display | -// +-----------------------------------------------------------------------+ -if (count($errors) != 0) -{ - $template->assign_block_vars('errors',array()); - foreach ($errors as $error) - { - $template->assign_block_vars('errors.error',array('ERROR'=>$error)); - } -} -// +-----------------------------------------------------------------------+ // | form & pictures without thumbnails display | // +-----------------------------------------------------------------------+ $remainings = array_diff($wo_thumbnails, $thumbnalized); diff --git a/admin/update.php b/admin/update.php index 59e748198..bfc3236fc 100644 --- a/admin/update.php +++ b/admin/update.php @@ -654,11 +654,11 @@ if (isset($_POST['submit']) if (count($errors) > 0) { - $template->assign_block_vars('update.errors', array()); + $template->assign_block_vars('update.update_errors', array()); foreach ($errors as $error) { $template->assign_block_vars( - 'update.errors.error', + 'update.update_errors.update_error', array( 'ELEMENT' => $error['path'], 'LABEL' => $error['type'].' ('.$error_labels[$error['type']].')' @@ -669,11 +669,11 @@ if (isset($_POST['submit']) and isset($_POST['display_info']) and $_POST['display_info'] == 1) { - $template->assign_block_vars('update.infos', array()); + $template->assign_block_vars('update.update_infos', array()); foreach ($infos as $info) { $template->assign_block_vars( - 'update.infos.info', + 'update.update_infos.update_info', array( 'ELEMENT' => $info['path'], 'LABEL' => $info['info'] diff --git a/admin/user_list.php b/admin/user_list.php index 23c467eb4..26a98ebaf 100644 --- a/admin/user_list.php +++ b/admin/user_list.php @@ -45,18 +45,16 @@ include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php'); if (isset($_POST['submit_add'])) { - $errors = register_user($_POST['login'], - $_POST['password'], - $_POST['password'], - ''); + $page['errors'] = register_user($_POST['login'], + $_POST['password'], + $_POST['password'], + ''); } // +-----------------------------------------------------------------------+ // | preferences form submission | // +-----------------------------------------------------------------------+ -$errors = array(); - if (isset($_POST['pref_submit'])) { $collection = array(); @@ -193,7 +191,7 @@ $template->set_filenames(array('user_list'=>'admin/user_list.tpl')); $base_url = add_session_id(PHPWG_ROOT_PATH.'admin.php?page=user_list'); -$conf['users_page'] = 20; +$conf['users_page'] = 10; if (isset($_GET['start']) and is_numeric($_GET['start'])) { diff --git a/admin/waiting.php b/admin/waiting.php index b0b69cd2e..3be00dd5c 100644 --- a/admin/waiting.php +++ b/admin/waiting.php @@ -72,12 +72,12 @@ if ( isset( $_POST['submit'] ) ) } } } + array_push($infos, $lang['waiting_update']); } //----------------------------------------------------- template initialization $template->set_filenames(array('waiting'=>'admin/waiting.tpl')); $template->assign_vars(array( - 'L_WAITING_CONFIRMATION'=>$lang['waiting_update'], 'L_AUTHOR'=>$lang['author'], 'L_THUMBNAIL'=>$lang['thumbnail'], 'L_DATE'=>$lang['date'], @@ -90,11 +90,6 @@ $template->assign_vars(array( 'F_ACTION'=>add_session_id(str_replace( '&', '&', $_SERVER['REQUEST_URI'] )) )); -//-------------------------------------------------------- confirmation message -if (isset($_POST['submit'])) -{ - $template->assign_block_vars('confirmation' ,array()); -} //---------------------------------------------------------------- form display $cat_names = array(); $query = 'SELECT * FROM '.WAITING_TABLE; diff --git a/doc/ChangeLog b/doc/ChangeLog index cd9c18b98..b3d898ad6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2005-06-11 Pierrick LE GALL + + * 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) + 2005-06-11 Pierrick LE GALL * bug 96 (informations given by uploaders are lost) correction diff --git a/template/default/admin.tpl b/template/default/admin.tpl index 5c86bfdd7..db93f7ca9 100644 --- a/template/default/admin.tpl +++ b/template/default/admin.tpl @@ -71,6 +71,27 @@
{PAGE_TITLE}
+ + +
+
    + +
  • {errors.error.ERROR}
  • + +
+
+ + + +
+
    + +
  • {infos.info.INFO}
  • + +
+
+ +
{ADMIN_CONTENT}{ADMIN_CONTENT_2}
diff --git a/template/default/admin/cat_list.tpl b/template/default/admin/cat_list.tpl index 39fbc3b20..f6e30b042 100644 --- a/template/default/admin/cat_list.tpl +++ b/template/default/admin/cat_list.tpl @@ -1,19 +1,3 @@ - -
- -
- - -
- -
  • {infos.info.INFO}
  • - -
    -
    {CATEGORIES_NAV}
    diff --git a/template/default/admin/cat_modify.tpl b/template/default/admin/cat_modify.tpl index bd25ac1b6..e83f587d4 100644 --- a/template/default/admin/cat_modify.tpl +++ b/template/default/admin/cat_modify.tpl @@ -1,7 +1,3 @@ - -
    - {L_EDIT_CONFIRM} {L_HERE}
    -
    {CATEGORIES_NAV}
    diff --git a/template/default/admin/configuration.tpl b/template/default/admin/configuration.tpl index 9349c63b7..0f8bccf01 100644 --- a/template/default/admin/configuration.tpl +++ b/template/default/admin/configuration.tpl @@ -1,15 +1,3 @@ - -
    - -
    - - -
    {L_CONFIRM}
    -
    diff --git a/template/default/admin/group_list.tpl b/template/default/admin/group_list.tpl index 3a5688af0..89cdf1bb2 100644 --- a/template/default/admin/group_list.tpl +++ b/template/default/admin/group_list.tpl @@ -1,12 +1,3 @@ - -
    - -
    -
    {L_GROUP_SELECT}
    @@ -49,4 +40,4 @@
    - \ No newline at end of file + diff --git a/template/default/admin/images/errors.png b/template/default/admin/images/errors.png new file mode 100644 index 0000000000000000000000000000000000000000..887ec3d67bcc34aca8c0f1633c71ec88ef4b13ce GIT binary patch literal 3248 zcmV;h3{UfkP)N+$12c@RCt9blWhDwrzurh=3?s8X*K2 zDFiK`X*1Tew&e_90PR+)9poj9!Ldh~nn6Hdq{I;@O$dYB8_MSg-lg@o5H%R|6r)pJFb$0gozO~l=*4ldq{+~a}_xL*nP;bIqGW=77f0uu0 z0!nFV>9S3mHob4#Hnwedppf#0&^sIs?z!il*I#+%mCZmqVD*(mpTL)wmp}Xb^Uuo* z7cR)oM+niQ*|wd~>gwv`(@#GwSFc{Z6&Mb0(B}gcRg@r5g^76XCcL%BKy3{l+!h*qImzkz1P1B4EzPsh-=JuI{ zlBDOC?cBNZ{epsmh( zb)de!o|j*KnXzNXzO!-T#y5aw!0c&FC`ovJ#hyKT-YqC7h*+qarqR&Qz@_8I(O0hQ zb4bVL=QBP(KUR{YWZAN1WMyS-e)ZK?-|CHoqc`ve4jg!Q=gyrG;Df;+O-)Ud@7|4g z>7^TzHQ$L7Sc<~nY11OW17v4svt`Sc$%_{+RtpOY%YaZ=W|JnM6c!e)*t>V{yE}I5 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_PsWW5pc7b^8FA?3H4YvfWbsT3 zzeg*}3bPw5{`A9kE?wzkAQYpj!l1F%T^9I(aEc?RLqwu!{@j&Q!e3PuNGt4?4w%3u z`>3a1?7^i@ONpd~X^5=j;3zE6iBsj*R0&~>T1MMtFr1>hH%jN3AujhN`Pu$UoWGb8 zOr8f$s7ojdums=-{sJt_xjhIP+`S~oh86Wpu5(jcY2bBhC1=*6HDFqDZ7@mSP>Rca z2|CXV@tc?5) z0t1RbOaMMbz*M{YabPpIhFk>p11Et#1-?(Y&>#@gZHYmsb_n>j8aQ29=!2H?z#o7E zz&i?T2need1EN4$04_zsP*!lM=20Q516ZZ5z*}w-;4p9*IHzu>qpF3~W*q?f)iY!x zkq`>FrbuMMs;&}7W`9(u-vMB*Dgb8y)oN~&x|l5{_8Wq8Djc4+-OVQzu#^HGQGi1> zA~9eXNB~Kp0N7iGM8-O9wNEk@@!PVYSIzM_imXg{61Jzb=`7n5^-S9c46EM})iRcd z0&xXCk$JKGV|D-;GA^5&xozMxzjd2lw}CbCRJ*1FaOV3d)e`Dy2cJ;DV>W%JSWDYi zNI1aT`!i80v)MEI#jU_NSKqJ!)E$>2V>}9&w1KogEyw&EkR_ir^86OI)fEl`($VK6l5aeP06XQs X>>>nzmiX>g00000NkvXXu0mjfztuHx literal 0 HcmV?d00001 diff --git a/template/default/admin/picture_modify.tpl b/template/default/admin/picture_modify.tpl index 2816c9c69..5cd889e83 100644 --- a/template/default/admin/picture_modify.tpl +++ b/template/default/admin/picture_modify.tpl @@ -1,12 +1,3 @@ - -
    -
      - -
    • {errors.error.ERROR}
    • - -
    -
    -
    {TITLE_IMG}
    diff --git a/template/default/admin/remote_site.tpl b/template/default/admin/remote_site.tpl index 4b8260279..46a466c29 100644 --- a/template/default/admin/remote_site.tpl +++ b/template/default/admin/remote_site.tpl @@ -1,19 +1,5 @@ {REMOTE_SITE_TITLE} - -
    - -
    - - - -
    {confirmation.CONTENT}
    - -
    {L_RESULT_UPDATE}
    diff --git a/template/default/admin/update.tpl b/template/default/admin/update.tpl index d1f3adf5a..3a1ae33d3 100644 --- a/template/default/admin/update.tpl +++ b/template/default/admin/update.tpl @@ -7,27 +7,27 @@
  • {update.NB_DEL_ELEMENTS} {L_NB_DEL_ELEMENTS}
  • {update.NB_ERRORS} {L_UPDATE_NB_ERRORS}
  • - +
    {L_UPDATE_ERROR_LIST_TITLE}
    {L_UPDATE_ERRORS_CAPTION}
    - - + +
    {L_UPDATE_INFOS_TITLE}
    - + diff --git a/template/default/admin/waiting.tpl b/template/default/admin/waiting.tpl index 6c2cbd104..06bd7881f 100644 --- a/template/default/admin/waiting.tpl +++ b/template/default/admin/waiting.tpl @@ -1,7 +1,4 @@ - -
    {L_WAITING_CONFIRMATION}
    -
    diff --git a/template/default/default.css b/template/default/default.css index 35f54769c..2b5ed28fc 100644 --- a/template/default/default.css +++ b/template/default/default.css @@ -381,3 +381,35 @@ pre { text-align:left; } label:hover { cursor: pointer; } + +/** + * Errors box in administration + */ +#errors { + text-align: left; + background-color: red; + background-image: url(admin/images/errors.png); + background-repeat: no-repeat; + background-position: top right; + color: white; + font-weight: bold; + margin: 5px; + border:1px solid black; + padding: 10px 50px 10px 10px; +} + +/** + * Informations box in administration + */ +#infos { + text-align: left; + background-color: #eee; + background-image: url(admin/images/infos.png); + background-repeat: no-repeat; + background-position: top right; + color: black; + font-weight: bold; + margin: 5px; + border:1px solid gray; + padding: 10px 50px 10px 10px; +} \ No newline at end of file
    {L_CATEGORY}