Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
CRAP
n/a
0 / 0
local_recertify_extend_navigation_course
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
2
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 * Navigation.
19 *
20 * @package    local_recertify
21 * @copyright  2026 DevLMS <contact@devlms.com>
22 * @license    https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
24
25/**
26 * Add "Recertification" to the course navigation for staff who can see learners' status.
27 *
28 * @param navigation_node $navigation
29 * @param stdClass $course
30 * @param context_course $context
31 */
32function local_recertify_extend_navigation_course(navigation_node $navigation, stdClass $course, context_course $context) {
33    if (has_capability('local/recertify:viewstatus', $context)) {
34        $navigation->add(
35            get_string('pluginname', 'local_recertify'),
36            new moodle_url('/local/recertify/status.php', ['courseid' => $course->id]),
37            navigation_node::TYPE_SETTING,
38            null,
39            'local_recertify',
40            new pix_icon('i/completion-auto-enabled', '')
41        );
42    }
43}