Changeset 329
- Timestamp:
- 05/09/06 06:41:36 (3 years ago)
- Files:
-
- devel/mod/profile/lib.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/mod/profile/lib.php
r325 r329 6 6 global $PAGE; 7 7 global $CFG; 8 global $page_owner;9 8 10 $page_owner = $profile_id; 9 // don't clobber $page_owner, use a 10 // local $pgowner instead for clarity 11 $pgowner = $profile_id; 11 12 12 13 if (isloggedin()) { 13 if (context === "profile" && $p age_owner == $_SESSION['userid']) {14 if (context === "profile" && $pgowner == $_SESSION['userid']) { 14 15 $PAGE->menu[] = array( 'name' => 'profile:me', 15 16 'html' => '<li><a href="'.$CFG->wwwroot.$_SESSION['username'].'" class="selected">'.gettext("Your Profile").'</a></li>'); … … 18 19 'html' => '<li><a href="'.$CFG->wwwroot.$_SESSION['username'].'">'.gettext("Your Profile").'</a></li>'); 19 20 } 21 22 if (profile_permissions_check("profile") && context === "profile") { 23 24 $PAGE->menu_sub[] = array( 'name' => 'profile:edit', 25 'html' => '<a href="'.$CFG->wwwroot.'profile/edit.php?profile_id='.$pgowner.'">' 26 . gettext("Edit this profile") . '</a>'); 27 28 if (run("users:type:get", $pgowner) == "person") { 29 $PAGE->menu_sub[] = array( 'name' => 'profile:picedit', 30 'html' => '<a href="'.$CFG->wwwroot.'_icons/?context=profile&profile_id='.$pgowner.'">' 31 . gettext("Change site picture") . '</a>'); 32 } 33 $PAGE->menu_sub[] = array( 'name' => 'profile:help', 34 'html' => '<a href="'.$CFG->wwwroot.'help/profile_help.php">' 35 . gettext("Page help") . '</a>'); 36 } 20 37 } 21 22 // if (profile_permissions_check("profile") && context === "profile") {23 if (run("permissions:check", "profile") && context === "profile") {24 25 $PAGE->menu_sub[] = array( 'name' => 'profile:edit',26 'html' => '<a href="'.$CFG->wwwroot.'profile/edit.php?profile_id='.$page_owner.'">'27 . gettext("Edit this profile") . '</a>');28 29 if (run("users:type:get", $page_owner) == "person") {30 $PAGE->menu_sub[] = array( 'name' => 'profile:picedit',31 'html' => '<a href="'.$CFG->wwwroot.'_icons/?context=profile&profile_id='.$page_owner.'">'32 . gettext("Change site picture") . '</a>');33 }34 $PAGE->menu_sub[] = array( 'name' => 'profile:help',35 'html' => '<a href="'.$CFG->wwwroot.'help/profile_help.php">'36 . gettext("Page help") . '</a>');37 38 }39 40 38 } 41 39
