Changeset 1580
- Timestamp:
- Oct 27, 2006, 2:25:02 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions_plugins.inc.php
r1578 r1580 99 99 return false; 100 100 } 101 102 /*allows plugins to add their content to the administration page*/ 103 function add_plugin_admin_menu($title, $func) 104 { 105 global $page; 106 107 $uid = md5( var_export($func, true) ); 108 $page['plugin_admin_menu'][] = 109 array( 110 'title' => $title, 111 'function' => $func, 112 'uid' => $uid 113 ); 114 } 115 101 116 ?> -
trunk/admin/plugins.php
r1578 r1580 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-200 5PhpWebGallery Team - http://phpwebgallery.net |5 // | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 7 // | branch : BSF (Best So Far) … … 65 65 $template->set_filenames(array('plugins' => 'admin/plugins.tpl')); 66 66 67 if (count($plugins)) 67 68 trigger_event('plugin_admin_menu'); 69 70 $template->assign_block_vars('plugin_menu.menu_item', 71 array( 72 'NAME' => l10n('Plugins'), 73 'URL' => PHPWG_ROOT_PATH.'admin.php?page=plugins' 74 ) 75 ); 76 77 if ( isset($page['plugin_admin_menu']) ) 68 78 { 69 $ template->assign_block_vars( 'plugins', array() );70 foreach ( $plugins as $plugin_id => $plugin)79 $plug_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugin&section='; 80 foreach ($page['plugin_admin_menu'] as $menu) 71 81 { 72 $action_url = $my_base_url.'&plugin='.$plugin_id; 73 if ( isset( $active_plugins[$plugin_id] ) ) 74 { 75 $action_url .= '&action=deactivate'; 76 $action_name = l10n('Deactivate'); 77 } 78 else 79 { 80 $action_url .= '&action=activate'; 81 $action_name = l10n('Activate'); 82 } 83 $template->assign_block_vars( 'plugins.plugin', 82 $template->assign_block_vars('plugin_menu.menu_item', 84 83 array( 85 'NAME' => $plugin['name'], 86 'DESCRIPTION' => $plugin['description'], 87 'L_ACTION' => $action_name, 88 'U_ACTION' => $action_url, 89 ) 90 ); 84 'NAME' => $menu['title'], 85 'URL' => $plug_base_url.$menu['uid'] 86 ) 87 ); 91 88 } 92 89 } 90 91 $num=0; 92 foreach( $plugins as $plugin_id => $plugin ) 93 { 94 $action_url = $my_base_url.'&plugin='.$plugin_id; 95 if ( isset( $active_plugins[$plugin_id] ) ) 96 { 97 $action_url .= '&action=deactivate'; 98 $action_name = l10n('Deactivate'); 99 } 100 else 101 { 102 $action_url .= '&action=activate'; 103 $action_name = l10n('Activate'); 104 } 105 $display_name = $plugin['name']; 106 if ( !empty($plugin['uri']) ) 107 { 108 $display_name='<a href="'.$plugin['uri'].'">'.$display_name.'</a>'; 109 } 110 $template->assign_block_vars( 'plugins.plugin', 111 array( 112 'NAME' => $display_name, 113 'VERSION' => $plugin['version'], 114 'DESCRIPTION' => $plugin['description'], 115 'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1', 116 'L_ACTION' => $action_name, 117 'U_ACTION' => $action_url, 118 ) 119 ); 120 } 121 122 93 123 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugins'); 94 124 ?> -
trunk/language/en_UK.iso-8859-1/admin.lang.php
r1565 r1580 43 43 $lang['A new version of PhpWebGallery is available.'] = 'A new version of PhpWebGallery is available.'; 44 44 $lang['Actions'] = 'Actions'; 45 $lang['Activate'] = 'Activate'; 45 46 $lang['Add a tag'] = 'Add a tag'; 46 47 $lang['Add a user'] = 'Add a user'; … … 66 67 $lang['Current name'] = 'Current name'; 67 68 $lang['Database'] = 'Database'; 69 $lang['Deactivate'] = 'Deactivate'; 68 70 $lang['Delete Representant'] = 'Delete Representant'; 69 71 $lang['Delete selected tags'] = 'Delete selected tags'; … … 138 140 $lang['PhpWebGallery version'] = 'PhpWebGallery version'; 139 141 $lang['Picture informations updated'] = 'Picture informations updated'; 142 $lang['Plugins'] = 'Plugins'; 140 143 $lang['Position'] = 'Position'; 141 144 $lang['Preferences'] = 'Preferences'; … … 176 179 $lang['Validate'] = 'Validate'; 177 180 $lang['Validation'] = 'Validation'; 181 $lang['Version'] = 'Version'; 178 182 $lang['Virtual categories movement'] = 'Virtual categories movement'; 179 183 $lang['Virtual categories to move'] = 'Virtual categories to move'; -
trunk/language/fr_FR.iso-8859-1/admin.lang.php
r1565 r1580 43 43 $lang['A new version of PhpWebGallery is available.'] = 'Une nouvelle version de PhpWebGallery est disponible.'; 44 44 $lang['Actions'] = 'Actions'; 45 $lang['Activate'] = 'Activer'; 45 46 $lang['Add a tag'] = 'Ajouter un tag'; 46 47 $lang['Add a user'] = 'Ajouter un utilisateur'; … … 66 67 $lang['Current name'] = 'Nom courant'; 67 68 $lang['Database'] = 'Base de données'; 69 $lang['Deactivate'] = 'Désactiver'; 68 70 $lang['Delete Representant'] = 'Supprimer le représentant'; 69 71 $lang['Delete selected tags'] = 'Supprimer les tags sélectionnés'; … … 138 140 $lang['PhpWebGallery version'] = 'Version de PhpWebGallery'; 139 141 $lang['Picture informations updated'] = 'Informations de l\'image mises à jour'; 142 $lang['Plugins'] = 'Plugins'; 140 143 $lang['Position'] = 'Position'; 141 144 $lang['Preferences'] = 'Préférences'; … … 176 179 $lang['Validate'] = 'Valider'; 177 180 $lang['Validation'] = 'Validation'; 181 $lang['Version'] = 'Version'; 178 182 $lang['Virtual categories movement'] = 'Déplacement de catégories virtuelles'; 179 183 $lang['Virtual categories to move'] = 'Catégories virtuelles à déplacer'; -
trunk/template/yoga/admin/plugins.tpl
r1578 r1580 1 1 <div class="titrePage"> 2 <h2>{lang:Plugins}</h2> 2 <h2> 3 <!-- BEGIN plugin_menu --> 4 <!-- BEGIN menu_item --> 5 <span style="margin-left:2px;"><a href="{plugin_menu.menu_item.URL}">{plugin_menu.menu_item.NAME}</a></span> 6 <!-- END menu_item --> 7 <!-- END plugin_menu --> 8 </h2> 3 9 </div> 4 10 11 5 12 <!-- BEGIN plugins --> 6 <table >7 <thead><tr >13 <table class="table2"> 14 <thead><tr class="throw"> 8 15 <td>{lang:Name}</td> 16 <td>{lang:Version}</td> 9 17 <td>{lang:Description}</td> 10 <td>{lang:Action }</td>18 <td>{lang:Actions}</td> 11 19 </tr></thead> 12 20 <!-- BEGIN plugin --> 13 <tr >21 <tr class="{plugins.plugin.CLASS}"> 14 22 <td>{plugins.plugin.NAME}</td> 23 <td>{plugins.plugin.VERSION}</td> 15 24 <td>{plugins.plugin.DESCRIPTION}</td> 16 25 <td><a href="{plugins.plugin.U_ACTION}">{plugins.plugin.L_ACTION}</a></td>
Note: See TracChangeset
for help on using the changeset viewer.