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

ewallah / moodle-tool_translate / 14515489675

17 Apr 2025 12:20PM UTC coverage: 99.529%. Remained the same
14515489675

push

github

rdebleu
CoversClass

423 of 425 relevant lines covered (99.53%)

4.73 hits per line

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

100.0
/lib.php
1
<?php
2
// This file is part of the tool_translate plugin for 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
 * Library.
19
 *
20
 * @package   tool_translate
21
 * @copyright iplusacademy (www.iplusacademy.org)
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 tool items
28
 *
29
 * @param navigation_node $navigation The navigation node to extend
30
 * @param stdClass $course The course to object for the tool
31
 * @param stdClass $context The context of the course
32
 */
33
function tool_translate_extend_navigation_course($navigation, $course, $context) {
34
    global $CFG;
35
    if (has_capability('tool/translate:translate', $context)) {
2✔
36
        $arr = [
2✔
37
            'course' => $course->id,
2✔
38
            'target' => strtolower(current_language()),
2✔
39
            'source' => strtolower($CFG->lang),
2✔
40
        ];
2✔
41
        $url = new \moodle_url('/admin/tool/translate/index.php', $arr);
2✔
42
        $txt = get_string('translate', 'tool_translate');
2✔
43
        $navigation->add($txt, $url, navigation_node::NODETYPE_LEAF, null, null, new \pix_icon('i/edit', ''));
2✔
44
    }
45
}
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

© 2025 Coveralls, Inc