Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
CRAP | n/a |
0 / 0 |
|
tool_driprelease_extend_navigation_course | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | // This file is part of Moodle - https://moodle.org/ |
3 | // |
4 | // Moodle is free software: you can redistribute it and/or modify |
5 | // it under the terms of the GNU General Public License as published by |
6 | // the Free Software Foundation, either version 3 of the License, or |
7 | // (at your option) any later version. |
8 | // |
9 | // Moodle is distributed in the hope that it will be useful, |
10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | // GNU General Public License for more details. |
13 | // |
14 | // You should have received a copy of the GNU General Public License |
15 | // along with Moodle. If not, see <https://www.gnu.org/licenses/>. |
16 | |
17 | /** |
18 | * Library of interface functions and constants. |
19 | * |
20 | * @package tool_driprelease |
21 | * @copyright 2022 Marcus Green |
22 | * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
23 | */ |
24 | use core_availability\tree; |
25 | use tool_driprelease\lib; |
26 | /** |
27 | * A core callback to make ther plugin appear in the "more" dropdown of courses |
28 | * |
29 | * @param navigation_node $navigation |
30 | * @param stdClass $course |
31 | * @param context_course $context |
32 | * @return void |
33 | */ |
34 | function tool_driprelease_extend_navigation_course(navigation_node $navigation, stdClass $course, context_course $context) { |
35 | if (has_capability('moodle/course:update', $context)) { |
36 | $url = new moodle_url('/admin/tool/driprelease/view.php', ['courseid' => $course->id]); |
37 | $name = get_string('pluginname', 'tool_driprelease'); |
38 | $navigation->add($name, $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('icon', 'Driprelease', |
39 | 'tool_driprelease')); |
40 | } |
41 | } |