Permalink
Browse files

Merged MDL-25805 Renamed property and function to be a little more de…

…scriptive
  • Loading branch information...
1 parent 6a48b42 commit 9f6eeb4abfa93526c7275527b4084ce1ad4df933 Sam Hemelryk committed May 3, 2011
Showing with 9 additions and 9 deletions.
  1. +1 −1 course/user.php
  2. +6 −6 lib/navigationlib.php
  3. +1 −1 mod/forum/user.php
  4. +1 −1 user/view.php
View
2 course/user.php
@@ -152,7 +152,7 @@
}
$PAGE->navigation->extend_for_user($user);
-$PAGE->navigation->set_userid_for_parent_nav_hack($user->id); // see MDL-25805 for reasons and for full commit reference for reversal when fixed.
+$PAGE->navigation->set_userid_for_parent_checks($user->id); // see MDL-25805 for reasons and for full commit reference for reversal when fixed.
$PAGE->set_title("$course->shortname: $stractivityreport ($mode)");
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
View
12 lib/navigationlib.php
@@ -830,7 +830,7 @@ class global_navigation extends navigation_node {
/** @var int */
protected $expansionlimit = 0;
/** @var int */
- protected $uglyunsupportedparenthack_userid = 0;
+ protected $useridtouseforparentchecks = 0;
/**
* Constructs a new global navigation
@@ -885,8 +885,8 @@ public function __construct(moodle_page $page) {
*
* @param int $userid userid of profile page that parent wants to navigate around.
*/
- public function set_userid_for_parent_nav_hack($userid) {
- $this->uglyunsupportedparenthack_userid = $userid;
+ public function set_userid_for_parent_checks($userid) {
+ $this->useridtouseforparentchecks = $userid;
}
@@ -1007,10 +1007,10 @@ public function initialise() {
// TODO: very ugly hack - do not force "parents" to enrol into course their child is enrolled in,
// this hack has been propagated from user/view.php to display the navigation node. (MDL-25805)
$isparent = false;
- if ($this->uglyunsupportedparenthack_userid) {
- $currentuser = ($this->uglyunsupportedparenthack_userid == $USER->id);
+ if ($this->useridtouseforparentchecks) {
+ $currentuser = ($this->useridtouseforparentchecks == $USER->id);
if (!$currentuser) {
- $usercontext = get_context_instance(CONTEXT_USER, $this->uglyunsupportedparenthack_userid, MUST_EXIST);
+ $usercontext = get_context_instance(CONTEXT_USER, $this->useridtouseforparentchecks, MUST_EXIST);
if ($DB->record_exists('role_assignments', array('userid'=>$USER->id, 'contextid'=>$usercontext->id))
and has_capability('moodle/user:viewdetails', $usercontext)) {
$isparent = true;
View
2 mod/forum/user.php
@@ -86,7 +86,7 @@
}
$PAGE->navigation->extend_for_user($user);
-$PAGE->navigation->set_userid_for_parent_nav_hack($id); // see MDL-25805 for reasons and for full commit reference for reversal when fixed.
+$PAGE->navigation->set_userid_for_parent_checks($id); // see MDL-25805 for reasons and for full commit reference for reversal when fixed.
$PAGE->set_title("$course->shortname: $fullname: $strmode");
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
View
2 user/view.php
@@ -80,7 +80,7 @@
// please note this is just a guess!
require_login();
$isparent = true;
- $PAGE->navigation->set_userid_for_parent_nav_hack($id);
+ $PAGE->navigation->set_userid_for_parent_checks($id);
} else {
// normal course
require_login($course);

0 comments on commit 9f6eeb4

Please sign in to comment.