aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-01 22:06:36 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-01 22:06:36 +0000
commita1332ae971af685ceb2ca12610c69e92e81bfeff (patch)
tree5210568d52c88730744d54d1ca4ebbf46ac3ef39 /engine/lib/users.php
parent8ad9fcab2b94f8171bde863fc4c6cb3923717955 (diff)
downloadelgg-a1332ae971af685ceb2ca12610c69e92e81bfeff.tar.gz
elgg-a1332ae971af685ceb2ca12610c69e92e81bfeff.tar.bz2
Fixes #3010 moved topbar menu registration to page setup so that the url override is registered
git-svn-id: http://code.elgg.org/elgg/trunk@8544 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php59
1 files changed, 30 insertions, 29 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 1b9a6128b..99466bf73 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1484,30 +1484,8 @@ function users_pagesetup() {
);
elgg_register_menu_item('page', $params);
}
-}
-
-/**
- * Users initialisation function, which establishes the page handler
- *
- * @return void
- */
-function users_init() {
- global $CONFIG;
-
- elgg_register_page_handler('friends', 'friends_page_handler');
- elgg_register_page_handler('friendsof', 'friends_of_page_handler');
- elgg_register_page_handler('dashboard', 'dashboard_page_handler');
- elgg_register_page_handler('register', 'registration_page_handler');
- elgg_register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler');
- elgg_register_page_handler('login', 'elgg_user_login_page_handler');
- elgg_register_page_handler('members', 'elgg_members_page_handler');
- elgg_register_page_handler('avatar', 'elgg_avatar_page_handler');
- elgg_register_page_handler('profile', 'elgg_profile_page_handler');
- elgg_register_page_handler('collections', 'collections_page_handler');
-
- $item = new ElggMenuItem('members', elgg_echo('members'), 'pg/members');
- elgg_register_menu_item('site', $item);
+ // topbar
$user = elgg_get_logged_in_user_entity();
if ($user) {
elgg_register_menu_item('page', array(
@@ -1516,21 +1494,21 @@ function users_init() {
'text' => elgg_echo('avatar:edit'),
'contexts' => array('profile_edit'),
));
-
+
elgg_register_menu_item('page', array(
'name' => 'edit_profile',
'href' => "pg/profile/{$user->username}/edit",
'text' => elgg_echo('profile:edit'),
'contexts' => array('profile_edit'),
));
-
+
elgg_register_menu_item('topbar', array(
'name' => 'profile',
'href' => $user->getURL(),
'text' => "<img src=\"{$user->getIconURL('topbar')}\" alt=\"$user->name\" />",
'weight' => 100,
));
-
+
elgg_register_menu_item('topbar', array(
'name' => 'friends',
'href' => "pg/friends/{$user->username}",
@@ -1538,7 +1516,7 @@ function users_init() {
'title' => elgg_echo('friends'),
'weight' => 300,
));
-
+
elgg_register_menu_item('topbar', array(
'name' => 'usersettings',
'href' => "pg/settings/user/{$user->username}",
@@ -1546,7 +1524,7 @@ function users_init() {
'weight' => 500,
'section' => 'alt',
));
-
+
elgg_register_menu_item('topbar', array(
'name' => 'logout',
'href' => "action/logout",
@@ -1555,8 +1533,31 @@ function users_init() {
'weight' => 1000,
'section' => 'alt',
));
-
+
}
+}
+
+/**
+ * Users initialisation function, which establishes the page handler
+ *
+ * @return void
+ */
+function users_init() {
+ global $CONFIG;
+
+ elgg_register_page_handler('friends', 'friends_page_handler');
+ elgg_register_page_handler('friendsof', 'friends_of_page_handler');
+ elgg_register_page_handler('dashboard', 'dashboard_page_handler');
+ elgg_register_page_handler('register', 'registration_page_handler');
+ elgg_register_page_handler('resetpassword', 'elgg_user_resetpassword_page_handler');
+ elgg_register_page_handler('login', 'elgg_user_login_page_handler');
+ elgg_register_page_handler('members', 'elgg_members_page_handler');
+ elgg_register_page_handler('avatar', 'elgg_avatar_page_handler');
+ elgg_register_page_handler('profile', 'elgg_profile_page_handler');
+ elgg_register_page_handler('collections', 'collections_page_handler');
+
+ $item = new ElggMenuItem('members', elgg_echo('members'), 'pg/members');
+ elgg_register_menu_item('site', $item);
elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'elgg_user_hover_menu');