From 0e88886c7a313deacd23e717a4971d361122b1f4 Mon Sep 17 00:00:00 2001 From: nickw Date: Fri, 21 May 2010 22:32:59 +0000 Subject: Using a lambda function to sort the profile menu. git-svn-id: http://code.elgg.org/elgg/trunk@6132 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/page_elements/owner_block.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'views/default/page_elements') 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 .= '