4 * Please note that is file is always loaded last - it means that you can inject entries into other categories too.
8 require_once("$CFG->libdir/pluginlib.php");
9 $allplugins = plugin_manager
::instance()->get_plugins();
11 $ADMIN->add('modules', new admin_page_pluginsoverview());
14 $ADMIN->add('modules', new admin_category('modsettings', new lang_string('activitymodules')));
15 $ADMIN->add('modsettings', new admin_page_managemods());
16 foreach ($allplugins['mod'] as $module) {
17 $module->load_settings($ADMIN, 'modsettings', $hassiteconfig);
21 $ADMIN->add('modules', new admin_category('formatsettings', new lang_string('courseformats')));
22 $temp = new admin_settingpage('manageformats', new lang_string('manageformats', 'core_admin'));
23 $temp->add(new admin_setting_manageformats());
24 $ADMIN->add('formatsettings', $temp);
25 foreach ($allplugins['format'] as $format) {
26 $format->load_settings($ADMIN, 'formatsettings', $hassiteconfig);
30 $ADMIN->add('modules', new admin_category('blocksettings', new lang_string('blocks')));
31 $ADMIN->add('blocksettings', new admin_page_manageblocks());
32 foreach ($allplugins['block'] as $block) {
33 $block->load_settings($ADMIN, 'blocksettings', $hassiteconfig);
37 $ADMIN->add('modules', new admin_category('messageoutputs', new lang_string('messageoutputs', 'message')));
38 $ADMIN->add('messageoutputs', new admin_page_managemessageoutputs());
39 $ADMIN->add('messageoutputs', new admin_page_defaultmessageoutputs());
40 foreach ($allplugins['message'] as $processor) {
41 $processor->load_settings($ADMIN, 'messageoutputs', $hassiteconfig);
44 // authentication plugins
45 $ADMIN->add('modules', new admin_category('authsettings', new lang_string('authentication', 'admin')));
47 $temp = new admin_settingpage('manageauths', new lang_string('authsettings', 'admin'));
48 $temp->add(new admin_setting_manageauths());
49 $temp->add(new admin_setting_heading('manageauthscommonheading', new lang_string('commonsettings', 'admin'), ''));
50 $temp->add(new admin_setting_special_registerauth());
51 $temp->add(new admin_setting_configcheckbox('authpreventaccountcreation', new lang_string('authpreventaccountcreation', 'admin'), new lang_string('authpreventaccountcreation_help', 'admin'), 0));
52 $temp->add(new admin_setting_configcheckbox('loginpageautofocus', new lang_string('loginpageautofocus', 'admin'), new lang_string('loginpageautofocus_help', 'admin'), 0));
53 $temp->add(new admin_setting_configselect('guestloginbutton', new lang_string('guestloginbutton', 'auth'),
54 new lang_string('showguestlogin', 'auth'), '1', array('0'=>new lang_string('hide'), '1'=>new lang_string('show'))));
55 $temp->add(new admin_setting_configtext('alternateloginurl', new lang_string('alternateloginurl', 'auth'),
56 new lang_string('alternatelogin', 'auth', htmlspecialchars(get_login_url())), ''));
57 $temp->add(new admin_setting_configtext('forgottenpasswordurl', new lang_string('forgottenpasswordurl', 'auth'),
58 new lang_string('forgottenpassword', 'auth'), ''));
59 $temp->add(new admin_setting_confightmleditor('auth_instructions', new lang_string('instructions', 'auth'),
60 new lang_string('authinstructions', 'auth'), ''));
61 $temp->add(new admin_setting_configtext('allowemailaddresses', new lang_string('allowemailaddresses', 'admin'), new lang_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS
));
62 $temp->add(new admin_setting_configtext('denyemailaddresses', new lang_string('denyemailaddresses', 'admin'), new lang_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS
));
63 $temp->add(new admin_setting_configcheckbox('verifychangedemail', new lang_string('verifychangedemail', 'admin'), new lang_string('configverifychangedemail', 'admin'), 1));
65 $temp->add(new admin_setting_configtext('recaptchapublickey', new lang_string('recaptchapublickey', 'admin'), new lang_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS
));
66 $temp->add(new admin_setting_configtext('recaptchaprivatekey', new lang_string('recaptchaprivatekey', 'admin'), new lang_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS
));
67 $ADMIN->add('authsettings', $temp);
69 foreach ($allplugins['auth'] as $auth) {
70 $auth->load_settings($ADMIN, 'authsettings', $hassiteconfig);
74 $ADMIN->add('modules', new admin_category('enrolments', new lang_string('enrolments', 'enrol')));
75 $temp = new admin_settingpage('manageenrols', new lang_string('manageenrols', 'enrol'));
76 $temp->add(new admin_setting_manageenrols());
77 $ADMIN->add('enrolments', $temp);
78 foreach($allplugins['enrol'] as $enrol) {
79 $enrol->load_settings($ADMIN, 'enrolments', $hassiteconfig);
84 $ADMIN->add('modules', new admin_category('editorsettings', new lang_string('editors', 'editor')));
85 $temp = new admin_settingpage('manageeditors', new lang_string('editorsettings', 'editor'));
86 $temp->add(new admin_setting_manageeditors());
87 $ADMIN->add('editorsettings', $temp);
88 foreach ($allplugins['editor'] as $editor) {
89 $editor->load_settings($ADMIN, 'editorsettings', $hassiteconfig);
93 $ADMIN->add('modules', new admin_category('licensesettings', new lang_string('licenses')));
94 $temp = new admin_settingpage('managelicenses', new lang_string('managelicenses', 'admin'));
96 require_once($CFG->libdir
. '/licenselib.php');
98 $array = explode(',', $CFG->licenses
);
99 foreach ($array as $value) {
100 $licenses[$value] = new lang_string($value, 'license');
102 $temp->add(new admin_setting_configselect('sitedefaultlicense', new lang_string('configsitedefaultlicense','admin'), new lang_string('configsitedefaultlicensehelp','admin'), 'allrightsreserved', $licenses));
103 $temp->add(new admin_setting_managelicenses());
104 $ADMIN->add('licensesettings', $temp);
107 $ADMIN->add('modules', new admin_category('filtersettings', new lang_string('managefilters')));
109 $ADMIN->add('filtersettings', new admin_page_managefilters());
111 // "filtersettings" settingpage
112 $temp = new admin_settingpage('commonfiltersettings', new lang_string('commonfiltersettings', 'admin'));
113 if ($ADMIN->fulltree
) {
115 604800 => new lang_string('numdays','',7),
116 86400 => new lang_string('numdays','',1),
117 43200 => new lang_string('numhours','',12),
118 10800 => new lang_string('numhours','',3),
119 7200 => new lang_string('numhours','',2),
120 3600 => new lang_string('numhours','',1),
121 2700 => new lang_string('numminutes','',45),
122 1800 => new lang_string('numminutes','',30),
123 900 => new lang_string('numminutes','',15),
124 600 => new lang_string('numminutes','',10),
125 540 => new lang_string('numminutes','',9),
126 480 => new lang_string('numminutes','',8),
127 420 => new lang_string('numminutes','',7),
128 360 => new lang_string('numminutes','',6),
129 300 => new lang_string('numminutes','',5),
130 240 => new lang_string('numminutes','',4),
131 180 => new lang_string('numminutes','',3),
132 120 => new lang_string('numminutes','',2),
133 60 => new lang_string('numminutes','',1),
134 30 => new lang_string('numseconds','',30),
135 0 => new lang_string('no')
138 $items[] = new admin_setting_configselect('cachetext', new lang_string('cachetext', 'admin'), new lang_string('configcachetext', 'admin'), 60, $cachetimes);
139 $items[] = new admin_setting_configselect('filteruploadedfiles', new lang_string('filteruploadedfiles', 'admin'), new lang_string('configfilteruploadedfiles', 'admin'), 0,
140 array('0' => new lang_string('none'), '1' => new lang_string('allfiles'), '2' => new lang_string('htmlfilesonly')));
141 $items[] = new admin_setting_configcheckbox('filtermatchoneperpage', new lang_string('filtermatchoneperpage', 'admin'), new lang_string('configfiltermatchoneperpage', 'admin'), 0);
142 $items[] = new admin_setting_configcheckbox('filtermatchonepertext', new lang_string('filtermatchonepertext', 'admin'), new lang_string('configfiltermatchonepertext', 'admin'), 0);
143 foreach ($items as $item) {
144 $item->set_updatedcallback('reset_text_filters_cache');
148 $ADMIN->add('filtersettings', $temp);
150 foreach ($allplugins['filter'] as $filter) {
151 $filter->load_settings($ADMIN, 'filtersettings', $hassiteconfig);
155 //== Portfolio settings ==
156 require_once($CFG->libdir
. '/portfoliolib.php');
157 $catname = new lang_string('portfolios', 'portfolio');
158 $manage = new lang_string('manageportfolios', 'portfolio');
159 $url = "$CFG->wwwroot/$CFG->admin/portfolio.php";
161 $ADMIN->add('modules', new admin_category('portfoliosettings', $catname, empty($CFG->enableportfolios
)));
163 // Add manage page (with table)
164 $temp = new admin_page_manageportfolios();
165 $ADMIN->add('portfoliosettings', $temp);
167 // Add common settings page
168 $temp = new admin_settingpage('manageportfolioscommon', new lang_string('commonportfoliosettings', 'portfolio'));
169 $temp->add(new admin_setting_heading('manageportfolioscommon', '', new lang_string('commonsettingsdesc', 'portfolio')));
170 $fileinfo = portfolio_filesize_info(); // make sure this is defined in one place since its used inside portfolio too to detect insane settings
171 $fileoptions = $fileinfo['options'];
172 $temp->add(new admin_setting_configselect(
173 'portfolio_moderate_filesize_threshold',
174 new lang_string('moderatefilesizethreshold', 'portfolio'),
175 new lang_string('moderatefilesizethresholddesc', 'portfolio'),
176 $fileinfo['moderate'], $fileoptions));
177 $temp->add(new admin_setting_configselect(
178 'portfolio_high_filesize_threshold',
179 new lang_string('highfilesizethreshold', 'portfolio'),
180 new lang_string('highfilesizethresholddesc', 'portfolio'),
181 $fileinfo['high'], $fileoptions));
183 $temp->add(new admin_setting_configtext(
184 'portfolio_moderate_db_threshold',
185 new lang_string('moderatedbsizethreshold', 'portfolio'),
186 new lang_string('moderatedbsizethresholddesc', 'portfolio'),
189 $temp->add(new admin_setting_configtext(
190 'portfolio_high_db_threshold',
191 new lang_string('highdbsizethreshold', 'portfolio'),
192 new lang_string('highdbsizethresholddesc', 'portfolio'),
195 $ADMIN->add('portfoliosettings', $temp);
196 $ADMIN->add('portfoliosettings', new admin_externalpage('portfolionew', new lang_string('addnewportfolio', 'portfolio'), $url, 'moodle/site:config', true));
197 $ADMIN->add('portfoliosettings', new admin_externalpage('portfoliodelete', new lang_string('deleteportfolio', 'portfolio'), $url, 'moodle/site:config', true));
198 $ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', new lang_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true));
200 foreach (portfolio_instances(false, false) as $portfolio) {
201 require_once($CFG->dirroot
. '/portfolio/' . $portfolio->get('plugin') . '/lib.php');
202 $classname = 'portfolio_plugin_' . $portfolio->get('plugin');
205 new admin_externalpage(
206 'portfoliosettings' . $portfolio->get('id'),
207 $portfolio->get('name'),
208 $url . '?action=edit&pf=' . $portfolio->get('id'),
214 // repository setting
215 require_once("$CFG->dirroot/repository/lib.php");
216 $catname =new lang_string('repositories', 'repository');
217 $managerepo = new lang_string('manage', 'repository');
218 $url = $CFG->wwwroot
.'/'.$CFG->admin
.'/repository.php';
219 $ADMIN->add('modules', new admin_category('repositorysettings', $catname));
221 // Add main page (with table)
222 $temp = new admin_page_managerepositories();
223 $ADMIN->add('repositorysettings', $temp);
225 // Add common settings page
226 $temp = new admin_settingpage('managerepositoriescommon', new lang_string('commonrepositorysettings', 'repository'));
227 $temp->add(new admin_setting_configtext('repositorycacheexpire', new lang_string('cacheexpire', 'repository'), new lang_string('configcacheexpire', 'repository'), 120));
228 $temp->add(new admin_setting_configcheckbox('repositoryallowexternallinks', new lang_string('allowexternallinks', 'repository'), new lang_string('configallowexternallinks', 'repository'), 1));
229 $temp->add(new admin_setting_configcheckbox('legacyfilesinnewcourses', new lang_string('legacyfilesinnewcourses', 'admin'), new lang_string('legacyfilesinnewcourses_help', 'admin'), 0));
230 $ADMIN->add('repositorysettings', $temp);
231 $ADMIN->add('repositorysettings', new admin_externalpage('repositorynew',
232 new lang_string('addplugin', 'repository'), $url, 'moodle/site:config', true));
233 $ADMIN->add('repositorysettings', new admin_externalpage('repositorydelete',
234 new lang_string('deleterepository', 'repository'), $url, 'moodle/site:config', true));
235 $ADMIN->add('repositorysettings', new admin_externalpage('repositorycontroller',
236 new lang_string('manage', 'repository'), $url, 'moodle/site:config', true));
237 $ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstancenew',
238 new lang_string('createrepository', 'repository'), $url, 'moodle/site:config', true));
239 $ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit',
240 new lang_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true));
241 foreach ($allplugins['repository'] as $repositorytype) {
242 $repositorytype->load_settings($ADMIN, 'repositorysettings', $hassiteconfig);
246 $ADMIN->add('modules', new admin_category('webservicesettings', new lang_string('webservices', 'webservice')));
248 $temp = new admin_settingpage('mobile', new lang_string('mobile','admin'), 'moodle/site:config', false);
249 $enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services'));
250 $enablemobiledoclink = html_writer
::link($enablemobiledocurl, new lang_string('documentation'));
251 $temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
252 new lang_string('enablemobilewebservice', 'admin'),
253 new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
254 $temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'admin'), new lang_string('configmobilecssurl','admin'), '', PARAM_URL
));
255 $ADMIN->add('webservicesettings', $temp);
257 $temp = new admin_settingpage('webservicesoverview', new lang_string('webservicesoverview', 'webservice'));
258 $temp->add(new admin_setting_webservicesoverview());
259 $ADMIN->add('webservicesettings', $temp);
261 $ADMIN->add('webservicesettings', new admin_externalpage('webservicedocumentation', new lang_string('wsdocapi', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/documentation.php", 'moodle/site:config', false));
263 $temp = new admin_settingpage('externalservices', new lang_string('externalservices', 'webservice'));
264 $temp->add(new admin_setting_enablemobileservice('enablemobilewebservice',
265 new lang_string('enablemobilewebservice', 'admin'),
266 new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), 0));
267 $temp->add(new admin_setting_heading('manageserviceshelpexplaination', new lang_string('information', 'webservice'), new lang_string('servicehelpexplanation', 'webservice')));
268 $temp->add(new admin_setting_manageexternalservices());
269 $ADMIN->add('webservicesettings', $temp);
270 $ADMIN->add('webservicesettings', new admin_externalpage('externalservice', new lang_string('editaservice', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service.php", 'moodle/site:config', true));
271 $ADMIN->add('webservicesettings', new admin_externalpage('externalservicefunctions', new lang_string('externalservicefunctions', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_functions.php", 'moodle/site:config', true));
272 $ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusers', new lang_string('externalserviceusers', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_users.php", 'moodle/site:config', true));
273 $ADMIN->add('webservicesettings', new admin_externalpage('externalserviceusersettings', new lang_string('serviceusersettings', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/service_user_settings.php", 'moodle/site:config', true));
274 /// manage protocol page link
275 $temp = new admin_settingpage('webserviceprotocols', new lang_string('manageprotocols', 'webservice'));
276 $temp->add(new admin_setting_managewebserviceprotocols());
277 if (empty($CFG->enablewebservices
)) {
278 $temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
281 // We cannot use $OUTPUT this early, doing so means that we lose the ability
282 // to set the page layout on all admin pages.
283 // $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key');
284 $url = new moodle_url(get_docs_url('How_to_get_a_security_key'));
285 $wsdoclink = html_writer
::tag('a', new lang_string('supplyinfo', 'webservice'), array('href'=>$url));
286 $temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation',
287 'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false));
288 $ADMIN->add('webservicesettings', $temp);
289 /// links to protocol pages
290 foreach ($allplugins['webservice'] as $webservice) {
291 $webservice->load_settings($ADMIN, 'webservicesettings', $hassiteconfig);
293 /// manage token page link
294 $ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', new lang_string('managetokens', 'webservice'), "$CFG->wwwroot/$CFG->admin/webservice/tokens.php", 'moodle/site:config', true));
295 $temp = new admin_settingpage('webservicetokens', new lang_string('managetokens', 'webservice'));
296 $temp->add(new admin_setting_managewebservicetokens());
297 if (empty($CFG->enablewebservices
)) {
298 $temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice')));
300 $ADMIN->add('webservicesettings', $temp);
303 // Question type settings
304 if ($hassiteconfig ||
has_capability('moodle/question:config', $systemcontext)) {
305 if (!$hassiteconfig) {
306 require_once("$CFG->libdir/pluginlib.php");
307 $allplugins = plugin_manager
::instance()->get_plugins();
310 // Question behaviour settings.
311 $ADMIN->add('modules', new admin_category('qbehavioursettings', new lang_string('questionbehaviours', 'admin')));
312 $ADMIN->add('qbehavioursettings', new admin_page_manageqbehaviours());
314 // Question type settings.
315 $ADMIN->add('modules', new admin_category('qtypesettings', new lang_string('questiontypes', 'admin')));
316 $ADMIN->add('qtypesettings', new admin_page_manageqtypes());
318 // Question preview defaults.
319 $settings = new admin_settingpage('qdefaultsetting',
320 get_string('questionpreviewdefaults', 'question'),
321 'moodle/question:config');
322 $ADMIN->add('qtypesettings', $settings);
324 $settings->add(new admin_setting_heading('qdefaultsetting_preview_options',
325 '', get_string('questionpreviewdefaults_desc', 'question')));
327 // These keys are question_display_options::HIDDEN and VISIBLE.
328 $hiddenofvisible = array(
329 0 => get_string('notshown', 'question'),
330 1 => get_string('shown', 'question'),
333 $settings->add(new admin_setting_question_behaviour('question_preview/behaviour',
334 get_string('howquestionsbehave', 'question'), '',
335 'deferredfeedback'));
337 $settings->add(new admin_setting_configselect('question_preview/correctness',
338 get_string('whethercorrect', 'question'), '', 1, $hiddenofvisible));
340 // These keys are question_display_options::HIDDEN, MARK_ONLY and MARK_AND_MAX.
341 $marksoptions = array(
342 0 => get_string('notshown', 'question'),
343 1 => get_string('showmaxmarkonly', 'question'),
344 2 => get_string('showmarkandmax', 'question'),
346 $settings->add(new admin_setting_configselect('question_preview/marks',
347 get_string('marks', 'question'), '', 1, $marksoptions));
349 $settings->add(new admin_setting_configselect('question_preview/markdp',
350 get_string('decimalplacesingrades', 'question'), '', 2, array(0, 1, 2, 3, 4, 5, 6, 7)));
352 $settings->add(new admin_setting_configselect('question_preview/feedback',
353 get_string('specificfeedback', 'question'), '', 1, $hiddenofvisible));
355 $settings->add(new admin_setting_configselect('question_preview/generalfeedback',
356 get_string('generalfeedback', 'question'), '', 1, $hiddenofvisible));
358 $settings->add(new admin_setting_configselect('question_preview/rightanswer',
359 get_string('rightanswer', 'question'), '', 1, $hiddenofvisible));
361 $settings->add(new admin_setting_configselect('question_preview/history',
362 get_string('responsehistory', 'question'), '', 0, $hiddenofvisible));
364 // Settings for particular question types.
365 foreach ($allplugins['qtype'] as $qtype) {
366 $qtype->load_settings($ADMIN, 'qtypesettings', $hassiteconfig);
370 // Plagiarism plugin settings
371 if ($hassiteconfig && !empty($CFG->enableplagiarism
)) {
372 $ADMIN->add('modules', new admin_category('plagiarism', new lang_string('plagiarism', 'plagiarism')));
373 $ADMIN->add('plagiarism', new admin_externalpage('manageplagiarismplugins', new lang_string('manageplagiarism', 'plagiarism'),
374 $CFG->wwwroot
. '/' . $CFG->admin
. '/plagiarism.php'));
376 foreach ($allplugins['plagiarism'] as $plugin) {
377 $plugin->load_settings($ADMIN, 'plagiarism', $hassiteconfig);
380 $ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot
.'/comment/', 'moodle/site:viewreports'));
382 // Course reports settings
383 if ($hassiteconfig) {
385 foreach (get_plugin_list('coursereport') as $report => $path) {
386 $file = $CFG->dirroot
. '/course/report/' . $report . '/settings.php';
387 if (file_exists($file)) {
388 $settings = new admin_settingpage('coursereport' . $report,
389 new lang_string('pluginname', 'coursereport_' . $report), 'moodle/site:config');
390 // settings.php may create a subcategory or unset the settings completely
393 $pages[] = $settings;
397 if (!empty($pages)) {
398 $ADMIN->add('modules', new admin_category('coursereports', new lang_string('coursereports')));
399 foreach ($pages as $page) {
400 $ADMIN->add('coursereports', $page);
408 foreach (get_plugin_list('report') as $report => $plugindir) {
409 $settings_path = "$plugindir/settings.php";
410 if (file_exists($settings_path)) {
411 $settings = new admin_settingpage('report' . $report,
412 new lang_string('pluginname', 'report_' . $report), 'moodle/site:config');
413 include($settings_path);
415 $pages[] = $settings;
419 $ADMIN->add('modules', new admin_category('reportplugins', new lang_string('reports')));
420 $ADMIN->add('reportplugins', new admin_externalpage('managereports', new lang_string('reportsmanage', 'admin'),
421 $CFG->wwwroot
. '/' . $CFG->admin
. '/reports.php'));
422 foreach ($pages as $page) {
423 $ADMIN->add('reportplugins', $page);
426 /// Add all admin tools
427 if ($hassiteconfig) {
428 $ADMIN->add('modules', new admin_category('tools', new lang_string('tools', 'admin')));
429 $ADMIN->add('tools', new admin_externalpage('managetools', new lang_string('toolsmanage', 'admin'),
430 $CFG->wwwroot
. '/' . $CFG->admin
. '/tools.php'));
433 // Now add various admin tools
434 foreach (get_plugin_list('tool') as $plugin => $plugindir) {
435 $settings_path = "$plugindir/settings.php";
436 if (file_exists($settings_path)) {
437 include($settings_path);
441 // Now add the Cache plugins
442 if ($hassiteconfig) {
443 $ADMIN->add('modules', new admin_category('cache', new lang_string('caching', 'cache')));
444 $ADMIN->add('cache', new admin_externalpage('cacheconfig', new lang_string('cacheconfig', 'cache'), $CFG->wwwroot
.'/cache/admin.php'));
445 $ADMIN->add('cache', new admin_externalpage('cachetestperformance', new lang_string('testperformance', 'cache'), $CFG->wwwroot
. '/cache/testperformance.php'));
446 $ADMIN->add('cache', new admin_category('cachestores', new lang_string('cachestores', 'cache')));
447 foreach (get_plugin_list('cachestore') as $plugin => $path) {
448 $settingspath = $path.'/settings.php';
449 if (file_exists($settingspath)) {
450 $settings = new admin_settingpage('cachestore_'.$plugin.'_settings', new lang_string('pluginname', 'cachestore_'.$plugin), 'moodle/site:config');
451 include($settingspath);
452 $ADMIN->add('cachestores', $settings);
457 /// Add all local plugins - must be always last!
458 if ($hassiteconfig) {
459 $ADMIN->add('modules', new admin_category('localplugins', new lang_string('localplugins')));
460 $ADMIN->add('localplugins', new admin_externalpage('managelocalplugins', new lang_string('localpluginsmanage'),
461 $CFG->wwwroot
. '/' . $CFG->admin
. '/localplugins.php'));
464 // extend settings for each local plugin. Note that their settings may be in any part of the
465 // settings tree and may be visible not only for administrators. We can not use $allplugins here
466 foreach (get_plugin_list('local') as $plugin => $plugindir) {
467 $settings_path = "$plugindir/settings.php";
468 if (file_exists($settings_path)) {
469 include($settings_path);