diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-10-19 02:05:21 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-10-19 02:05:21 +0000 |
commit | ef11d5281c75a99bd3683b78f0af6d00aa3b0ac8 (patch) | |
tree | 993a2339526ce63685a070506f8e1fa579cbc04d | |
parent | d36782289cb18ad2aef1d831ac8f96ac2bfe948a (diff) |
merge r 2143 from branch-1_7 to trunk
feature 765: Sort alphabetically the admin plugin menus and plugin list
git-svn-id: http://piwigo.org/svn/trunk@2144 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | admin.php | 13 | ||||
-rw-r--r-- | admin/plugins.php | 1 |
2 files changed, 11 insertions, 3 deletions
@@ -115,14 +115,21 @@ if ($conf['ws_access_control']) // Do we need to display ws_checker } //---------------------------------------------------------------- plugin menus -$plugin_menu_links = array( +$plugin_menu_links = trigger_event('get_admin_plugin_menu_links', array() ); + +function UC_name_compare($a, $b) +{ + return strcmp(strtolower($a['NAME']), strtolower($b['NAME'])); +} +usort($plugin_menu_links, 'UC_name_compare'); + +array_unshift($plugin_menu_links, array( 'NAME' => l10n('admin'), 'URL' => $link_start.'plugins' ) ); -$plugin_menu_links = trigger_event('get_admin_plugin_menu_links', - $plugin_menu_links ); + foreach ($plugin_menu_links as $menu_item) { $template->assign_block_vars('plugin_menu.menu_item', $menu_item); diff --git a/admin/plugins.php b/admin/plugins.php index f68b98839..6c88a3b68 100644 --- a/admin/plugins.php +++ b/admin/plugins.php @@ -164,6 +164,7 @@ DELETE FROM '.PLUGINS_TABLE.' WHERE id="'.$plugin_id.'"'; // | start template output | // +-----------------------------------------------------------------------+ $fs_plugins = get_fs_plugins(); +uasort($fs_plugins, 'name_compare'); $db_plugins = get_db_plugins(); $db_plugins_by_id=array(); foreach ($db_plugins as $db_plugin) |