Changeset 498 for trunk/admin
- Timestamp:
- Aug 29, 2004, 1:21:21 PM (20 years ago)
- Location:
- trunk/admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r496 r498 193 193 function delete_categories($ids) 194 194 { 195 global $counts; 196 195 197 // destruction of all the related elements 196 198 $query = ' … … 252 254 ;'; 253 255 mysql_query($query); 254 } 255 256 257 if (isset($counts['del_categories'])) 258 { 259 $counts['del_categories']+= count($ids); 260 } 261 } 256 262 257 263 // The function delete_elements deletes the elements identified by the … … 262 268 function delete_elements($ids) 263 269 { 264 global $count _deleted;270 global $counts; 265 271 266 272 // destruction of the comments on the image … … 296 302 mysql_query($query); 297 303 298 $count_deleted+= count($ids); 304 if (isset($counts['del_elements'])) 305 { 306 $counts['del_elements']+= count($ids); 307 } 299 308 } 300 309 -
trunk/admin/update.php
r494 r498 69 69 function insert_local_category($id_uppercat) 70 70 { 71 global $conf, $page, $user, $lang ;71 global $conf, $page, $user, $lang, $counts; 72 72 73 73 $uppercats = ''; … … 189 189 else 190 190 { 191 $output.= '<span style="color:red;">"'.$fs_subdir.'" : ';191 $output.= '<span class="update_category_error">"'.$fs_subdir.'" : '; 192 192 $output.= $lang['update_wrong_dirname'].'</span><br />'; 193 193 } … … 206 206 ;'; 207 207 mysql_query($query); 208 209 $counts['new_categories']+= count($inserts); 208 210 // updating uppercats field 209 211 $query = ' … … 266 268 function insert_local_element($dir, $category_id) 267 269 { 268 global $lang,$conf,$count _new;270 global $lang,$conf,$counts; 269 271 270 272 $output = ''; … … 399 401 $insert['tn_ext'] = "'".$tn_ext."'"; 400 402 401 $count_new++; 402 $output.= $unregistered_element; 403 $output.= ' <span style="font-weight:bold;">'; 404 $output.= $lang['update_research_added'].'</span>'; 405 $output.= ' ('.$lang['update_research_tn_ext'].' '.$tn_ext.')'; 406 $output.= '<br />'; 403 $counts['new_elements']++; 407 404 array_push($inserts, $insert); 408 405 } 409 406 else 410 407 { 411 $output.= '<span style="color:orange;">';408 $output.= '<span class="update_error_element">'; 412 409 $output.= $lang['update_missing_tn'].' : '.$unregistered_element; 413 410 $output.= ' (<span style="font-weight:bold;">'; … … 450 447 } 451 448 452 $count_new++; 453 $output.= $unregistered_element; 454 $output.= ' <span style="font-weight:bold;">'; 455 $output.= $lang['update_research_added'].'</span>'; 456 $output.= '<br />'; 449 $counts['new_elements']++; 457 450 array_push($inserts, $insert); 458 451 } … … 460 453 else 461 454 { 462 $output.= '<span style="color:red;">"'.$unregistered_element.'" : '; 455 $output.= '<span class="update_error_element">"'; 456 $output.= $unregistered_element.'" : '; 463 457 $output.= $lang['update_wrong_dirname'].'</span><br />'; 464 458 } … … 553 547 'L_ALL_UPDATE'=>$lang['update_all'], 554 548 'L_RESULT_UPDATE'=>$lang['update_part_research'], 555 'L_NEW_CATEGORY'=>$lang['update_research_conclusion'], 556 'L_DEL_CATEGORY'=>$lang['update_deletion_conclusion'], 549 'L_NB_NEW_ELEMENTS'=>$lang['update_nb_new_elements'], 550 'L_NB_NEW_CATEGORIES'=>$lang['update_nb_new_categories'], 551 'L_NB_DEL_ELEMENTS'=>$lang['update_nb_del_elements'], 552 'L_NB_DEL_CATEGORIES'=>$lang['update_nb_del_categories'], 557 553 'L_UPDATE_SYNC_METADATA_QUESTION'=>$lang['update_sync_metadata_question'], 558 554 … … 571 567 check_cat_id($_GET['update']); 572 568 $start = get_moment(); 573 $count_new = 0; 574 $count_deleted = 0; 569 $counts = array( 570 'new_elements' => 0, 571 'new_categories' => 0, 572 'del_elements' => 0, 573 'del_categories' => 0 574 ); 575 575 576 576 if (isset($page['cat'])) … … 583 583 } 584 584 echo get_elapsed_time($start,get_moment()).' for scanning directories<br />'; 585 $template->assign_block_vars('update',array( 586 'CATEGORIES'=>$categories, 587 'NEW_CAT'=>$count_new, 588 'DEL_CAT'=>$count_deleted 589 )); 590 if ($count_new > 0) 585 $template->assign_block_vars( 586 'update', 587 array( 588 'CATEGORIES'=>$categories, 589 'NB_NEW_CATEGORIES'=>$counts['new_categories'], 590 'NB_DEL_CATEGORIES'=>$counts['del_categories'], 591 'NB_NEW_ELEMENTS'=>$counts['new_elements'], 592 'NB_DEL_ELEMENTS'=>$counts['del_elements'] 593 )); 594 if ($counts['new_elements'] > 0) 591 595 { 592 596 $url = PHPWG_ROOT_PATH.'admin.php?page=update&metadata=1';
Note: See TracChangeset
for help on using the changeset viewer.