aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/start.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-07-06 11:03:28 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-07-06 11:03:28 +0000
commit3850904d467fe0ca6cb8800a75f1b9e233bf8d90 (patch)
tree11468d216df86f5ef042e15c14cf6f5da038c41a /mod/profile/start.php
parent288e06424b4c375c285d8fff34f9eb7f1b251a1e (diff)
downloadelgg-3850904d467fe0ca6cb8800a75f1b9e233bf8d90.tar.gz
elgg-3850904d467fe0ca6cb8800a75f1b9e233bf8d90.tar.bz2
* Closes #1104: Edit profile and edit icon links on pulldown menu for editable users.
* Closes #545: Admins are now able to edit profiles and icons of other users. * CSRF protection added to icon upload and edit code. * Version bump. git-svn-id: https://code.elgg.org/elgg/trunk@3387 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile/start.php')
-rw-r--r--mod/profile/start.php31
1 files changed, 23 insertions, 8 deletions
diff --git a/mod/profile/start.php b/mod/profile/start.php
index 3dd57c450..2b4d08c5d 100644
--- a/mod/profile/start.php
+++ b/mod/profile/start.php
@@ -67,11 +67,7 @@
if (get_context() == "profile")
extend_view('canvas_header/submenu','profile/submenu');
- //add submenu options
- if (get_context() == "profile") {
- add_submenu_item(elgg_echo('profile:editdetails'), $CONFIG->wwwroot . "mod/profile/edit.php");
- add_submenu_item(elgg_echo('profile:editicon'), $CONFIG->wwwroot . "mod/profile/editicon.php");
- }
+
// Extend context menu with admin links
if (isadminloggedin())
@@ -146,7 +142,18 @@
// The username should be the file we're getting
if (isset($page[0])) {
set_input('username',$page[0]);
- }
+ }
+ // Any sub pages?
+ if (isset($page[1])) {
+
+ switch ($page[1])
+ {
+ case 'edit' : include($CONFIG->pluginspath . "profile/edit.php"); break;
+ case 'editicon' : include($CONFIG->pluginspath . "profile/editicon.php"); break;
+
+ }
+ }
+
// Include the standard profile index
include($CONFIG->pluginspath . "profile/index.php");
@@ -165,7 +172,6 @@
if (isset($page[0])) {
switch ($page[0])
{
- case 'edit' :
default: include($CONFIG->pluginspath . "profile/defaultprofile.php");
}
}
@@ -178,10 +184,19 @@
*/
function profile_pagesetup()
{
+ global $CONFIG;
if (get_context() == 'admin' && isadminloggedin()) {
- global $CONFIG;
+
add_submenu_item(elgg_echo('profile:edit:default'), $CONFIG->wwwroot . 'pg/defaultprofile/edit/');
}
+
+ //add submenu options
+ if (get_context() == "profile") {
+ $page_owner = page_owner_entity();
+
+ add_submenu_item(elgg_echo('profile:editdetails'), $CONFIG->wwwroot . "pg/profile/{$page_owner->username}/edit/");
+ add_submenu_item(elgg_echo('profile:editicon'), $CONFIG->wwwroot . "pg/profile/{$page_owner->username}/editicon/");
+ }
}
/**