mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-56711-master' of git://github.com/damyon/moodle
This commit is contained in:
commit
6b8c8f4bc2
@ -3632,6 +3632,24 @@ class flat_navigation_node extends navigation_node {
|
||||
return $this->type == navigation_node::TYPE_SECTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* In flat navigation - sections are active if we are looking at activities in the section.
|
||||
* @return boolean
|
||||
*/
|
||||
public function isactive() {
|
||||
global $PAGE;
|
||||
|
||||
if ($this->is_section()) {
|
||||
$active = $PAGE->navigation->find_active_node();
|
||||
while ($active = $active->parent) {
|
||||
if ($active->key == $this->key && $active->type == $this->type) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->isactive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for "showdivider"
|
||||
* @return boolean
|
||||
|
Loading…
x
Reference in New Issue
Block a user