navigation MDL-22973 AJAX expansion of a course now includes enrolled users in participants branch

This commit is contained in:
Sam Hemelryk 2010-07-28 05:34:09 +00:00
parent 708c2e041a
commit 588a3953ae

View file

@ -1959,7 +1959,7 @@ class global_navigation_for_ajax extends global_navigation {
* @return array The expandable nodes * @return array The expandable nodes
*/ */
public function initialise($branchtype, $id) { public function initialise($branchtype, $id) {
global $CFG, $DB, $PAGE, $SITE; global $CFG, $DB, $PAGE, $SITE, $USER;
if ($this->initialised || during_initial_install()) { if ($this->initialised || during_initial_install()) {
return $this->expandable; return $this->expandable;
@ -2033,6 +2033,11 @@ class global_navigation_for_ajax extends global_navigation {
throw new Exception('Unknown type'); throw new Exception('Unknown type');
return $this->expandable; return $this->expandable;
} }
if ($this->page->context->contextlevel == CONTEXT_COURSE && $this->page->context->instanceid != SITEID) {
$this->load_for_user(null, true);
}
$this->find_expandable($this->expandable); $this->find_expandable($this->expandable);
return $this->expandable; return $this->expandable;
} }