Automatically generated installer lang files
[moodle.git] / admin / tool / brickfield / settings.php
blobeea6d962e183c484de6e9da65ae1c4ede12f7954
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.
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/>.
17 /**
18 * Plugin administration pages are defined here.
20 * @package tool_brickfield
21 * @category admin
22 * @copyright 2020 Brickfield Education Labs, https://www.brickfield.ie - Author: Karen Holland
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 use tool_brickfield\accessibility;
27 use tool_brickfield\manager;
28 use tool_brickfield\analysis;
29 use tool_brickfield\output\renderer;
30 use tool_brickfield\registration;
32 defined('MOODLE_INTERNAL') || die();
34 $accessibilitydisabled = !accessibility::is_accessibility_enabled();
36 if ($hassiteconfig) {
37 // Add an enable subsystem setting to the "Advanced features" settings page.
38 $optionalsubsystems = $ADMIN->locate('optionalsubsystems');
39 $optionalsubsystems->add(new admin_setting_configcheckbox(
40 'enableaccessibilitytools',
41 new lang_string('enableaccessibilitytools', manager::PLUGINNAME),
42 new lang_string('enableaccessibilitytools_desc', manager::PLUGINNAME),
46 ));
49 $moodleurl = accessibility::get_plugin_url();
50 if ($hassiteconfig) {
51 $ADMIN->add(
52 'tools',
53 new admin_category('brickfieldfolder', get_string('accessibility', manager::PLUGINNAME), $accessibilitydisabled)
56 $ADMIN->add(
57 'brickfieldfolder',
58 new admin_externalpage(
59 'tool_brickfield_activation',
60 get_string('activationform', manager::PLUGINNAME),
61 manager::registration_url(),
62 'moodle/site:config'
66 $settings = new admin_settingpage(manager::PLUGINNAME, get_string('settings', manager::PLUGINNAME));
68 $settings->add(new admin_setting_configcheckbox(
69 manager::PLUGINNAME . '/analysistype',
70 get_string('analysistype', manager::PLUGINNAME),
71 get_string('analysistype_desc', manager::PLUGINNAME),
72 analysis::ANALYSISDISABLED,
73 analysis::ANALYSISBYREQUEST,
74 analysis::ANALYSISDISABLED
75 ));
77 $settings->add(new admin_setting_configcheckbox(
78 manager::PLUGINNAME . '/deletehistoricaldata',
79 get_string('deletehistoricaldata', manager::PLUGINNAME),
80 '',
82 ));
84 $settings->add(new admin_setting_configtext(
85 manager::PLUGINNAME . '/batch',
86 get_string('batch', manager::PLUGINNAME),
87 '',
88 1000,
89 PARAM_INT
90 ));
92 $settings->add(new admin_setting_configtext(
93 manager::PLUGINNAME . '/perpage',
94 get_string('perpage', manager::PLUGINNAME),
95 '',
96 50,
97 PARAM_INT));
99 $ADMIN->add('brickfieldfolder', $settings);
101 $ADMIN->add('brickfieldfolder', new admin_externalpage('tool_brickfield_tool',
102 get_string('tools', manager::PLUGINNAME),
103 $moodleurl,
104 accessibility::get_capability_name('viewsystemtools')
108 // Add the reports link if the toolkit is enabled, and is either registered, or the user has the ability to register it.
109 $showreports = has_capability('moodle/site:config', \context_system::instance());
110 $showreports = $showreports || (new registration())->toolkit_is_active();
112 // Create a link to the main page in the reports menu.
113 $ADMIN->add(
114 'reports',
115 new admin_externalpage(
116 'tool_brickfield_reports',
117 get_string('pluginname', manager::PLUGINNAME),
118 $moodleurl,
119 accessibility::get_capability_name('viewsystemtools'),
120 $accessibilitydisabled || !$showreports