forked from gospelgeek/uplannerconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.php
240 lines (230 loc) · 8.67 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<?php
/**
* @package uPlannerConnect
* @copyright cristian machado mosquera <[email protected]>
* @copyright Daniel Dorado <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
use local_uplannerconnect\plugin_config\plugin_config;
$pluginName = plugin_config::PLUGIN_NAME_LOCAL;
$pluginNameLocal = plugin_config::PLUGIN_NAME;
if ($hassiteconfig) {
$ADMIN->add(
'localplugins',
new admin_category(
'local_uplannerconnect_settings',
new lang_string('pluginname', 'local_uplannerconnect')
)
);
$settings = new admin_settingpage(
'managelocaluplannerconnect',
new lang_string('manage', 'local_uplannerconnect')
);
if ($ADMIN->fulltree) {
$settings->add( new admin_setting_heading(
'generalsettingsheading',
new lang_string('generalsettingsheading', 'local_uplannerconnect'),
new lang_string('generalsettingsheading_desc', 'local_uplannerconnect')
)
);
// uPlanner key
$settings->add(new admin_setting_heading(
$pluginName . '_key',
get_string('key_heading', $pluginName),
'Uplanner key'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/key',
get_string('key', $pluginName),
get_string('key_desc', $pluginName),
'uPlanner key',
PARAM_TEXT
)
);
// uPlanner token
$settings->add(new admin_setting_heading(
$pluginName . '_token',
get_string('token_endpoint_heading', $pluginName),
'uPlanner token url'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/token_endpoint',
get_string('token_endpoint', $pluginName),
get_string('token_endpoint_desc', $pluginName),
'https://univalle-qa-api.u-planner.com/api/auth/signature',
PARAM_URL
)
);
// uPlanner base url
$settings->add(new admin_setting_heading(
$pluginName . '_base_url',
get_string('base_url_heading', $pluginName),
'uPlanner base url (messages)'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/base_url',
get_string('base_url', $pluginName),
get_string('base_url_desc', $pluginName),
'https://u-plannerplus.servicebus.windows.net/topic/messages',
PARAM_URL
)
);
// uPlanner materials
$settings->add(new admin_setting_heading(
$pluginName . '_materials',
get_string('materials_endpoint_heading', $pluginName),
'uPlanner materials'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/materials_endpoint',
get_string('materials_endpoint', $pluginName),
get_string('materials_endpoint_desc', $pluginName),
'univalle/materials',
PARAM_URL
)
);
// uPlanner announcements
$settings->add(new admin_setting_heading(
$pluginName . '_announcements',
get_string('announcements_endpoint_heading', $pluginName),
'uPlanner announcements'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/announcements_endpoint',
get_string('announcements_endpoint', $pluginName),
get_string('announcements_endpoint_desc', $pluginName),
'univalle/announcements',
PARAM_URL
)
);
// uPlanner evaluation_structure
$settings->add(new admin_setting_heading(
$pluginName . '_evaluation_structure',
get_string('evaluation_structure_endpoint_heading', $pluginName),
'uPlanner evaluation structure'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/evaluation_structure_endpoint',
get_string('evaluation_structure_endpoint', $pluginName),
get_string('evaluation_structure_endpoint_desc', $pluginName),
'univalle/evaluationStructure',
PARAM_URL
)
);
// uPlanner grades
$settings->add(new admin_setting_heading(
$pluginName . '_grades',
get_string('grades_endpoint_heading', $pluginName),
'uPlanner grades'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/grades_endpoint',
get_string('grades_endpoint', $pluginName),
get_string('grades_endpoint_desc', $pluginName),
'univalle/grades',
PARAM_URL
)
);
// uPlanner messages host
$settings->add(new admin_setting_heading(
$pluginName . '_messages_host',
get_string('messages_host_heading', $pluginName),
'uPlanner messages host'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/messages_host',
get_string('messages_host', $pluginName),
get_string('messages_host_desc', $pluginName),
'',
PARAM_TEXT
)
);
// uPlanner messages database
$settings->add(new admin_setting_heading(
$pluginName . '_messages_database',
get_string('messages_database_heading', $pluginName),
'uPlanner messages database'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/messages_database',
get_string('messages_database', $pluginName),
get_string('messages_database_desc', $pluginName),
'',
PARAM_TEXT
)
);
// uPlanner messages user
$settings->add(new admin_setting_heading(
$pluginName . '_messages_user',
get_string('messages_user_heading', $pluginName),
'uPlanner messages user'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/messages_user',
get_string('messages_user', $pluginName),
get_string('messages_user_desc', $pluginName),
'',
PARAM_TEXT
)
);
// uPlanner messages password
$settings->add(new admin_setting_heading(
$pluginName . '_messages_password',
get_string('messages_password_heading', $pluginName),
'uPlanner messages password'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/messages_password',
get_string('messages_password', $pluginName),
get_string('messages_password_desc', $pluginName),
'',
PARAM_TEXT
)
);
// uPlanner messages port
$settings->add(new admin_setting_heading(
$pluginName . '_messages_port',
get_string('messages_port_heading', $pluginName),
'uPlanner messages port'
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/messages_port',
get_string('messages_port', $pluginName),
get_string('messages_port_desc', $pluginName),
'',
PARAM_INT
)
);
$settings->add(new admin_setting_configtext(
$pluginName . '/task_runtime_primary',
get_string('task_rutine_primary', $pluginName),
get_string('task_rutine_primary_desc', $pluginName),
5,
PARAM_INT
)
);
}
// Agrega la página de configuración al árbol
$ADMIN->add('localplugins', $settings);
$ADMIN->add('reports',
new admin_category($pluginNameLocal,
new lang_string('pluginname', $pluginName)));
$ADMIN->add($pluginNameLocal,
new admin_externalpage('uplanerIndex', new lang_string('reports', $pluginName),
new moodle_url('/local/'.$pluginNameLocal.'/index.php'), 'moodle/site:configview'
)
);
}