Changeset 9516 for extensions
- Timestamp:
- Mar 4, 2011, 11:26:08 AM (14 years ago)
- Location:
- extensions/community
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/community/admin.php
r9372 r9516 30 30 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 31 31 32 load_language('plugin.lang', COMMUNITY_PATH);33 34 32 define('COMMUNITY_BASE_URL', get_root_url().'admin.php?page=plugin-community'); 35 33 … … 44 42 // +-----------------------------------------------------------------------+ 45 43 44 $pendings_label = l10n('Pending Photos'); 45 if ($page['community_nb_pendings'] > 0) 46 { 47 $pendings_label.= ' ('.$page['community_nb_pendings'].')'; 48 } 49 46 50 $tabs = array( 47 51 array( … … 51 55 array( 52 56 'code' => 'pendings', 53 'label' => l10n('Pending Photos'),57 'label' => $pendings_label, 54 58 ), 55 59 ); -
extensions/community/language/en_UK/plugin.lang.php
r9510 r9516 56 56 $lang['Permission updated'] = 'Permission updated'; 57 57 $lang['Delete permission'] = 'Delete permission'; 58 $lang['%u pending photos'] = '%u pending photos'; 58 59 ?> -
extensions/community/language/fr_FR/plugin.lang.php
r9510 r9516 57 57 $lang['Permission updated'] = 'Permission mise à jour'; 58 58 $lang['Delete permission'] = 'Supprimer la permission'; 59 $lang['%u pending photos'] = '%u photos en attente'; 59 60 ?> -
extensions/community/main.inc.php
r9452 r9516 21 21 22 22 include_once(COMMUNITY_PATH.'include/functions_community.inc.php'); 23 load_language('plugin.lang', COMMUNITY_PATH); 23 24 24 25 /* Plugin admin */ 25 26 add_event_handler('get_admin_plugin_menu_links', 'community_admin_menu'); 26 27 27 function community_admin_menu($menu) 28 28 { 29 global $page; 30 31 $query = ' 32 SELECT 33 COUNT(*) 34 FROM '.COMMUNITY_PENDINGS_TABLE.' 35 WHERE state = \'moderation_pending\' 36 ;'; 37 $result = pwg_query($query); 38 list($page['community_nb_pendings']) = pwg_db_fetch_row($result); 39 40 $name = 'Community'; 41 if ($page['community_nb_pendings'] > 0) 42 { 43 $style = 'background-color:#666;'; 44 $style.= 'color:white;'; 45 $style.= 'padding:1px 5px;'; 46 $style.= '-moz-border-radius:10px;'; 47 $style.= '-webkit-border-radius:10px;'; 48 $style.= '-border-radius:10px;'; 49 $style.= 'margin-left:5px;'; 50 51 $name.= '<span style="'.$style.'">'.$page['community_nb_pendings'].'</span>'; 52 53 if (defined('IN_ADMIN') and IN_ADMIN and $page['page'] == 'intro') 54 { 55 global $template; 56 57 $template->set_prefilter('intro', 'community_pendings_on_intro'); 58 $template->assign( 59 array( 60 'COMMUNITY_PENDINGS' => sprintf( 61 '<a href="%s">'.l10n('%u pending photos').'</a>', 62 get_root_url().'admin.php?page=plugin-community-pendings', 63 $page['community_nb_pendings'] 64 ), 65 ) 66 ); 67 } 68 } 69 29 70 array_push( 30 71 $menu, 31 72 array( 32 'NAME' => 'Community',73 'NAME' => $name, 33 74 'URL' => get_root_url().'admin.php?page=plugin-community' 34 75 ) … … 36 77 37 78 return $menu; 79 } 80 81 function community_pendings_on_intro($content, &$smarty) 82 { 83 $pattern = '#<li>\s*{\$DB_ELEMENTS\}#ms'; 84 $replacement = '<li>{$COMMUNITY_PENDINGS}</li><li>{$DB_ELEMENTS}'; 85 return preg_replace($pattern, $replacement, $content); 38 86 } 39 87 … … 154 202 community_reject_user_pendings($user_id); 155 203 } 156 157 204 ?>
Note: See TracChangeset
for help on using the changeset viewer.