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

ewallah / moodle-tool_translate / 14305334883

07 Apr 2025 09:11AM UTC coverage: 96.471% (-3.1%) from 99.529%
14305334883

push

github

rdebleu
Merge branch 'main' of github.com:ewallah/moodle-tool_translate

410 of 425 relevant lines covered (96.47%)

6.73 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 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)) {
×
36
        $arr = [
×
37
            'course' => $course->id,
×
38
            'target' => strtolower(current_language()),
×
39
            'source' => strtolower($CFG->lang),
×
40
        ];
×
41
        $url = new \moodle_url('/admin/tool/translate/index.php', $arr);
×
42
        $txt = get_string('translate', 'tool_translate');
×
43
        $navigation->add($txt, $url, navigation_node::NODETYPE_LEAF, null, null, new \pix_icon('i/edit', ''));
×
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