Changeset 1637 for trunk/include/functions_notification.inc.php
- Timestamp:
- Dec 7, 2006, 12:56:24 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_notification.inc.php
r1550 r1637 348 348 * Formats a news line and adds it to the array (e.g. '5 new elements') 349 349 */ 350 function add_news_line(&$news, $count, $ format, $url='', $add_url=false)350 function add_news_line(&$news, $count, $singular_fmt_key, $plural_fmt_key, $url='', $add_url=false) 351 351 { 352 352 if ($count > 0) 353 353 { 354 $line = sprintf($format, $count);354 $line = l10n_dec($singular_fmt_key, $plural_fmt_key, $count); 355 355 if ($add_url and !empty($url) ) 356 356 { … … 382 382 if (!$exclude_img_cats) 383 383 { 384 $nb_new_elements = nb_new_elements($start, $end); 385 if ($nb_new_elements > 0) 386 { 387 array_push($news, sprintf(l10n('%d new elements'), $nb_new_elements)); 388 } 384 add_news_line( $news, 385 nb_new_elements($start, $end), '%d new element', '%d new elements'); 389 386 } 390 387 391 388 if (!$exclude_img_cats) 392 389 { 393 $nb_updated_categories = nb_updated_categories($start, $end); 394 if ($nb_updated_categories > 0) 395 { 396 array_push($news, sprintf(l10n('%d categories updated'), 397 $nb_updated_categories)); 398 } 390 add_news_line( $news, 391 nb_updated_categories($start, $end), '%d category updated', '%d categories updated'); 399 392 } 400 393 401 394 add_news_line( $news, 402 nb_new_comments($start, $end), l10n('%d new comments'),395 nb_new_comments($start, $end), '%d new comment', '%d new comments', 403 396 get_root_url().'comments.php', $add_url ); 404 397 … … 406 399 { 407 400 add_news_line( $news, 408 nb_unvalidated_comments($end), l10n('%d comments to validate'),401 nb_unvalidated_comments($end), '%d comment to validate', '%d comments to validate', 409 402 get_root_url().'admin.php?page=comments', $add_url ); 410 403 411 404 add_news_line( $news, 412 nb_new_users($start, $end), l10n('%d new users'),405 nb_new_users($start, $end), '%d new user', '%d new users', 413 406 get_root_url().'admin.php?page=user_list', $add_url ); 414 407 415 408 add_news_line( $news, 416 nb_waiting_elements(), l10n('%d waiting elements'),409 nb_waiting_elements(), '%d waiting element', '%d waiting elements', 417 410 get_root_url().'admin.php?page=waiting', $add_url ); 418 411 }
Note: See TracChangeset
for help on using the changeset viewer.