• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ewallah / moodle-report_growth / 12297838796

12 Dec 2024 01:53PM UTC coverage: 88.288% (-1.6%) from 89.908%
12297838796

push

github

rdebleu
code review

0 of 6 new or added lines in 1 file covered. (0.0%)

294 of 333 relevant lines covered (88.29%)

75.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib.php
1
<?php
2
// This file is part of Moodle - http://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 <http://www.gnu.org/licenses/>.
16

17
/**
18
 * Lib functions
19
 *
20
 * @package   report_growth
21
 * @copyright eWallah (www.eWallah.net)
22
 * @author    Renaat Debleu <info@eWallah.net>
23
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 */
25

26
/**
27
 * This function extends the navigation with the report items
28
 *
29
 * @param navigation_node $navigation The navigation node to extend
30
 * @param stdClass $course The course to object for the report
31
 * @param stdClass $context The context of the course
32
 */
33
function report_growth_extend_navigation_course($navigation, $course, $context) {
34
    if (has_capability('report/growth:viewcourse', $context) && $course->id > 1) {
×
35
        $url = new moodle_url('/report/growth/index.php', ['contextid' => $context->id]);
×
36
        $txt = get_string('growth', 'report_growth');
×
37
        $navigation->add($txt, $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
×
38
    }
39
}
40

41
/**
42
 * Adds nodes to category navigation
43
 *
44
 * @param navigation_node $navigation The navigation node to extend
45
 * @param context $context The context of the coursecategory
46
 * @return void|null return null if we don't want to display the node.
47
 */
48
function report_growth_extend_navigation_category_settings($navigation, $context) {
49
    if (has_capability('report/growth:viewcategory', $context)) {
×
50
        $url = new moodle_url('/report/growth/index.php', ['contextid' => $context->id]);
×
51
        $txt = get_string('growth', 'report_growth');
×
52
        $navigation->add($txt, $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', ''));
×
53
    }
54
}
55

56
/**
57
 * Return a list of page types
58
 * @param string $pagetype current page type
59
 * @param stdClass $parentcontext Block's parent context
60
 * @param stdClass $currentcontext Current context of block
61
 * @return array
62
 */
63
function report_growth_page_type_list($pagetype, $parentcontext, $currentcontext) {
NEW
64
    return [
×
NEW
65
        '*' => get_string('page-x', 'pagetype'),
×
NEW
66
        'report-*' => get_string('page-report-x', 'pagetype'),
×
NEW
67
        'report-growth-*'     => get_string('page-report-growth-x',  'report_growth'),
×
NEW
68
        'report-growth-index' => get_string('page-report-growth-index', 'report_growth'),
×
NEW
69
    ];
×
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc