aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-04 17:08:31 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-04 17:08:31 +0000
commitd3efed2f847ced2ecfaa536856f6a0acc4cddbfc (patch)
tree101e69848d61e532d0514573394eba30409da737 /engine/lib
parent55f2853ec8b29dd8ca557c0dd82cd0de50946ec0 (diff)
downloadelgg-d3efed2f847ced2ecfaa536856f6a0acc4cddbfc.tar.gz
elgg-d3efed2f847ced2ecfaa536856f6a0acc4cddbfc.tar.bz2
User settings
git-svn-id: https://code.elgg.org/elgg/trunk@1689 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/users.php28
-rw-r--r--engine/lib/usersettings.php21
2 files changed, 35 insertions, 14 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
diff --git a/engine/lib/usersettings.php b/engine/lib/usersettings.php
index 487ea9230..433d41fb7 100644
--- a/engine/lib/usersettings.php
+++ b/engine/lib/usersettings.php
@@ -32,20 +32,29 @@
{
return extend_view($view, $new_settings_view, $priority);
}
-
+
+ function usersettings_pagesetup() {
+
+ // Get config
+ global $CONFIG;
+
+ // Menu options
+ if (get_context() == "settings") {
+ add_submenu_item(elgg_echo('usersettings:user:opt:linktext'),$CONFIG->wwwroot . "pg/settings/user?username=" . $_SESSION['user']->username);
+ add_submenu_item(elgg_echo('profile:editicon'), $CONFIG->wwwroot . 'mod/profile/editicon.php');
+ add_submenu_item(elgg_echo('usersettings:statistics:opt:linktext'),$CONFIG->wwwroot . "pg/settings/statistics?username=" . $_SESSION['user']->username);
+ }
+ }
+
/**
* Initialise the admin page.
*/
function usersettings_init()
{
- // Add plugin main menu option (last)
- extend_elgg_settings_page('usersettings/main_opt/statistics', 'usersettings/main');
- extend_elgg_settings_page('usersettings/main_opt/user', 'usersettings/main');
- extend_elgg_settings_page('usersettings/main_opt/plugins', 'usersettings/main', 999); // Always last
}
/// Register init function
- register_elgg_event_handler('init','system','usersettings_init');
+ register_elgg_event_handler('pagesetup','system','usersettings_pagesetup');
?> \ No newline at end of file