forked from learningworks/moodle-block_lw_courses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.php
121 lines (104 loc) · 5.95 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?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/>.
/**
* lw_courses block settings
*
* @package block_lw_courses
* @copyright 2012 Adam Olley <[email protected]>
* @copyright 2017 Mathew May <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
$name = 'block_lw_courses/defaultmaxcourses';
$title = new lang_string('defaultmaxcourses', 'block_lw_courses');
$description = new lang_string('defaultmaxcoursesdesc', 'block_lw_courses');
$setting = new admin_setting_configtext($name, $title, $description, 10, PARAM_INT);
$settings->add($setting);
$name = 'block_lw_courses/forcedefaultmaxcourses';
$title = new lang_string('forcedefaultmaxcourses', 'block_lw_courses');
$description = new lang_string('forcedefaultmaxcoursesdesc', 'block_lw_courses');
$setting = new admin_setting_configcheckbox($name, $title, $description, 1, PARAM_INT);
$settings->add($setting);
$name = 'block_lw_courses/showchildren';
$title = new lang_string('showchildren', 'block_lw_courses');
$description = new lang_string('showchildrendesc', 'block_lw_courses');
$setting = new admin_setting_configcheckbox($name, $title, $description, 1, PARAM_INT);
$settings->add($setting);
$name = 'block_lw_courses/showwelcomearea';
$title = new lang_string('showwelcomearea', 'block_lw_courses');
$description = new lang_string('showwelcomeareadesc', 'block_lw_courses');
$setting = new admin_setting_configcheckbox($name, $title, $description, 1, PARAM_INT);
$settings->add($setting);
$showcategories = array(
BLOCKS_LW_COURSES_SHOWCATEGORIES_NONE => new lang_string('none', 'block_lw_courses'),
BLOCKS_LW_COURSES_SHOWCATEGORIES_ONLY_PARENT_NAME => new lang_string('onlyparentname', 'block_lw_courses'),
BLOCKS_LW_COURSES_SHOWCATEGORIES_FULL_PATH => new lang_string('fullpath', 'block_lw_courses')
);
$name = 'block_lw_courses/showcategories';
$title = new lang_string('showcategories', 'block_lw_courses');
$description = new lang_string('showcategoriesdesc', 'block_lw_courses');
$setting = new admin_setting_configselect($name, $title, $description, BLOCKS_LW_COURSES_SHOWCATEGORIES_NONE, $showcategories);
$settings->add($setting);
$name = 'block_lw_courses/customsettings';
$title = new lang_string('customsettings', 'block_lw_courses');
$description = new lang_string('customsettings_desc', 'block_lw_courses');
$setting = new admin_setting_heading($name, $title, $description);
$settings->add($setting);
$name = 'block_lw_courses/courseimagedefault';
$title = new lang_string('courseimagedefault', 'block_lw_courses');
$description = new lang_string('courseimagedefault_desc', 'block_lw_courses');
$setting = new admin_setting_configstoredfile($name, $title, $description, 'courseimagedefault');
$settings->add($setting);
$name = 'block_lw_courses/lw_courses_bgimage';
$title = new lang_string('lw_courses_bgimage', 'block_lw_courses');
$description = new lang_string('lw_courses_bgimage_desc', 'block_lw_courses');
$setting = new admin_setting_configcheckbox($name, $title, $description, BLOCKS_LW_COURSES_IMAGEASBACKGROUND_FALSE);
$settings->add($setting);
$settings->add(new admin_setting_configtext('block_lw_courses/summary_limit',
get_string('summary_limit', 'block_lw_courses'),
get_string('summary_limit_desc', 'block_lw_courses'), 150, PARAM_INT));
$name = 'block_lw_courses/showteachers';
$title = new lang_string('showteachers', 'block_lw_courses');
$description = new lang_string('showteachers_desc', 'block_lw_courses');
$setting = new admin_setting_configcheckbox($name, $title, $description, BLOCKS_LW_COURSES_SHOWTEACHERS_NO);
$settings->add($setting);
$name = 'block_lw_courses/progressenabled';
$title = new lang_string('progressenabled', 'block_lw_courses');
$description = new lang_string('progressenabled_desc', 'block_lw_courses');
$setting = new admin_setting_configcheckbox($name, $title, $description, BLOCKS_LW_COURSES_SHOWGRADES_NO);
$settings->add($setting);
$name = 'block_lw_courses/startgrid';
$title = new lang_string('startgrid', 'block_lw_courses');
$description = new lang_string('startgrid_desc', 'block_lw_courses');
$setting = new admin_setting_configcheckbox($name, $title, $description, BLOCKS_LW_COURSES_STARTGRID_NO);
$settings->add($setting);
$name = 'block_lw_courses/coursegridwidth';
$title = new lang_string('coursegridwidth', 'block_lw_courses');
$description = new lang_string('coursegridwidthdesc', 'block_lw_courses');
$setting = new admin_setting_configselect($name, $title, $description, 4, array(
'12' => new lang_string('fullwidth', 'block_lw_courses'),
'6' => new lang_string('splitwidth', 'block_lw_courses'),
'4' => new lang_string('thirdwidth', 'block_lw_courses'),
'3' => new lang_string('quarterwidth', 'block_lw_courses')
));
$settings->add($setting);
$name = 'block_lw_courses/displaybutton';
$title = new lang_string('displaybutton', 'block_lw_courses');
$description = new lang_string('displaybutton_desc', 'block_lw_courses');
$setting = new admin_setting_configcheckbox($name, $title, $description, 0);
$settings->add($setting);
}