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

ewallah / moodle-tool_translate / 8371827328

21 Mar 2024 08:25AM UTC coverage: 98.54% (+2.1%) from 96.429%
8371827328

push

github

rdebleu
code review

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

1 existing line in 1 file now uncovered.

405 of 411 relevant lines covered (98.54%)

4.99 hits per line

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

60.0
/classes/plugininfo/translateengine.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
 * Sub plugin info.
19
 *
20
 * @package   tool_translate
21
 * @copyright 2023 iplusacademy
22
 * @author    Renaat Debleu <info@eWallah.net>
23
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 */
25

26
namespace tool_translate\plugininfo;
27

28
use core\plugininfo\base;
29
use moodle_url;
30
use part_of_admin_tree;
31
use admin_settingpage;
32

33
/**
34
 * Sub plugin info.
35
 *
36
 * @package   tool_translate
37
 * @copyright 2023 iplusacademy
38
 * @author    Renaat Debleu <info@eWallah.net>
39
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
40
 */
41
class translateengine extends base {
42

43
    /**
44
     * Allow users to uninstall these plugins.
45
     *
46
     * @return bool
47
     */
48
    public function is_uninstall_allowed() {
49
        return true;
5✔
50
    }
51

52
    /**
53
     * This plugin is enabled.
54
     *
55
     * @return bool
56
     */
57
    public function is_enabled() {
58
        return true;
5✔
59
    }
60

61
    /**
62
     * Get the settings section name.
63
     *
64
     * @return string the settings section name.
65
     */
66
    public function get_settings_section_name() {
67
        return 'translateengine_' . $this->name;
5✔
68
    }
69

70
    /**
71
     * Loads plugin settings to the settings tree.
72
     *
73
     * @param part_of_admin_tree $adminroot
74
     * @param string $parentnodename
75
     * @param bool $hassiteconfig whether the current user has moodle/site:config capability
76
     */
77
    public function load_settings(part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) {
78
        $ADMIN = $adminroot;
5✔
79
        if ($this->is_installed_and_upgraded() && $hassiteconfig && file_exists($this->full_path('settings.php'))) {
5✔
80
            $settings = new admin_settingpage($this->get_settings_section_name(), $this->displayname, 'moodle/site:config');
×
81
            if ($settings) {
×
NEW
82
                include($this->full_path('settings.php'));
×
UNCOV
83
                $ADMIN->add($parentnodename, $settings);
×
84
            }
85
        }
86
    }
87

88
    /**
89
     * Get the url.
90
     *
91
     * @return moodle_url the manage section.
92
     */
93
    public static function get_manage_url() {
94
        return new moodle_url('/admin/settings.php', ['section' => 'translateengines']);
5✔
95
    }
96
}
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