aboutsummaryrefslogtreecommitdiff
path: root/views/default/page_elements/owner_block.php
diff options
context:
space:
mode:
authornickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-21 22:32:59 +0000
committernickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-21 22:32:59 +0000
commit0e88886c7a313deacd23e717a4971d361122b1f4 (patch)
tree77a83ee920dd42db13155e8195b09984a081d048 /views/default/page_elements/owner_block.php
parent33d589650db886fa580aa5bd47672a71bb4fc4c0 (diff)
downloadelgg-0e88886c7a313deacd23e717a4971d361122b1f4.tar.gz
elgg-0e88886c7a313deacd23e717a4971d361122b1f4.tar.bz2
Using a lambda function to sort the profile menu.
git-svn-id: http://code.elgg.org/elgg/trunk@6132 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/page_elements/owner_block.php')
-rw-r--r--views/default/page_elements/owner_block.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/views/default/page_elements/owner_block.php b/views/default/page_elements/owner_block.php
index 7ddc7e55a..158f82ff0 100644
--- a/views/default/page_elements/owner_block.php
+++ b/views/default/page_elements/owner_block.php
@@ -50,6 +50,12 @@ if(is_plugin_enabled('profile')) {
$params = array('owner' => $owner);
$links = trigger_plugin_hook('profile_menu', 'profile', $params, array());
if (is_array($links) && !empty($links)) {
+ // sort the links by name
+ usort($links, create_function(
+ '$a, $b',
+ 'return strnatcasecmp($a[\'text\'], $b[\'text\']);'
+ ));
+
$display .= '<div><ul>';
foreach ($links as $link) {
$display .= "<li><a href=\"{$link['href']}\">{$link['text']}</a></li>";