Changeset 792 for trunk/admin
- Timestamp:
- Jun 11, 2005, 4:10:04 PM (19 years ago)
- Location:
- trunk/admin
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_list.php
r764 r792 34 34 // | initialization | 35 35 // +-----------------------------------------------------------------------+ 36 $errors = array();37 $infos = array();38 36 $categories = array(); 39 37 $navigation = $lang['home']; … … 45 43 { 46 44 delete_categories(array($_GET['delete'])); 47 array_push($ infos, $lang['cat_virtual_deleted']);45 array_push($page['infos'], $lang['cat_virtual_deleted']); 48 46 ordering(); 49 47 update_global_rank(); … … 55 53 if (preg_match('/^\s*$/', $_POST['virtual_name'])) 56 54 { 57 array_push($ errors, $lang['cat_error_name']);55 array_push($page['errors'], $lang['cat_error_name']); 58 56 } 59 57 60 if (!count($ errors))58 if (!count($page['errors'])) 61 59 { 62 60 $parent_id = !empty($_GET['parent_id'])?$_GET['parent_id']:'NULL'; … … 137 135 mass_inserts(CATEGORIES_TABLE, $dbfields, $inserts); 138 136 139 array_push($ infos, $lang['cat_virtual_added']);137 array_push($page['infos'], $lang['cat_virtual_added']); 140 138 } 141 139 } … … 345 343 $tpl = array('cat_first','cat_last'); 346 344 // +-----------------------------------------------------------------------+ 347 // | errors & infos |348 // +-----------------------------------------------------------------------+349 if (count($errors) != 0)350 {351 $template->assign_block_vars('errors',array());352 foreach ($errors as $error)353 {354 $template->assign_block_vars('errors.error',array('ERROR'=>$error));355 }356 }357 if (count($infos) != 0)358 {359 $template->assign_block_vars('infos',array());360 foreach ($infos as $info)361 {362 $template->assign_block_vars('infos.info',array('INFO'=>$info));363 }364 }365 // +-----------------------------------------------------------------------+366 345 // | Categories display | 367 346 // +-----------------------------------------------------------------------+ -
trunk/admin/cat_modify.php
r675 r792 82 82 set_cat_status(array($_GET['cat_id']), $_POST['status']); 83 83 84 $template->assign_block_vars('confirmation' ,array());84 array_push($infos, $lang['editcat_confirm']); 85 85 } 86 86 else if (isset($_POST['set_random_representant'])) … … 145 145 $uploadable=>'checked="checked"', 146 146 147 'L_EDIT_CONFIRM'=>$lang['editcat_confirm'],148 147 'L_EDIT_NAME'=>$lang['name'], 149 148 'L_STORAGE'=>$lang['storage'], -
trunk/admin/configuration.php
r700 r792 54 54 } 55 55 //------------------------------ verification and registration of modifications 56 $errors = array();57 56 if (isset($_POST['submit'])) 58 57 { … … 65 64 if (!preg_match('/^[\w-]*$/', $_POST['prefix_thumbnail'])) 66 65 { 67 array_push($ errors, $lang['conf_prefix_thumbnail_error']);66 array_push($page['errors'], $lang['conf_prefix_thumbnail_error']); 68 67 } 69 68 // mail must be formatted as follows : name@server.com … … 71 70 if (!preg_match($pattern, $_POST['mail_webmaster'])) 72 71 { 73 array_push($ errors, $lang['conf_mail_webmaster_error']);72 array_push($page['errors'], $lang['conf_mail_webmaster_error']); 74 73 } 75 74 break; … … 83 82 or $_POST['nb_comment_page'] > 50) 84 83 { 85 array_push($ errors, $lang['conf_nb_comment_page_error']);84 array_push($page['errors'], $lang['conf_nb_comment_page_error']); 86 85 } 87 86 break; … … 93 92 or $_POST['recent_period'] <= 0) 94 93 { 95 array_push($ errors, $lang['periods_error']);94 array_push($page['errors'], $lang['periods_error']); 96 95 } 97 96 break; … … 104 103 or $_POST['upload_maxfilesize'] > 1000) 105 104 { 106 array_push($ errors, $lang['conf_upload_maxfilesize_error']);105 array_push($page['errors'], $lang['conf_upload_maxfilesize_error']); 107 106 } 108 107 … … 114 113 { 115 114 if (!preg_match($int_pattern, $_POST[$field]) 116 or $_POST[$field] < 10)115 or $_POST[$field] < 10) 117 116 { 118 array_push($ errors, $lang['conf_'.$field.'_error']);117 array_push($page['errors'], $lang['conf_'.$field.'_error']); 119 118 } 120 119 } … … 124 123 125 124 // updating configuration if no error found 126 if (count($errors) == 0) 127 { 125 if (count($page['errors']) == 0) 126 { 127 echo '<pre>'; print_r($_POST); echo '</pre>'; 128 128 $result = pwg_query('SELECT * FROM '.CONFIG_TABLE); 129 129 while ($row = mysql_fetch_array($result)) … … 139 139 } 140 140 } 141 array_push($page['infos'], $lang['conf_confirmation']); 141 142 } 142 143 } … … 150 151 $template->assign_vars( 151 152 array( 152 'L_CONFIRM'=>$lang['conf_confirmation'],153 153 'L_YES'=>$lang['yes'], 154 154 'L_NO'=>$lang['no'], … … 344 344 } 345 345 } 346 //-------------------------------------------------------------- errors display347 if ( sizeof( $errors ) != 0 )348 {349 $template->assign_block_vars('errors',array());350 for ( $i = 0; $i < sizeof( $errors ); $i++ )351 {352 $template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i]));353 }354 }355 elseif ( isset( $_POST['submit'] ) )356 {357 $template->assign_block_vars('confirmation' ,array());358 }359 346 //----------------------------------------------------------- sending html code 360 347 $template->assign_var_from_handle('ADMIN_CONTENT', 'config'); -
trunk/admin/element_set_global.php
r764 r792 75 75 // | global mode form submission | 76 76 // +-----------------------------------------------------------------------+ 77 $errors = array();78 77 79 78 if (isset($_POST['submit'])) -
trunk/admin/element_set_unit.php
r764 r792 41 41 // | unit mode form submission | 42 42 // +-----------------------------------------------------------------------+ 43 $errors = array();44 43 45 44 if (isset($_POST['submit'])) -
trunk/admin/group_list.php
r704 r792 32 32 33 33 //-------------------------------------------------------------- delete a group 34 $error = array();35 34 if ( isset( $_POST['delete'] ) && isset( $_POST['confirm_delete'] ) ) 36 35 { … … 58 57 or preg_match( '/"/', $_POST['newgroup'] ) ) 59 58 { 60 array_push( $ error, $lang['group_add_error1'] );59 array_push( $page['errors'], $lang['group_add_error1'] ); 61 60 } 62 if ( count( $ error) == 0 )61 if ( count( $page['errors'] ) == 0 ) 63 62 { 64 63 // is the group not already existing ? … … 69 68 if ( mysql_num_rows( $result ) > 0 ) 70 69 { 71 array_push( $ error, $lang['group_add_error2'] );70 array_push( $page['errors'], $lang['group_add_error2'] ); 72 71 } 73 72 } 74 if ( count( $ error) == 0 )73 if ( count( $page['errors'] ) == 0 ) 75 74 { 76 75 // creating the group … … 81 80 } 82 81 } 83 //------------------------------------------------------------- --user management82 //------------------------------------------------------------- user management 84 83 elseif ( isset( $_POST['add'] ) ) 85 84 { … … 87 86 if (!$userdata) 88 87 { 89 array_push($ error, $lang['user_err_unknown']);88 array_push($page['errors'], $lang['user_err_unknown']); 90 89 } 91 90 else … … 113 112 $query.= ') AND group_id = '.$_POST['edit_group_id']; 114 113 pwg_query( $query ); 115 }116 //-------------------------------------------------------------- errors display117 if ( sizeof( $error ) != 0 )118 {119 $template->assign_block_vars('errors',array());120 for ( $i = 0; $i < sizeof( $error ); $i++ )121 {122 $template->assign_block_vars('errors.error',array('ERROR'=>$error[$i]));123 }124 114 } 125 115 //----------------------------------------------------------------- groups list -
trunk/admin/picture_modify.php
r732 r792 32 32 include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php'); 33 33 //--------------------------------------------------------- update informations 34 $errors = array();35 34 // first, we verify whether there is a mistake on the given creation date 36 35 if (isset($_POST['date_creation']) and !empty($_POST['date_creation'])) … … 38 37 if (!check_date_format($_POST['date_creation'])) 39 38 { 40 array_push($ errors, $lang['err_date']);41 } 42 } 43 if (isset($_POST['submit']) and count($ errors) == 0)39 array_push($page['errors'], $lang['err_date']); 40 } 41 } 42 if (isset($_POST['submit']) and count($page['errors']) == 0) 44 43 { 45 44 $query = 'UPDATE '.IMAGES_TABLE.' SET name = '; … … 161 160 $url_img = PHPWG_ROOT_PATH.'picture.php?image_id='.$_GET['image_id']; 162 161 $url_img .= '&cat='.$row['storage_category_id']; 163 $date = isset($_POST['date_creation']) && empty($ errors)162 $date = isset($_POST['date_creation']) && empty($page['errors']) 164 163 ?$_POST['date_creation']:date_convert_back(@$row['date_creation']); 165 164 … … 213 212 )); 214 213 215 //-------------------------------------------------------------- errors display216 if (count($errors) != 0)217 {218 $template->assign_block_vars('errors',array());219 foreach ($errors as $error)220 {221 $template->assign_block_vars('errors.error',array('ERROR'=>$error));222 }223 }224 225 214 // associate to another category ? 226 215 $query = ' -
trunk/admin/remote_site.php
r675 r792 46 46 function remote_output($url) 47 47 { 48 global $template, $ errors, $lang;48 global $template, $page, $lang; 49 49 50 50 if($lines = @file($url)) … … 69 69 else 70 70 { 71 array_push($ errors, $lang['remote_site_file_not_found']);71 array_push($page['errors'], $lang['remote_site_file_not_found']); 72 72 } 73 73 } … … 121 121 function update_remote_site($listing_file, $site_id) 122 122 { 123 global $lang, $counts, $template, $removes, $ errors;123 global $lang, $counts, $template, $removes, $page; 124 124 125 125 if (@fopen($listing_file, 'r')) … … 160 160 else 161 161 { 162 array_push($ errors, $lang['remote_site_listing_not_found']);162 array_push($page['errors'], $lang['remote_site_listing_not_found']); 163 163 } 164 164 } … … 519 519 // | new site creation form | 520 520 // +-----------------------------------------------------------------------+ 521 $errors = array();522 523 521 if (isset($_POST['submit'])) 524 522 { … … 526 524 if (!preg_match('/^https?:\/\/[~\/\.\w-]+$/', $_POST['galleries_url'])) 527 525 { 528 array_push($ errors, $lang['remote_site_uncorrect_url']);526 array_push($page['errors'], $lang['remote_site_uncorrect_url']); 529 527 } 530 528 else … … 543 541 if ($row['count'] > 0) 544 542 { 545 array_push($ errors, $lang['remote_site_already_exists']);546 } 547 } 548 549 if (count($ errors) == 0)543 array_push($page['errors'], $lang['remote_site_already_exists']); 544 } 545 } 546 547 if (count($page['errors']) == 0) 550 548 { 551 549 $url = $page['galleries_url'].'create_listing_file.php'; … … 557 555 if (!preg_match('/^PWG-INFO-2:/', $first_line)) 558 556 { 559 array_push($errors, $lang['remote_site_error'].' : '.$first_line); 557 array_push($page['errors'], 558 $lang['remote_site_error'].' : '.$first_line); 560 559 } 561 560 } 562 561 else 563 562 { 564 array_push($ errors, $lang['remote_site_file_not_found']);565 } 566 } 567 568 if (count($ errors) == 0)563 array_push($page['errors'], $lang['remote_site_file_not_found']); 564 } 565 } 566 567 if (count($page['errors']) == 0) 569 568 { 570 569 $query = ' … … 576 575 pwg_query($query); 577 576 578 $template->assign_block_vars( 579 'confirmation', 580 array( 581 'CONTENT'=>$page['galleries_url'].' '.$lang['remote_site_created'] 582 )); 577 array_push($page['infos'], 578 $page['galleries_url'].' '.$lang['remote_site_created']); 583 579 } 584 580 } … … 608 604 { 609 605 delete_site($page['site']); 610 611 $template->assign_block_vars( 612 'confirmation', 613 array( 614 'CONTENT'=>$galleries_url.' '.$lang['remote_site_deleted'] 615 )); 616 606 array_push($page['infos'], 607 $galleries_url.' '.$lang['remote_site_deleted']); 617 608 break; 618 609 } … … 739 730 } 740 731 // +-----------------------------------------------------------------------+ 741 // | errors display |742 // +-----------------------------------------------------------------------+743 if (count($errors) != 0)744 {745 $template->assign_block_vars('errors',array());746 foreach ($errors as $error)747 {748 $template->assign_block_vars('errors.error',array('ERROR'=>$error));749 }750 }751 // +-----------------------------------------------------------------------+752 732 // | sending html code | 753 733 // +-----------------------------------------------------------------------+ -
trunk/admin/thumbnail.php
r716 r792 32 32 function RatioResizeImg($path, $newWidth, $newHeight, $tn_ext) 33 33 { 34 global $conf, $lang, $ errors;34 global $conf, $lang, $page; 35 35 36 36 $filename = basename($path); … … 101 101 if (!is_writable($dirname)) 102 102 { 103 array_push($errors, '['.$dirname.'] : '.$lang['no_write_access']); 103 array_push($page['errors'], 104 '['.$dirname.'] : '.$lang['no_write_access']); 104 105 return false; 105 106 } … … 115 116 if (!is_writable($tndir)) 116 117 { 117 array_push($ errors, '['.$tndir.'] : '.$lang['no_write_access']);118 array_push($page['errors'], '['.$tndir.'] : '.$lang['no_write_access']); 118 119 return false; 119 120 } … … 149 150 } 150 151 151 $errors = array();152 152 $pictures = array(); 153 153 $stats = array(); … … 248 248 if (isset($_POST['submit'])) 249 249 { 250 $errors = array();251 250 $times = array(); 252 251 $infos = array(); … … 255 254 if (!ereg('^[0-9]{2,3}$', $_POST['width']) or $_POST['width'] < 10) 256 255 { 257 array_push($ errors, $lang['tn_err_width'].' 10');256 array_push($page['errors'], $lang['tn_err_width'].' 10'); 258 257 } 259 258 if (!ereg('^[0-9]{2,3}$', $_POST['height']) or $_POST['height'] < 10) 260 259 { 261 array_push($ errors, $lang['tn_err_height'].' 10');260 array_push($page['errors'], $lang['tn_err_height'].' 10'); 262 261 } 263 262 264 263 // picture miniaturization 265 if (count($ errors) == 0)264 if (count($page['errors']) == 0) 266 265 { 267 266 $num = 1; … … 346 345 } 347 346 // +-----------------------------------------------------------------------+ 348 // | errors display |349 // +-----------------------------------------------------------------------+350 if (count($errors) != 0)351 {352 $template->assign_block_vars('errors',array());353 foreach ($errors as $error)354 {355 $template->assign_block_vars('errors.error',array('ERROR'=>$error));356 }357 }358 // +-----------------------------------------------------------------------+359 347 // | form & pictures without thumbnails display | 360 348 // +-----------------------------------------------------------------------+ -
trunk/admin/update.php
r791 r792 655 655 if (count($errors) > 0) 656 656 { 657 $template->assign_block_vars('update. errors', array());657 $template->assign_block_vars('update.update_errors', array()); 658 658 foreach ($errors as $error) 659 659 { 660 660 $template->assign_block_vars( 661 'update. errors.error',661 'update.update_errors.update_error', 662 662 array( 663 663 'ELEMENT' => $error['path'], … … 670 670 and $_POST['display_info'] == 1) 671 671 { 672 $template->assign_block_vars('update. infos', array());672 $template->assign_block_vars('update.update_infos', array()); 673 673 foreach ($infos as $info) 674 674 { 675 675 $template->assign_block_vars( 676 'update. infos.info',676 'update.update_infos.update_info', 677 677 array( 678 678 'ELEMENT' => $info['path'], -
trunk/admin/user_list.php
r787 r792 46 46 if (isset($_POST['submit_add'])) 47 47 { 48 $ errors= register_user($_POST['login'],49 $_POST['password'],50 $_POST['password'],51 '');48 $page['errors'] = register_user($_POST['login'], 49 $_POST['password'], 50 $_POST['password'], 51 ''); 52 52 } 53 53 … … 55 55 // | preferences form submission | 56 56 // +-----------------------------------------------------------------------+ 57 58 $errors = array();59 57 60 58 if (isset($_POST['pref_submit'])) … … 194 192 $base_url = add_session_id(PHPWG_ROOT_PATH.'admin.php?page=user_list'); 195 193 196 $conf['users_page'] = 20;194 $conf['users_page'] = 10; 197 195 198 196 if (isset($_GET['start']) and is_numeric($_GET['start'])) -
trunk/admin/waiting.php
r699 r792 73 73 } 74 74 } 75 array_push($infos, $lang['waiting_update']); 75 76 } 76 77 … … 78 79 $template->set_filenames(array('waiting'=>'admin/waiting.tpl')); 79 80 $template->assign_vars(array( 80 'L_WAITING_CONFIRMATION'=>$lang['waiting_update'],81 81 'L_AUTHOR'=>$lang['author'], 82 82 'L_THUMBNAIL'=>$lang['thumbnail'], … … 91 91 )); 92 92 93 //-------------------------------------------------------- confirmation message94 if (isset($_POST['submit']))95 {96 $template->assign_block_vars('confirmation' ,array());97 }98 93 //---------------------------------------------------------------- form display 99 94 $cat_names = array();
Note: See TracChangeset
for help on using the changeset viewer.