aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 70879f9c0..ec247337a 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1113,19 +1113,15 @@
}
/**
- * Users initialisation function, which establishes the page handler
+ * Sets up user-related menu items
*
*/
- function users_init() {
+ function users_pagesetup() {
// Load config
global $CONFIG;
-
- // Set up menu for logged in users
- if (isloggedin())
- add_menu(elgg_echo('friends'), $CONFIG->wwwroot . "pg/friends/" . $_SESSION['user']->username);
-
- //add submenu options
+
+ //add submenu options
if (get_context() == "friends" ||
get_context() == "friendsof" ||
get_context() == "collections") {
@@ -1133,6 +1129,21 @@
add_submenu_item(elgg_echo('friends:of'),$CONFIG->wwwroot."pg/friendsof/" . page_owner_entity()->username);
}
+ }
+
+ /**
+ * Users initialisation function, which establishes the page handler
+ *
+ */
+ function users_init() {
+
+ // Load config
+ global $CONFIG;
+
+ // Set up menu for logged in users
+ if (isloggedin())
+ add_menu(elgg_echo('friends'), $CONFIG->wwwroot . "pg/friends/" . $_SESSION['user']->username);
+
register_page_handler('friends','friends_page_handler');
register_page_handler('friendsof','friends_of_page_handler');
register_page_handler('collections','collections_page_handler');
@@ -1210,5 +1221,6 @@
//register actions *************************************************************
register_elgg_event_handler('init','system','users_init',0);
+ register_elgg_event_handler('pagesetup','system','users_pagesetup',0);
?> \ No newline at end of file