• 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
/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 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
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 iplusacademy (www.iplusacademy.org)
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
     * Allow users to uninstall these plugins.
44
     *
45
     * @return bool
46
     */
47
    public function is_uninstall_allowed() {
48
        return true;
8✔
49
    }
50

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

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

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

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