mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch '48070-29' of git://github.com/samhemelryk/moodle
This commit is contained in:
commit
b4dd8e28cd
@ -3088,12 +3088,14 @@ class navbar extends navigation_node {
|
|||||||
} else if ($this->hasitems !== false) {
|
} else if ($this->hasitems !== false) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$this->page->navigation->initialise($this->page);
|
if (count($this->children) > 0 || count($this->prependchildren) > 0) {
|
||||||
|
// There have been manually added items - there are definitely items.
|
||||||
$activenodefound = ($this->page->navigation->contains_active_node() ||
|
$outcome = true;
|
||||||
$this->page->settingsnav->contains_active_node());
|
} else if (!$this->ignoreactive) {
|
||||||
|
// We will need to initialise the navigation structure to check if there are active items.
|
||||||
$outcome = (count($this->children) > 0 || count($this->prependchildren) || (!$this->ignoreactive && $activenodefound));
|
$this->page->navigation->initialise($this->page);
|
||||||
|
$outcome = ($this->page->navigation->contains_active_node() || $this->page->settingsnav->contains_active_node());
|
||||||
|
}
|
||||||
$this->hasitems = $outcome;
|
$this->hasitems = $outcome;
|
||||||
return $outcome;
|
return $outcome;
|
||||||
}
|
}
|
||||||
@ -3148,11 +3150,10 @@ class navbar extends navigation_node {
|
|||||||
$items = array_reverse($this->children);
|
$items = array_reverse($this->children);
|
||||||
}
|
}
|
||||||
|
|
||||||
$navigationactivenode = $this->page->navigation->find_active_node();
|
|
||||||
$settingsactivenode = $this->page->settingsnav->find_active_node();
|
|
||||||
|
|
||||||
// Check if navigation contains the active node
|
// Check if navigation contains the active node
|
||||||
if (!$this->ignoreactive) {
|
if (!$this->ignoreactive) {
|
||||||
|
$navigationactivenode = $this->page->navigation->find_active_node();
|
||||||
|
$settingsactivenode = $this->page->settingsnav->find_active_node();
|
||||||
|
|
||||||
if ($navigationactivenode && $settingsactivenode) {
|
if ($navigationactivenode && $settingsactivenode) {
|
||||||
// Parse a combined navigation tree
|
// Parse a combined navigation tree
|
||||||
|
@ -93,6 +93,10 @@ foreach($authsequence as $authname) {
|
|||||||
/// Define variables used in page
|
/// Define variables used in page
|
||||||
$site = get_site();
|
$site = get_site();
|
||||||
|
|
||||||
|
// Ignore any active pages in the navigation/settings.
|
||||||
|
// We do this because there won't be an active page there, and by ignoring the active pages the
|
||||||
|
// navigation and settings won't be initialised unless something else needs them.
|
||||||
|
$PAGE->navbar->ignore_active();
|
||||||
$loginsite = get_string("loginsite");
|
$loginsite = get_string("loginsite");
|
||||||
$PAGE->navbar->add($loginsite);
|
$PAGE->navbar->add($loginsite);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user