Skip to content

Commit

Permalink
navigation MDL-25364 Fixed up AJAX loading for guest users within a c…
Browse files Browse the repository at this point in the history
…ourse.
  • Loading branch information
Sam Hemelryk committed Nov 22, 2010
1 parent 94dbfb3 commit ca787a9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion lib/ajax/getnavbranch.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}

// Create a navigation object to use, we can't guarantee PAGE will be complete
if (!isloggedin() || isguestuser()) {
if (!isloggedin()) {
$navigation->set_expansion_limit(navigation_node::TYPE_COURSE);
} else {
if (isset($block) && !empty($block->config->expansionlimit)) {
Expand Down
7 changes: 0 additions & 7 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,7 @@ public function get_css_type() {
* @param array $expandable An array by reference to populate with expandable nodes.
*/
public function find_expandable(array &$expandable) {
$isloggedin = (isloggedin() && !isguestuser());
if (!$isloggedin && $this->type > self::TYPE_CATEGORY) {
return;
}
foreach ($this->children as &$child) {
if (!$isloggedin && $child->type > self::TYPE_CATEGORY) {
continue;
}
if ($child->nodetype == self::NODETYPE_BRANCH && $child->children->count()==0 && $child->display) {
$child->id = 'expandable_branch_'.(count($expandable)+1);
$this->add_class('canexpand');
Expand Down

0 comments on commit ca787a9

Please sign in to comment.