Skip to content

Commit

Permalink
example showing the addition of a secondary nav node
Browse files Browse the repository at this point in the history
  • Loading branch information
snake committed Dec 7, 2023
1 parent 769c670 commit 4a998f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/classes/navigation/views/secondary.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ protected function get_default_course_mapping(): array {
'coursebadges' => 7.1,
'newbadge' => 7.2,
'filtermanagement' => 9,
'unenrolself' => 10,
'coursetags' => 11,
'download' => 12,
'contextlocking' => 13,
'unenrolself' => 11,
'coursetags' => 12,
'download' => 13,
'contextlocking' => 14,
],
];
$nodes['navigation'] = [
Expand All @@ -89,7 +89,8 @@ protected function get_default_course_mapping(): array {
'grades' => 2,
'badgesview' => 7,
'competencies' => 8,
'communication' => 14,
'communication' => 15,
'lticoursetools' => 10
],
self::TYPE_CUSTOM => [
'contentbank' => 5,
Expand Down
7 changes: 7 additions & 0 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2966,6 +2966,13 @@ public function add_course_essentials($coursenode, stdClass $course) {
new pix_icon('i/badge', get_string('coursebadges', 'badges')));
}

// LTI External tools.
$url = new moodle_url('/ltix/coursetools.php', ['id' => $course->id]);
$coursenode->add(get_string('courseexternaltools', 'ltix'), $url,
navigation_node::TYPE_SETTING, null, 'lticoursetools',
new pix_icon('i/settings', ''));


// Check access to the course and competencies page.
if ($navoptions->competencies) {
// Just a link to course competency.
Expand Down

0 comments on commit 4a998f5

Please sign in to comment.