forked from moodle-an-hochschulen/moodle-local_sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
99 lines (82 loc) · 4.42 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Local plugin "sandbox" - Settings
*
* @package local_sandbox
* @copyright 2013 Alexander Bias, Ulm University <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once(dirname(__FILE__) . '/lib.php');
if ($hassiteconfig) {
// New settings page.
$page = new admin_settingpage('sandbox', get_string('pluginname', 'local_sandbox', null, true));
if ($ADMIN->fulltree) {
// Execution time.
$page->add(new admin_setting_heading('local_sandbox/cronruntimeheading',
get_string('cronruntimeheading', 'local_sandbox', null, true),
''));
$html = html_writer::tag('p', get_string('cronruntimescheduledtasksmanagement', 'local_sandbox', null, true));
$html .= html_writer::tag('p', get_string('cronruntimescheduledtasksactivate', 'local_sandbox', null, true));
$html .= html_writer::tag('p', get_string('cronruntimescheduledtasksstandardtime', 'local_sandbox', null, true));
$html .= html_writer::start_tag('p');
$html .= html_writer::link(
new moodle_url('/admin/tool/task/scheduledtasks.php'), get_string('scheduledtasks', 'tool_task', null, true));
$html .= html_writer::end_tag('p');
$page->add(new admin_setting_heading('local_sandbox/cronruntimehint', '', $html));
// Course backups.
$page->add(new admin_setting_heading('local_sandbox/coursebackupsheading',
get_string('coursebackupsheading', 'local_sandbox', null, true),
''));
// Create course backup files directory widget.
$page->add(new admin_setting_configdirectory('local_sandbox/coursebackupsdirectory',
get_string('coursebackupsdirectory', 'local_sandbox', null, true),
get_string('coursebackupsdirectory_desc', 'local_sandbox', null, true),
$CFG->dataroot.'/sandbox'));
// Create change course start date control widget.
$page->add(new admin_setting_configcheckbox('local_sandbox/adjustcoursestartdate',
get_string('adjustcoursestartdate', 'local_sandbox', null, true),
get_string('adjustcoursestartdate_desc', 'local_sandbox', null, true),
0));
// Keep Course ID -> restore to same course!
$page->add(new admin_setting_configcheckbox('local_sandbox/keep_course_id',
get_string('keepcourseid', 'local_sandbox', null, true),
get_string('keepcourseid_desc', 'local_sandbox', null, true),
1));
// Notifications.
$page->add(new admin_setting_heading('local_sandbox/notifyheading',
get_string('notifyheading', 'local_sandbox', null, true),
''));
// Create user notification chooser widget.
$page->add(new admin_setting_users_with_capability('local_sandbox/notifyonerrors',
get_string('notifyonerrors', 'local_sandbox', null, true),
get_string('notifyonerrors_desc', 'local_sandbox', null, true),
array(),
'moodle/site:config'));
// Create user notification level widget.
$levels[SANDBOX_LEVEL_NOTICE] = get_string('notice', 'core');
$levels[SANDBOX_LEVEL_WARNING] = get_string('warning', 'core');
$levels[SANDBOX_LEVEL_ERROR] = get_string('error', 'core');
$page->add(new admin_setting_configselect('local_sandbox/notifylevel',
get_string('notifylevel', 'local_sandbox', null, true),
get_string('notifylevel_desc', 'local_sandbox', null, true),
SANDBOX_LEVEL_ERROR,
$levels));
}
// Add settings page to navigation tree.
$ADMIN->add('courses', $page);
}