mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
navigation MDL-20651 Added config setting to hide course categories on the navigation
As requested and voted on admin can now choose not to include course categories within the navbar and global navigation block. At the same time I also introduced a second setting, showallcourses, which ensures all of the courses a user is registered in are shown on the navigation at all times.
This commit is contained in:
parent
8bdc9cacad
commit
da3ab9c4be
5 changed files with 77 additions and 9 deletions
|
@ -126,6 +126,11 @@ class block_global_navigation_tree extends block_tree {
|
|||
$this->remove_empty_section_branches();
|
||||
}
|
||||
|
||||
// Load the my courses branch if the user has selected to
|
||||
if (!empty($CFG->navhidecategories)) {
|
||||
$this->page->navigation->collapse_course_categories();
|
||||
}
|
||||
|
||||
// Load the my courses branch if the user has selected to
|
||||
if (!empty($this->config->showmycourses) && $this->config->showmycourses=='yes') {
|
||||
$this->showmycourses();
|
||||
|
@ -359,7 +364,7 @@ class block_global_navigation_tree extends block_tree {
|
|||
// Add a branch labelled something like My Courses
|
||||
$mycoursesbranch = $PAGE->navigation->add(get_string('mycourses'), null,navigation_node::TYPE_CATEGORY, null, 'mycourses');
|
||||
$PAGE->navigation->add_courses($courses, $mycoursesbranch);
|
||||
|
||||
$PAGE->navigation->get($mycoursesbranch)->type = navigation_node::TYPE_SETTING;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue