2009-11-01 10:32:02 +00:00
|
|
|
<?php
|
2013-10-04 22:40:44 +02:00
|
|
|
// 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/>.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Load all plugins into the admin tree.
|
|
|
|
*
|
|
|
|
* Please note that is file is always loaded last - it means that you can inject entries into other categories too.
|
|
|
|
*
|
|
|
|
* @package core
|
|
|
|
* @copyright 2007 Petr Skoda {@link http://skodak.org}
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
2008-11-28 08:04:23 +00:00
|
|
|
|
2009-12-16 18:00:58 +00:00
|
|
|
if ($hassiteconfig) {
|
2013-12-12 10:02:22 +13:00
|
|
|
/* @var admin_root $ADMIN */
|
|
|
|
$ADMIN->locate('modules')->set_sorting(true);
|
|
|
|
|
2011-03-10 00:50:18 +01:00
|
|
|
$ADMIN->add('modules', new admin_page_pluginsoverview());
|
2012-09-18 13:14:37 +08:00
|
|
|
|
|
|
|
// activity modules
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('modsettings', new lang_string('activitymodules')));
|
2015-03-17 09:28:16 +00:00
|
|
|
|
2015-05-14 16:33:19 +01:00
|
|
|
$ADMIN->add('modsettings', new admin_page_managemods());
|
2015-03-17 09:28:16 +00:00
|
|
|
|
2015-05-14 16:33:19 +01:00
|
|
|
$temp = new admin_settingpage('managemodulescommon', new lang_string('commonactivitysettings', 'admin'));
|
2015-03-17 09:28:16 +00:00
|
|
|
$temp->add(new admin_setting_configcheckbox('requiremodintro',
|
|
|
|
get_string('requiremodintro', 'admin'), get_string('requiremodintro_desc', 'admin'), 0));
|
|
|
|
$ADMIN->add('modsettings', $temp);
|
|
|
|
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('mod');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\mod $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'modsettings', $hassiteconfig);
|
2007-12-19 17:35:20 +00:00
|
|
|
}
|
|
|
|
|
2012-10-18 16:03:11 +08:00
|
|
|
// course formats
|
|
|
|
$ADMIN->add('modules', new admin_category('formatsettings', new lang_string('courseformats')));
|
|
|
|
$temp = new admin_settingpage('manageformats', new lang_string('manageformats', 'core_admin'));
|
|
|
|
$temp->add(new admin_setting_manageformats());
|
|
|
|
$ADMIN->add('formatsettings', $temp);
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('format');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\format $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'formatsettings', $hassiteconfig);
|
2012-10-18 16:03:11 +08:00
|
|
|
}
|
|
|
|
|
2019-01-11 11:38:26 +01:00
|
|
|
// Custom fields.
|
|
|
|
$ADMIN->add('modules', new admin_category('customfieldsettings', new lang_string('customfields', 'core_customfield')));
|
|
|
|
$temp = new admin_settingpage('managecustomfields', new lang_string('managecustomfields', 'core_admin'));
|
|
|
|
$temp->add(new admin_setting_managecustomfields());
|
|
|
|
$ADMIN->add('customfieldsettings', $temp);
|
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('customfield');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
|
|
|
/** @var \core\plugininfo\customfield $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'customfieldsettings', $hassiteconfig);
|
|
|
|
}
|
|
|
|
|
2012-09-19 11:59:59 +08:00
|
|
|
// blocks
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('blocksettings', new lang_string('blocks')));
|
2007-12-19 17:35:20 +00:00
|
|
|
$ADMIN->add('blocksettings', new admin_page_manageblocks());
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('block');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\block $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'blocksettings', $hassiteconfig);
|
2007-12-19 17:35:20 +00:00
|
|
|
}
|
|
|
|
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
// authentication plugins
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('authsettings', new lang_string('authentication', 'admin')));
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('manageauths', new lang_string('authsettings', 'admin'));
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
$temp->add(new admin_setting_manageauths());
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_heading('manageauthscommonheading', new lang_string('commonsettings', 'admin'), ''));
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
$temp->add(new admin_setting_special_registerauth());
|
2014-03-13 11:23:26 +08:00
|
|
|
$temp->add(new admin_setting_configcheckbox('authloginviaemail', new lang_string('authloginviaemail', 'core_auth'), new lang_string('authloginviaemail_desc', 'core_auth'), 0));
|
2015-08-20 12:56:11 +08:00
|
|
|
$temp->add(new admin_setting_configcheckbox('allowaccountssameemail',
|
|
|
|
new lang_string('allowaccountssameemail', 'core_auth'),
|
|
|
|
new lang_string('allowaccountssameemail_desc', 'core_auth'), 0));
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configcheckbox('authpreventaccountcreation', new lang_string('authpreventaccountcreation', 'admin'), new lang_string('authpreventaccountcreation_help', 'admin'), 0));
|
|
|
|
$temp->add(new admin_setting_configcheckbox('loginpageautofocus', new lang_string('loginpageautofocus', 'admin'), new lang_string('loginpageautofocus_help', 'admin'), 0));
|
|
|
|
$temp->add(new admin_setting_configselect('guestloginbutton', new lang_string('guestloginbutton', 'auth'),
|
|
|
|
new lang_string('showguestlogin', 'auth'), '1', array('0'=>new lang_string('hide'), '1'=>new lang_string('show'))));
|
2014-10-23 15:33:53 +13:00
|
|
|
$options = array(0 => get_string('no'), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 10 => 10, 20 => 20, 50 => 50);
|
|
|
|
$temp->add(new admin_setting_configselect('limitconcurrentlogins',
|
|
|
|
new lang_string('limitconcurrentlogins', 'core_auth'),
|
|
|
|
new lang_string('limitconcurrentlogins_desc', 'core_auth'), 0, $options));
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configtext('alternateloginurl', new lang_string('alternateloginurl', 'auth'),
|
2022-10-28 10:27:37 +02:00
|
|
|
new lang_string('alternatelogin', 'auth', htmlspecialchars(get_login_url(), ENT_COMPAT)), ''));
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configtext('forgottenpasswordurl', new lang_string('forgottenpasswordurl', 'auth'),
|
2017-10-27 10:34:49 +02:00
|
|
|
new lang_string('forgottenpassword', 'auth'), '', PARAM_URL));
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_confightmleditor('auth_instructions', new lang_string('instructions', 'auth'),
|
|
|
|
new lang_string('authinstructions', 'auth'), ''));
|
2016-08-18 14:16:47 +08:00
|
|
|
$setting = new admin_setting_configtext('allowemailaddresses', new lang_string('allowemailaddresses', 'admin'),
|
|
|
|
new lang_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS);
|
|
|
|
$setting->set_force_ltr(true);
|
|
|
|
$temp->add($setting);
|
|
|
|
$setting = new admin_setting_configtext('denyemailaddresses', new lang_string('denyemailaddresses', 'admin'),
|
|
|
|
new lang_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS);
|
|
|
|
$setting->set_force_ltr(true);
|
|
|
|
$temp->add($setting);
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configcheckbox('verifychangedemail', new lang_string('verifychangedemail', 'admin'), new lang_string('configverifychangedemail', 'admin'), 1));
|
|
|
|
|
2016-08-18 14:16:47 +08:00
|
|
|
$setting = new admin_setting_configtext('recaptchapublickey', new lang_string('recaptchapublickey', 'admin'), new lang_string('configrecaptchapublickey', 'admin'), '', PARAM_NOTAGS);
|
|
|
|
$setting->set_force_ltr(true);
|
|
|
|
$temp->add($setting);
|
|
|
|
$setting = new admin_setting_configtext('recaptchaprivatekey', new lang_string('recaptchaprivatekey', 'admin'), new lang_string('configrecaptchaprivatekey', 'admin'), '', PARAM_NOTAGS);
|
|
|
|
$setting->set_force_ltr(true);
|
|
|
|
$temp->add($setting);
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
$ADMIN->add('authsettings', $temp);
|
|
|
|
|
2013-09-30 22:39:21 +02:00
|
|
|
$temp = new admin_externalpage('authtestsettings', get_string('testsettings', 'core_auth'), new moodle_url("/auth/test_settings.php"), 'moodle/site:config', true);
|
|
|
|
$ADMIN->add('authsettings', $temp);
|
|
|
|
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('auth');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\auth $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'authsettings', $hassiteconfig);
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Enrolment plugins
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('enrolments', new lang_string('enrolments', 'enrol')));
|
|
|
|
$temp = new admin_settingpage('manageenrols', new lang_string('manageenrols', 'enrol'));
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
$temp->add(new admin_setting_manageenrols());
|
|
|
|
$ADMIN->add('enrolments', $temp);
|
2013-09-30 22:39:21 +02:00
|
|
|
|
|
|
|
$temp = new admin_externalpage('enroltestsettings', get_string('testsettings', 'core_enrol'), new moodle_url("/enrol/test_settings.php"), 'moodle/site:config', true);
|
|
|
|
$ADMIN->add('enrolments', $temp);
|
|
|
|
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('enrol');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\enrol $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'enrolments', $hassiteconfig);
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
}
|
|
|
|
|
2008-07-31 06:01:12 +00:00
|
|
|
|
2009-05-17 21:10:06 +00:00
|
|
|
/// Editor plugins
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('editorsettings', new lang_string('editors', 'editor')));
|
|
|
|
$temp = new admin_settingpage('manageeditors', new lang_string('editorsettings', 'editor'));
|
2009-05-17 21:10:06 +00:00
|
|
|
$temp->add(new admin_setting_manageeditors());
|
|
|
|
$ADMIN->add('editorsettings', $temp);
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('editor');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\editor $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'editorsettings', $hassiteconfig);
|
2010-03-23 08:47:05 +00:00
|
|
|
}
|
2010-07-04 20:53:01 +00:00
|
|
|
|
2015-07-21 10:34:42 +01:00
|
|
|
// Antivirus plugins.
|
2015-06-24 16:22:56 +01:00
|
|
|
$ADMIN->add('modules', new admin_category('antivirussettings', new lang_string('antiviruses', 'antivirus')));
|
|
|
|
$temp = new admin_settingpage('manageantiviruses', new lang_string('antivirussettings', 'antivirus'));
|
|
|
|
$temp->add(new admin_setting_manageantiviruses());
|
2020-03-15 20:09:48 +11:00
|
|
|
|
|
|
|
// Common settings.
|
|
|
|
$temp->add(new admin_setting_heading('antiviruscommonsettings', new lang_string('antiviruscommonsettings', 'antivirus'), ''));
|
|
|
|
|
|
|
|
// Alert email.
|
2020-05-27 10:57:33 +10:00
|
|
|
$temp->add(
|
|
|
|
new admin_setting_configtext(
|
|
|
|
'antivirus/notifyemail',
|
2020-03-15 20:09:48 +11:00
|
|
|
new lang_string('notifyemail', 'antivirus'),
|
2020-05-27 10:57:33 +10:00
|
|
|
new lang_string('notifyemail_help', 'antivirus'),
|
|
|
|
'',
|
|
|
|
PARAM_EMAIL
|
|
|
|
)
|
2020-03-15 20:09:48 +11:00
|
|
|
);
|
|
|
|
|
2021-05-18 16:53:03 +10:00
|
|
|
// Notify level.
|
|
|
|
$temp->add(new admin_setting_configselect('antivirus/notifylevel',
|
|
|
|
get_string('notifylevel', 'antivirus'), '', core\antivirus\scanner::SCAN_RESULT_ERROR, [
|
|
|
|
core\antivirus\scanner::SCAN_RESULT_ERROR => get_string('notifylevelerror', 'antivirus'),
|
|
|
|
core\antivirus\scanner::SCAN_RESULT_FOUND => get_string('notifylevelfound', 'antivirus')
|
|
|
|
]),
|
|
|
|
);
|
|
|
|
|
|
|
|
// Threshold for check displayed on the /report/status/index.php page.
|
|
|
|
$url = new moodle_url('/report/status/index.php');
|
|
|
|
$link = html_writer::link($url, get_string('pluginname', 'report_status'));
|
|
|
|
$temp->add(
|
|
|
|
new admin_setting_configduration(
|
|
|
|
'antivirus/threshold',
|
|
|
|
new lang_string('threshold', 'antivirus'),
|
|
|
|
get_string('threshold_desc', 'antivirus', $link),
|
|
|
|
20 * MINSECS
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2020-03-15 20:09:48 +11:00
|
|
|
// Enable quarantine.
|
2020-05-27 10:57:33 +10:00
|
|
|
$temp->add(
|
|
|
|
new admin_setting_configcheckbox(
|
|
|
|
'antivirus/enablequarantine',
|
|
|
|
new lang_string('enablequarantine', 'antivirus'),
|
|
|
|
new lang_string('enablequarantine_help', 'antivirus',
|
|
|
|
\core\antivirus\quarantine::DEFAULT_QUARANTINE_FOLDER),
|
|
|
|
0
|
|
|
|
)
|
|
|
|
);
|
2020-03-15 20:09:48 +11:00
|
|
|
|
|
|
|
// Quarantine time.
|
2020-05-27 10:57:33 +10:00
|
|
|
$temp->add(
|
|
|
|
new admin_setting_configduration(
|
|
|
|
'antivirus/quarantinetime',
|
2020-03-15 20:09:48 +11:00
|
|
|
new lang_string('quarantinetime', 'antivirus'),
|
|
|
|
new lang_string('quarantinetime_desc', 'antivirus'),
|
2020-05-27 10:57:33 +10:00
|
|
|
\core\antivirus\quarantine::DEFAULT_QUARANTINE_TIME
|
|
|
|
)
|
2020-03-15 20:09:48 +11:00
|
|
|
);
|
|
|
|
|
2015-06-24 16:22:56 +01:00
|
|
|
$ADMIN->add('antivirussettings', $temp);
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('antivirus');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2015-07-21 10:34:42 +01:00
|
|
|
/* @var \core\plugininfo\antivirus $plugin */
|
2015-06-24 16:22:56 +01:00
|
|
|
$plugin->load_settings($ADMIN, 'antivirussettings', $hassiteconfig);
|
|
|
|
}
|
|
|
|
|
2019-06-26 14:15:38 +02:00
|
|
|
// Machine learning backend plugins.
|
|
|
|
$ADMIN->add('modules', new admin_category('mlbackendsettings', new lang_string('mlbackendsettings', 'admin')));
|
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('mlbackend');
|
|
|
|
foreach ($plugins as $plugin) {
|
|
|
|
$plugin->load_settings($ADMIN, 'mlbackendsettings', $hassiteconfig);
|
|
|
|
}
|
|
|
|
|
2009-05-17 21:10:06 +00:00
|
|
|
/// Filter plugins
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('filtersettings', new lang_string('managefilters')));
|
2009-04-13 07:15:50 +00:00
|
|
|
|
|
|
|
$ADMIN->add('filtersettings', new admin_page_managefilters());
|
|
|
|
|
2007-12-19 17:35:20 +00:00
|
|
|
// "filtersettings" settingpage
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('commonfiltersettings', new lang_string('commonfiltersettings', 'admin'));
|
2007-12-19 17:35:20 +00:00
|
|
|
if ($ADMIN->fulltree) {
|
2007-12-25 10:03:59 +00:00
|
|
|
$items = array();
|
2011-12-06 11:07:55 +13:00
|
|
|
$items[] = new admin_setting_configselect('filteruploadedfiles', new lang_string('filteruploadedfiles', 'admin'), new lang_string('configfilteruploadedfiles', 'admin'), 0,
|
|
|
|
array('0' => new lang_string('none'), '1' => new lang_string('allfiles'), '2' => new lang_string('htmlfilesonly')));
|
|
|
|
$items[] = new admin_setting_configcheckbox('filtermatchoneperpage', new lang_string('filtermatchoneperpage', 'admin'), new lang_string('configfiltermatchoneperpage', 'admin'), 0);
|
|
|
|
$items[] = new admin_setting_configcheckbox('filtermatchonepertext', new lang_string('filtermatchonepertext', 'admin'), new lang_string('configfiltermatchonepertext', 'admin'), 0);
|
2019-12-10 15:31:37 +00:00
|
|
|
$items[] = new admin_setting_configcheckbox('filternavigationwithsystemcontext',
|
|
|
|
new lang_string('filternavigationwithsystemcontext', 'admin'),
|
|
|
|
new lang_string('configfilternavigationwithsystemcontext', 'admin'), 0);
|
2007-12-25 10:03:59 +00:00
|
|
|
foreach ($items as $item) {
|
|
|
|
$item->set_updatedcallback('reset_text_filters_cache');
|
|
|
|
$temp->add($item);
|
|
|
|
}
|
2007-12-19 17:35:20 +00:00
|
|
|
}
|
|
|
|
$ADMIN->add('filtersettings', $temp);
|
|
|
|
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('filter');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\filter $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'filtersettings', $hassiteconfig);
|
2007-12-19 17:35:20 +00:00
|
|
|
}
|
2008-07-25 08:14:11 +00:00
|
|
|
|
MDL-38158 core_media: Convert media players to new plugin type
AMOS BEGIN
MOV [siteyoutube,core_media],[pluginname,media_youtube]
MOV [siteyoutube_desc,core_media],[pluginname_help,media_youtube]
MOV [sitevimeo,core_media],[pluginname,media_vimeo]
MOV [sitevimeo_desc,core_media],[pluginname_help,media_vimeo]
MOV [html5audio,core_media],[pluginname,media_html5audio]
MOV [html5audio_desc,core_media],[pluginname_help,media_html5audio]
MOV [html5video,core_media],[pluginname,media_html5video]
MOV [html5video_desc,core_media],[pluginname_help,media_html5video]
MOV [flashanimation,core_media],[pluginname,media_swf]
MOV [flashanimation_desc,core_media],[pluginname_help,media_swf]
AMOS END
2016-09-15 15:52:41 +08:00
|
|
|
// Media players.
|
|
|
|
$ADMIN->add('modules', new admin_category('mediaplayers', new lang_string('type_media_plural', 'plugin')));
|
|
|
|
$temp = new admin_settingpage('managemediaplayers', new lang_string('managemediaplayers', 'media'));
|
|
|
|
$temp->add(new admin_setting_heading('mediaformats', get_string('mediaformats', 'core_media'),
|
|
|
|
format_text(get_string('mediaformats_desc', 'core_media'), FORMAT_MARKDOWN)));
|
|
|
|
$temp->add(new admin_setting_managemediaplayers());
|
|
|
|
$temp->add(new admin_setting_heading('managemediaplayerscommonheading', new lang_string('commonsettings', 'admin'), ''));
|
|
|
|
$temp->add(new admin_setting_configtext('media_default_width',
|
|
|
|
new lang_string('defaultwidth', 'core_media'), new lang_string('defaultwidthdesc', 'core_media'),
|
2021-03-30 15:53:56 +01:00
|
|
|
640, PARAM_INT, 10));
|
MDL-38158 core_media: Convert media players to new plugin type
AMOS BEGIN
MOV [siteyoutube,core_media],[pluginname,media_youtube]
MOV [siteyoutube_desc,core_media],[pluginname_help,media_youtube]
MOV [sitevimeo,core_media],[pluginname,media_vimeo]
MOV [sitevimeo_desc,core_media],[pluginname_help,media_vimeo]
MOV [html5audio,core_media],[pluginname,media_html5audio]
MOV [html5audio_desc,core_media],[pluginname_help,media_html5audio]
MOV [html5video,core_media],[pluginname,media_html5video]
MOV [html5video_desc,core_media],[pluginname_help,media_html5video]
MOV [flashanimation,core_media],[pluginname,media_swf]
MOV [flashanimation_desc,core_media],[pluginname_help,media_swf]
AMOS END
2016-09-15 15:52:41 +08:00
|
|
|
$temp->add(new admin_setting_configtext('media_default_height',
|
|
|
|
new lang_string('defaultheight', 'core_media'), new lang_string('defaultheightdesc', 'core_media'),
|
2021-03-30 15:53:56 +01:00
|
|
|
360, PARAM_INT, 10));
|
MDL-38158 core_media: Convert media players to new plugin type
AMOS BEGIN
MOV [siteyoutube,core_media],[pluginname,media_youtube]
MOV [siteyoutube_desc,core_media],[pluginname_help,media_youtube]
MOV [sitevimeo,core_media],[pluginname,media_vimeo]
MOV [sitevimeo_desc,core_media],[pluginname_help,media_vimeo]
MOV [html5audio,core_media],[pluginname,media_html5audio]
MOV [html5audio_desc,core_media],[pluginname_help,media_html5audio]
MOV [html5video,core_media],[pluginname,media_html5video]
MOV [html5video_desc,core_media],[pluginname_help,media_html5video]
MOV [flashanimation,core_media],[pluginname,media_swf]
MOV [flashanimation_desc,core_media],[pluginname_help,media_swf]
AMOS END
2016-09-15 15:52:41 +08:00
|
|
|
$ADMIN->add('mediaplayers', $temp);
|
|
|
|
|
2017-02-17 09:34:55 +08:00
|
|
|
// Convert plugins.
|
|
|
|
$ADMIN->add('modules', new admin_category('fileconverterplugins', new lang_string('type_fileconverter_plural', 'plugin')));
|
2017-05-15 09:45:09 +05:30
|
|
|
$temp = new admin_settingpage('managefileconverterplugins', new lang_string('type_fileconvertermanage', 'plugin'));
|
2017-02-17 09:34:55 +08:00
|
|
|
$temp->add(new admin_setting_manage_fileconverter_plugins());
|
|
|
|
$ADMIN->add('fileconverterplugins', $temp);
|
|
|
|
|
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('fileconverter');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
|
|
|
/** @var \core\plugininfo\media $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'fileconverterplugins', $hassiteconfig);
|
|
|
|
}
|
|
|
|
|
MDL-38158 core_media: Convert media players to new plugin type
AMOS BEGIN
MOV [siteyoutube,core_media],[pluginname,media_youtube]
MOV [siteyoutube_desc,core_media],[pluginname_help,media_youtube]
MOV [sitevimeo,core_media],[pluginname,media_vimeo]
MOV [sitevimeo_desc,core_media],[pluginname_help,media_vimeo]
MOV [html5audio,core_media],[pluginname,media_html5audio]
MOV [html5audio_desc,core_media],[pluginname_help,media_html5audio]
MOV [html5video,core_media],[pluginname,media_html5video]
MOV [html5video_desc,core_media],[pluginname_help,media_html5video]
MOV [flashanimation,core_media],[pluginname,media_swf]
MOV [flashanimation_desc,core_media],[pluginname_help,media_swf]
AMOS END
2016-09-15 15:52:41 +08:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('media');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
|
|
|
/** @var \core\plugininfo\media $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'mediaplayers', $hassiteconfig);
|
|
|
|
}
|
|
|
|
|
2019-12-16 23:58:11 +11:00
|
|
|
// Payment gateway plugins.
|
2020-10-17 02:45:36 +11:00
|
|
|
$ADMIN->add('modules', new admin_category('paymentgateways', new lang_string('type_paygw_plural', 'plugin')));
|
|
|
|
$temp = new admin_settingpage('managepaymentgateways', new lang_string('type_paygwmanage', 'plugin'));
|
2019-12-16 23:58:11 +11:00
|
|
|
$temp->add(new \core_admin\local\settings\manage_payment_gateway_plugins());
|
2020-10-02 16:01:56 +10:00
|
|
|
$temp->add(new admin_setting_description(
|
|
|
|
'managepaymentgatewayspostfix',
|
|
|
|
'',
|
|
|
|
new lang_string('gotopaymentaccounts', 'payment',
|
|
|
|
html_writer::link(new moodle_url('/payment/accounts.php'), get_string('paymentaccounts', 'payment')))
|
|
|
|
));
|
2019-12-16 23:58:11 +11:00
|
|
|
$ADMIN->add('paymentgateways', $temp);
|
|
|
|
|
2020-10-17 02:45:36 +11:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('paygw');
|
2019-12-16 23:58:11 +11:00
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2020-10-17 02:45:36 +11:00
|
|
|
/** @var \core\plugininfo\paygw $plugin */
|
2019-12-16 23:58:11 +11:00
|
|
|
$plugin->load_settings($ADMIN, 'paymentgateways', $hassiteconfig);
|
|
|
|
}
|
|
|
|
|
2016-04-02 16:10:29 +11:00
|
|
|
// Data format settings.
|
|
|
|
$ADMIN->add('modules', new admin_category('dataformatsettings', new lang_string('dataformats')));
|
|
|
|
$temp = new admin_settingpage('managedataformats', new lang_string('managedataformats'));
|
|
|
|
$temp->add(new admin_setting_managedataformats());
|
|
|
|
$ADMIN->add('dataformatsettings', $temp);
|
2009-12-16 18:00:58 +00:00
|
|
|
|
2022-03-16 09:40:11 +00:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('dataformat');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
|
|
|
/** @var \core\plugininfo\dataformat $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'dataformatsettings', $hassiteconfig);
|
|
|
|
}
|
|
|
|
|
2009-12-16 18:00:58 +00:00
|
|
|
//== Portfolio settings ==
|
|
|
|
require_once($CFG->libdir. '/portfoliolib.php');
|
2011-12-06 11:07:55 +13:00
|
|
|
$catname = new lang_string('portfolios', 'portfolio');
|
|
|
|
$manage = new lang_string('manageportfolios', 'portfolio');
|
2008-07-25 08:14:11 +00:00
|
|
|
$url = "$CFG->wwwroot/$CFG->admin/portfolio.php";
|
|
|
|
|
2008-08-26 05:45:07 +00:00
|
|
|
$ADMIN->add('modules', new admin_category('portfoliosettings', $catname, empty($CFG->enableportfolios)));
|
2008-07-25 08:14:11 +00:00
|
|
|
|
2010-11-08 17:12:03 +00:00
|
|
|
// Add manage page (with table)
|
|
|
|
$temp = new admin_page_manageportfolios();
|
|
|
|
$ADMIN->add('portfoliosettings', $temp);
|
|
|
|
|
|
|
|
// Add common settings page
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('manageportfolioscommon', new lang_string('commonportfoliosettings', 'portfolio'));
|
|
|
|
$temp->add(new admin_setting_heading('manageportfolioscommon', '', new lang_string('commonsettingsdesc', 'portfolio')));
|
2008-09-09 08:57:51 +00:00
|
|
|
$fileinfo = portfolio_filesize_info(); // make sure this is defined in one place since its used inside portfolio too to detect insane settings
|
|
|
|
$fileoptions = $fileinfo['options'];
|
|
|
|
$temp->add(new admin_setting_configselect(
|
|
|
|
'portfolio_moderate_filesize_threshold',
|
2011-12-06 11:07:55 +13:00
|
|
|
new lang_string('moderatefilesizethreshold', 'portfolio'),
|
|
|
|
new lang_string('moderatefilesizethresholddesc', 'portfolio'),
|
2008-09-09 08:57:51 +00:00
|
|
|
$fileinfo['moderate'], $fileoptions));
|
|
|
|
$temp->add(new admin_setting_configselect(
|
|
|
|
'portfolio_high_filesize_threshold',
|
2011-12-06 11:07:55 +13:00
|
|
|
new lang_string('highfilesizethreshold', 'portfolio'),
|
|
|
|
new lang_string('highfilesizethresholddesc', 'portfolio'),
|
2008-09-09 08:57:51 +00:00
|
|
|
$fileinfo['high'], $fileoptions));
|
|
|
|
|
|
|
|
$temp->add(new admin_setting_configtext(
|
|
|
|
'portfolio_moderate_db_threshold',
|
2011-12-06 11:07:55 +13:00
|
|
|
new lang_string('moderatedbsizethreshold', 'portfolio'),
|
|
|
|
new lang_string('moderatedbsizethresholddesc', 'portfolio'),
|
2012-05-11 10:49:51 +08:00
|
|
|
20, PARAM_INT, 3));
|
2008-09-09 08:57:51 +00:00
|
|
|
|
|
|
|
$temp->add(new admin_setting_configtext(
|
|
|
|
'portfolio_high_db_threshold',
|
2011-12-06 11:07:55 +13:00
|
|
|
new lang_string('highdbsizethreshold', 'portfolio'),
|
|
|
|
new lang_string('highdbsizethresholddesc', 'portfolio'),
|
2012-05-11 10:49:51 +08:00
|
|
|
50, PARAM_INT, 3));
|
2008-07-29 10:51:18 +00:00
|
|
|
|
|
|
|
$ADMIN->add('portfoliosettings', $temp);
|
2013-03-15 01:00:29 +01:00
|
|
|
$ADMIN->add('portfoliosettings', new admin_externalpage('portfolionew', new lang_string('addnewportfolio', 'portfolio'), $url, 'moodle/site:config', true));
|
|
|
|
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliodelete', new lang_string('deleteportfolio', 'portfolio'), $url, 'moodle/site:config', true));
|
|
|
|
$ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', new lang_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true));
|
2008-07-29 10:51:18 +00:00
|
|
|
|
2008-08-13 09:21:53 +00:00
|
|
|
foreach (portfolio_instances(false, false) as $portfolio) {
|
2009-11-18 13:27:38 +00:00
|
|
|
require_once($CFG->dirroot . '/portfolio/' . $portfolio->get('plugin') . '/lib.php');
|
2008-07-25 08:14:11 +00:00
|
|
|
$classname = 'portfolio_plugin_' . $portfolio->get('plugin');
|
2008-07-29 10:51:18 +00:00
|
|
|
$ADMIN->add(
|
|
|
|
'portfoliosettings',
|
2008-08-13 09:21:53 +00:00
|
|
|
new admin_externalpage(
|
|
|
|
'portfoliosettings' . $portfolio->get('id'),
|
2008-09-16 08:10:24 +00:00
|
|
|
$portfolio->get('name'),
|
2010-06-28 06:02:55 +00:00
|
|
|
$url . '?action=edit&pf=' . $portfolio->get('id'),
|
|
|
|
'moodle/site:config'
|
2013-03-22 14:40:12 +08:00
|
|
|
)
|
2008-07-29 10:51:18 +00:00
|
|
|
);
|
2008-07-25 08:14:11 +00:00
|
|
|
}
|
2008-08-13 04:09:13 +00:00
|
|
|
|
|
|
|
// repository setting
|
|
|
|
require_once("$CFG->dirroot/repository/lib.php");
|
2011-12-06 11:07:55 +13:00
|
|
|
$catname =new lang_string('repositories', 'repository');
|
|
|
|
$managerepo = new lang_string('manage', 'repository');
|
2008-08-19 03:56:52 +00:00
|
|
|
$url = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php';
|
2008-08-13 04:09:13 +00:00
|
|
|
$ADMIN->add('modules', new admin_category('repositorysettings', $catname));
|
2010-11-08 17:12:03 +00:00
|
|
|
|
|
|
|
// Add main page (with table)
|
|
|
|
$temp = new admin_page_managerepositories();
|
|
|
|
$ADMIN->add('repositorysettings', $temp);
|
|
|
|
|
|
|
|
// Add common settings page
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('managerepositoriescommon', new lang_string('commonrepositorysettings', 'repository'));
|
2013-10-11 14:34:15 +08:00
|
|
|
$temp->add(new admin_setting_configtext('repositorycacheexpire', new lang_string('cacheexpire', 'repository'), new lang_string('configcacheexpire', 'repository'), 120, PARAM_INT));
|
|
|
|
$temp->add(new admin_setting_configtext('repositorygetfiletimeout', new lang_string('getfiletimeout', 'repository'), new lang_string('configgetfiletimeout', 'repository'), 30, PARAM_INT));
|
|
|
|
$temp->add(new admin_setting_configtext('repositorysyncfiletimeout', new lang_string('syncfiletimeout', 'repository'), new lang_string('configsyncfiletimeout', 'repository'), 1, PARAM_INT));
|
|
|
|
$temp->add(new admin_setting_configtext('repositorysyncimagetimeout', new lang_string('syncimagetimeout', 'repository'), new lang_string('configsyncimagetimeout', 'repository'), 3, PARAM_INT));
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configcheckbox('repositoryallowexternallinks', new lang_string('allowexternallinks', 'repository'), new lang_string('configallowexternallinks', 'repository'), 1));
|
|
|
|
$temp->add(new admin_setting_configcheckbox('legacyfilesinnewcourses', new lang_string('legacyfilesinnewcourses', 'admin'), new lang_string('legacyfilesinnewcourses_help', 'admin'), 0));
|
2013-09-24 08:35:19 -04:00
|
|
|
$temp->add(new admin_setting_configcheckbox('legacyfilesaddallowed', new lang_string('legacyfilesaddallowed', 'admin'), new lang_string('legacyfilesaddallowed_help', 'admin'), 1));
|
2008-08-13 04:09:13 +00:00
|
|
|
$ADMIN->add('repositorysettings', $temp);
|
2008-09-03 09:53:35 +00:00
|
|
|
$ADMIN->add('repositorysettings', new admin_externalpage('repositorynew',
|
2013-03-15 01:00:29 +01:00
|
|
|
new lang_string('addplugin', 'repository'), $url, 'moodle/site:config', true));
|
2008-08-13 04:09:13 +00:00
|
|
|
$ADMIN->add('repositorysettings', new admin_externalpage('repositorydelete',
|
2013-03-15 01:00:29 +01:00
|
|
|
new lang_string('deleterepository', 'repository'), $url, 'moodle/site:config', true));
|
2008-08-13 04:09:13 +00:00
|
|
|
$ADMIN->add('repositorysettings', new admin_externalpage('repositorycontroller',
|
2013-03-15 01:00:29 +01:00
|
|
|
new lang_string('manage', 'repository'), $url, 'moodle/site:config', true));
|
2008-09-04 07:36:53 +00:00
|
|
|
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstancenew',
|
2013-03-15 01:00:29 +01:00
|
|
|
new lang_string('createrepository', 'repository'), $url, 'moodle/site:config', true));
|
2008-09-04 07:36:53 +00:00
|
|
|
$ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit',
|
2013-03-15 01:00:29 +01:00
|
|
|
new lang_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true));
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('repository');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\repository $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'repositorysettings', $hassiteconfig);
|
2008-08-13 04:09:13 +00:00
|
|
|
}
|
2012-09-27 14:48:10 +08:00
|
|
|
}
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
|
2021-06-24 22:49:04 +10:00
|
|
|
// Question bank settings.
|
|
|
|
if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
|
|
|
|
$ADMIN->add('modules', new admin_category('qbanksettings',
|
2021-06-25 00:08:16 +10:00
|
|
|
new lang_string('type_qbank_plural', 'plugin')));
|
2021-06-24 22:49:04 +10:00
|
|
|
$temp = new admin_settingpage('manageqbanks', new lang_string('manageqbanks', 'admin'));
|
|
|
|
$temp->add(new \core_question\admin\manage_qbank_plugins_page());
|
|
|
|
$ADMIN->add('qbanksettings', $temp);
|
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('qbank');
|
2021-06-15 09:54:56 -04:00
|
|
|
|
2021-06-24 22:49:04 +10:00
|
|
|
foreach ($plugins as $plugin) {
|
|
|
|
/** @var \core\plugininfo\qbank $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'qbanksettings', $hassiteconfig);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-11 13:47:06 +00:00
|
|
|
// Question type settings
|
2009-12-16 18:00:58 +00:00
|
|
|
if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) {
|
2012-10-16 16:16:32 +01:00
|
|
|
|
MDL-27490 Implement a manage question behaviours admin page
While doing this, I found various bugs in the manages question types admin page, and so fixed them, and updated the code
there to use $OUTPUT and html_writer.
AMOS BEGIN
MOV [cannotdeletemissingqtype,admin],[cannotdeletemissingqtype,question]
MOV [cannotdeleteqtypeinuse,admin],[cannotdeleteqtypeinuse,question]
MOV [cannotdeleteqtypeneeded,admin],[cannotdeleteqtypeneeded,question]
MOV [deleteqtypeareyousure,admin],[deleteqtypeareyousure,question]
MOV [deleteqtypeareyousuremessage,admin],[deleteqtypeareyousuremessage,question]
MOV [deletingqtype,admin],[deletingqtype,question]
MOV [numquestions,admin],[numquestions,question]
MOV [numquestionsandhidden,admin],[numquestionsandhidden,question]
MOV [qtypedeletefiles,admin],[qtypedeletefiles,question]
MOV [uninstallqtype,admin],[uninstallqtype,question]
AMOS END
2011-06-15 20:18:33 +01:00
|
|
|
// Question behaviour settings.
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('qbehavioursettings', new lang_string('questionbehaviours', 'admin')));
|
MDL-27490 Implement a manage question behaviours admin page
While doing this, I found various bugs in the manages question types admin page, and so fixed them, and updated the code
there to use $OUTPUT and html_writer.
AMOS BEGIN
MOV [cannotdeletemissingqtype,admin],[cannotdeletemissingqtype,question]
MOV [cannotdeleteqtypeinuse,admin],[cannotdeleteqtypeinuse,question]
MOV [cannotdeleteqtypeneeded,admin],[cannotdeleteqtypeneeded,question]
MOV [deleteqtypeareyousure,admin],[deleteqtypeareyousure,question]
MOV [deleteqtypeareyousuremessage,admin],[deleteqtypeareyousuremessage,question]
MOV [deletingqtype,admin],[deletingqtype,question]
MOV [numquestions,admin],[numquestions,question]
MOV [numquestionsandhidden,admin],[numquestionsandhidden,question]
MOV [qtypedeletefiles,admin],[qtypedeletefiles,question]
MOV [uninstallqtype,admin],[uninstallqtype,question]
AMOS END
2011-06-15 20:18:33 +01:00
|
|
|
$ADMIN->add('qbehavioursettings', new admin_page_manageqbehaviours());
|
|
|
|
|
2008-09-09 08:57:51 +00:00
|
|
|
// Question type settings.
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('qtypesettings', new lang_string('questiontypes', 'admin')));
|
2008-09-09 08:57:51 +00:00
|
|
|
$ADMIN->add('qtypesettings', new admin_page_manageqtypes());
|
2012-10-16 16:16:32 +01:00
|
|
|
|
|
|
|
// Question preview defaults.
|
|
|
|
$settings = new admin_settingpage('qdefaultsetting',
|
|
|
|
get_string('questionpreviewdefaults', 'question'),
|
|
|
|
'moodle/question:config');
|
|
|
|
$ADMIN->add('qtypesettings', $settings);
|
|
|
|
|
|
|
|
$settings->add(new admin_setting_heading('qdefaultsetting_preview_options',
|
|
|
|
'', get_string('questionpreviewdefaults_desc', 'question')));
|
|
|
|
|
|
|
|
// These keys are question_display_options::HIDDEN and VISIBLE.
|
|
|
|
$hiddenofvisible = array(
|
|
|
|
0 => get_string('notshown', 'question'),
|
|
|
|
1 => get_string('shown', 'question'),
|
|
|
|
);
|
|
|
|
|
|
|
|
$settings->add(new admin_setting_question_behaviour('question_preview/behaviour',
|
|
|
|
get_string('howquestionsbehave', 'question'), '',
|
|
|
|
'deferredfeedback'));
|
|
|
|
|
|
|
|
$settings->add(new admin_setting_configselect('question_preview/correctness',
|
|
|
|
get_string('whethercorrect', 'question'), '', 1, $hiddenofvisible));
|
|
|
|
|
|
|
|
// These keys are question_display_options::HIDDEN, MARK_ONLY and MARK_AND_MAX.
|
|
|
|
$marksoptions = array(
|
|
|
|
0 => get_string('notshown', 'question'),
|
|
|
|
1 => get_string('showmaxmarkonly', 'question'),
|
|
|
|
2 => get_string('showmarkandmax', 'question'),
|
|
|
|
);
|
|
|
|
$settings->add(new admin_setting_configselect('question_preview/marks',
|
2014-09-07 12:57:45 +01:00
|
|
|
get_string('marks', 'question'), '', 2, $marksoptions));
|
2012-10-16 16:16:32 +01:00
|
|
|
|
|
|
|
$settings->add(new admin_setting_configselect('question_preview/markdp',
|
|
|
|
get_string('decimalplacesingrades', 'question'), '', 2, array(0, 1, 2, 3, 4, 5, 6, 7)));
|
|
|
|
|
|
|
|
$settings->add(new admin_setting_configselect('question_preview/feedback',
|
|
|
|
get_string('specificfeedback', 'question'), '', 1, $hiddenofvisible));
|
|
|
|
|
|
|
|
$settings->add(new admin_setting_configselect('question_preview/generalfeedback',
|
|
|
|
get_string('generalfeedback', 'question'), '', 1, $hiddenofvisible));
|
|
|
|
|
|
|
|
$settings->add(new admin_setting_configselect('question_preview/rightanswer',
|
|
|
|
get_string('rightanswer', 'question'), '', 1, $hiddenofvisible));
|
|
|
|
|
|
|
|
$settings->add(new admin_setting_configselect('question_preview/history',
|
|
|
|
get_string('responsehistory', 'question'), '', 0, $hiddenofvisible));
|
|
|
|
|
|
|
|
// Settings for particular question types.
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('qtype');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\qtype $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'qtypesettings', $hassiteconfig);
|
2008-09-09 08:57:51 +00:00
|
|
|
}
|
2007-12-19 17:35:20 +00:00
|
|
|
}
|
2011-03-11 13:47:06 +00:00
|
|
|
|
|
|
|
// Plagiarism plugin settings
|
2010-09-20 07:32:31 +00:00
|
|
|
if ($hassiteconfig && !empty($CFG->enableplagiarism)) {
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('plagiarism', new lang_string('plagiarism', 'plagiarism')));
|
2012-07-26 13:48:40 +12:00
|
|
|
$ADMIN->add('plagiarism', new admin_externalpage('manageplagiarismplugins', new lang_string('manageplagiarism', 'plagiarism'),
|
|
|
|
$CFG->wwwroot . '/' . $CFG->admin . '/plagiarism.php'));
|
|
|
|
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('plagiarism');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\plagiarism $plugin */
|
2012-09-19 12:34:47 +08:00
|
|
|
$plugin->load_settings($ADMIN, 'plagiarism', $hassiteconfig);
|
2010-09-20 07:32:31 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-30 17:06:12 +01:00
|
|
|
|
|
|
|
// Comments report, note this page is really just a means to delete comments so check that.
|
|
|
|
$ADMIN->add('reports', new admin_externalpage('comments', new lang_string('comments'), $CFG->wwwroot . '/comment/index.php',
|
|
|
|
'moodle/comment:delete'));
|
2008-11-28 08:04:23 +00:00
|
|
|
|
2011-03-11 13:47:06 +00:00
|
|
|
// Course reports settings
|
|
|
|
if ($hassiteconfig) {
|
|
|
|
$pages = array();
|
2013-07-16 22:36:11 +02:00
|
|
|
foreach (core_component::get_plugin_list('coursereport') as $report => $path) {
|
2011-03-11 13:47:06 +00:00
|
|
|
$file = $CFG->dirroot . '/course/report/' . $report . '/settings.php';
|
|
|
|
if (file_exists($file)) {
|
|
|
|
$settings = new admin_settingpage('coursereport' . $report,
|
2011-12-06 11:07:55 +13:00
|
|
|
new lang_string('pluginname', 'coursereport_' . $report), 'moodle/site:config');
|
2011-03-11 13:47:06 +00:00
|
|
|
// settings.php may create a subcategory or unset the settings completely
|
|
|
|
include($file);
|
|
|
|
if ($settings) {
|
|
|
|
$pages[] = $settings;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!empty($pages)) {
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('coursereports', new lang_string('coursereports')));
|
2016-05-16 18:09:59 +07:00
|
|
|
core_collator::asort_objects_by_property($pages, 'visiblename');
|
2011-03-11 13:47:06 +00:00
|
|
|
foreach ($pages as $page) {
|
|
|
|
$ADMIN->add('coursereports', $page);
|
|
|
|
}
|
|
|
|
}
|
2011-11-02 09:04:48 +01:00
|
|
|
unset($pages);
|
2011-03-11 13:47:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Now add reports
|
2011-11-02 09:04:48 +01:00
|
|
|
$pages = array();
|
2013-07-16 22:36:11 +02:00
|
|
|
foreach (core_component::get_plugin_list('report') as $report => $plugindir) {
|
2009-06-19 14:25:56 +00:00
|
|
|
$settings_path = "$plugindir/settings.php";
|
2008-11-28 08:04:23 +00:00
|
|
|
if (file_exists($settings_path)) {
|
2011-11-02 09:04:48 +01:00
|
|
|
$settings = new admin_settingpage('report' . $report,
|
2011-12-06 11:07:55 +13:00
|
|
|
new lang_string('pluginname', 'report_' . $report), 'moodle/site:config');
|
2008-11-28 08:04:23 +00:00
|
|
|
include($settings_path);
|
2011-11-02 09:04:48 +01:00
|
|
|
if ($settings) {
|
|
|
|
$pages[] = $settings;
|
|
|
|
}
|
2008-11-28 08:04:23 +00:00
|
|
|
}
|
2011-11-02 09:04:48 +01:00
|
|
|
}
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('reportplugins', new lang_string('reports')));
|
|
|
|
$ADMIN->add('reportplugins', new admin_externalpage('managereports', new lang_string('reportsmanage', 'admin'),
|
2011-11-06 12:48:37 +01:00
|
|
|
$CFG->wwwroot . '/' . $CFG->admin . '/reports.php'));
|
2016-05-16 18:09:59 +07:00
|
|
|
core_collator::asort_objects_by_property($pages, 'visiblename');
|
2011-11-06 12:48:37 +01:00
|
|
|
foreach ($pages as $page) {
|
|
|
|
$ADMIN->add('reportplugins', $page);
|
2008-11-28 08:04:23 +00:00
|
|
|
}
|
|
|
|
|
2016-02-24 10:46:15 +08:00
|
|
|
if ($hassiteconfig) {
|
|
|
|
// Global Search engine plugins.
|
|
|
|
$ADMIN->add('modules', new admin_category('searchplugins', new lang_string('search', 'admin')));
|
|
|
|
$temp = new admin_settingpage('manageglobalsearch', new lang_string('globalsearchmanage', 'admin'));
|
2016-02-19 14:46:37 +08:00
|
|
|
|
2016-02-24 10:46:15 +08:00
|
|
|
$pages = array();
|
|
|
|
$engines = array();
|
|
|
|
foreach (core_component::get_plugin_list('search') as $engine => $plugindir) {
|
|
|
|
$engines[$engine] = new lang_string('pluginname', 'search_' . $engine);
|
|
|
|
$settingspath = "$plugindir/settings.php";
|
|
|
|
if (file_exists($settingspath)) {
|
|
|
|
$settings = new admin_settingpage('search' . $engine,
|
|
|
|
new lang_string('pluginname', 'search_' . $engine), 'moodle/site:config');
|
|
|
|
include($settingspath);
|
|
|
|
if ($settings) {
|
|
|
|
$pages[] = $settings;
|
|
|
|
}
|
2016-02-19 14:46:37 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-24 10:46:15 +08:00
|
|
|
// Setup status.
|
|
|
|
$temp->add(new admin_setting_searchsetupinfo());
|
|
|
|
|
|
|
|
// Search engine selection.
|
|
|
|
$temp->add(new admin_setting_heading('searchengineheading', new lang_string('searchengine', 'admin'), ''));
|
2020-05-15 17:20:28 +01:00
|
|
|
$searchengineselect = new admin_setting_configselect('searchengine',
|
|
|
|
new lang_string('selectsearchengine', 'admin'), '', 'simpledb', $engines);
|
|
|
|
$searchengineselect->set_validate_function(function(string $value): string {
|
|
|
|
global $CFG;
|
|
|
|
|
|
|
|
// Check nobody's setting the indexing and query-only server to the same one.
|
2020-08-14 17:48:57 +02:00
|
|
|
if (isset($CFG->searchenginequeryonly) && $CFG->searchenginequeryonly === $value) {
|
2020-05-15 17:20:28 +01:00
|
|
|
return get_string('searchenginequeryonlysame', 'admin');
|
|
|
|
} else {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$temp->add($searchengineselect);
|
2017-08-24 11:28:18 +01:00
|
|
|
$temp->add(new admin_setting_heading('searchoptionsheading', new lang_string('searchoptions', 'admin'), ''));
|
2017-05-25 18:19:06 +01:00
|
|
|
$temp->add(new admin_setting_configcheckbox('searchindexwhendisabled',
|
|
|
|
new lang_string('searchindexwhendisabled', 'admin'), new lang_string('searchindexwhendisabled_desc', 'admin'),
|
|
|
|
0));
|
|
|
|
$temp->add(new admin_setting_configduration('searchindextime',
|
|
|
|
new lang_string('searchindextime', 'admin'), new lang_string('searchindextime_desc', 'admin'),
|
|
|
|
600));
|
2019-01-07 11:16:35 +11:00
|
|
|
$temp->add(new admin_setting_heading('searchcoursesheading', new lang_string('searchablecourses', 'admin'), ''));
|
2017-08-24 11:28:18 +01:00
|
|
|
$options = [
|
|
|
|
0 => new lang_string('searchallavailablecourses_off', 'admin'),
|
|
|
|
1 => new lang_string('searchallavailablecourses_on', 'admin')
|
|
|
|
];
|
|
|
|
$temp->add(new admin_setting_configselect('searchallavailablecourses',
|
|
|
|
new lang_string('searchallavailablecourses', 'admin'),
|
2019-01-07 11:16:35 +11:00
|
|
|
new lang_string('searchallavailablecoursesdesc', 'admin'),
|
2017-08-24 11:28:18 +01:00
|
|
|
0, $options));
|
2019-01-07 11:16:35 +11:00
|
|
|
$temp->add(new admin_setting_configcheckbox('searchincludeallcourses',
|
|
|
|
new lang_string('searchincludeallcourses', 'admin'), new lang_string('searchincludeallcourses_desc', 'admin'),
|
|
|
|
0));
|
2016-02-24 10:46:15 +08:00
|
|
|
|
2019-01-23 10:28:43 +11:00
|
|
|
// Search display options.
|
|
|
|
$temp->add(new admin_setting_heading('searchdisplay', new lang_string('searchdisplay', 'admin'), ''));
|
|
|
|
$temp->add(new admin_setting_configcheckbox('searchenablecategories',
|
|
|
|
new lang_string('searchenablecategories', 'admin'),
|
|
|
|
new lang_string('searchenablecategories_desc', 'admin'),
|
|
|
|
0));
|
|
|
|
$options = [];
|
|
|
|
foreach (\core_search\manager::get_search_area_categories() as $category) {
|
|
|
|
$options[$category->get_name()] = $category->get_visiblename();
|
|
|
|
}
|
|
|
|
$temp->add(new admin_setting_configselect('searchdefaultcategory',
|
|
|
|
new lang_string('searchdefaultcategory', 'admin'),
|
|
|
|
new lang_string('searchdefaultcategory_desc', 'admin'),
|
|
|
|
\core_search\manager::SEARCH_AREA_CATEGORY_ALL, $options));
|
|
|
|
$temp->add(new admin_setting_configcheckbox('searchhideallcategory',
|
|
|
|
new lang_string('searchhideallcategory', 'admin'),
|
|
|
|
new lang_string('searchhideallcategory_desc', 'admin'),
|
|
|
|
0));
|
|
|
|
|
2020-03-30 09:05:41 +11:00
|
|
|
// Top result options.
|
|
|
|
$temp->add(new admin_setting_heading('searchtopresults', new lang_string('searchtopresults', 'admin'), ''));
|
|
|
|
// Max Top results.
|
|
|
|
$options = range(0, 10);
|
|
|
|
$temp->add(new admin_setting_configselect('searchmaxtopresults',
|
|
|
|
new lang_string('searchmaxtopresults', 'admin'),
|
|
|
|
new lang_string('searchmaxtopresults_desc', 'admin'),
|
|
|
|
3, $options));
|
|
|
|
// Teacher roles.
|
|
|
|
$options = [];
|
2021-10-19 14:20:15 +01:00
|
|
|
foreach (role_get_names() as $role) {
|
|
|
|
$options[$role->id] = $role->localname;
|
2020-03-30 09:05:41 +11:00
|
|
|
}
|
|
|
|
$temp->add(new admin_setting_configmultiselect('searchteacherroles',
|
|
|
|
new lang_string('searchteacherroles', 'admin'),
|
|
|
|
new lang_string('searchteacherroles_desc', 'admin'),
|
|
|
|
[], $options));
|
|
|
|
|
2020-05-15 17:20:28 +01:00
|
|
|
$temp->add(new admin_setting_heading('searchmanagement', new lang_string('searchmanagement', 'admin'),
|
|
|
|
new lang_string('searchmanagement_desc', 'admin')));
|
|
|
|
|
|
|
|
// Get list of search engines including those with alternate settings.
|
|
|
|
$searchenginequeryonlyselect = new admin_setting_configselect('searchenginequeryonly',
|
|
|
|
new lang_string('searchenginequeryonly', 'admin'),
|
|
|
|
new lang_string('searchenginequeryonly_desc', 'admin'), '', function() use($engines) {
|
|
|
|
$options = ['' => new lang_string('searchenginequeryonly_none', 'admin')];
|
|
|
|
foreach ($engines as $name => $display) {
|
|
|
|
$options[$name] = $display;
|
|
|
|
|
|
|
|
$classname = '\search_' . $name . '\engine';
|
|
|
|
$engine = new $classname;
|
|
|
|
if ($engine->has_alternate_configuration()) {
|
|
|
|
$options[$name . '-alternate'] =
|
|
|
|
new lang_string('searchenginealternatesettings', 'admin', $display);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $options;
|
|
|
|
});
|
|
|
|
$searchenginequeryonlyselect->set_validate_function(function(string $value): string {
|
|
|
|
global $CFG;
|
|
|
|
|
|
|
|
// Check nobody's setting the indexing and query-only server to the same one.
|
2020-08-14 17:48:57 +02:00
|
|
|
if (isset($CFG->searchengine) && $CFG->searchengine === $value) {
|
2020-05-15 17:20:28 +01:00
|
|
|
return get_string('searchenginequeryonlysame', 'admin');
|
|
|
|
} else {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$temp->add($searchenginequeryonlyselect);
|
|
|
|
$temp->add(new admin_setting_configcheckbox('searchbannerenable',
|
|
|
|
new lang_string('searchbannerenable', 'admin'), new lang_string('searchbannerenable_desc', 'admin'),
|
|
|
|
0));
|
|
|
|
$temp->add(new admin_setting_confightmleditor('searchbanner',
|
|
|
|
new lang_string('searchbanner', 'admin'), '', ''));
|
|
|
|
|
2016-02-24 10:46:15 +08:00
|
|
|
$ADMIN->add('searchplugins', $temp);
|
2016-04-08 16:23:12 +01:00
|
|
|
$ADMIN->add('searchplugins', new admin_externalpage('searchareas', new lang_string('searchareas', 'admin'),
|
|
|
|
new moodle_url('/admin/searchareas.php')));
|
2016-02-19 14:46:37 +08:00
|
|
|
|
2016-05-16 18:09:59 +07:00
|
|
|
core_collator::asort_objects_by_property($pages, 'visiblename');
|
2016-02-24 10:46:15 +08:00
|
|
|
foreach ($pages as $page) {
|
|
|
|
$ADMIN->add('searchplugins', $page);
|
|
|
|
}
|
2016-02-19 14:46:37 +08:00
|
|
|
}
|
|
|
|
|
2012-03-06 13:30:28 +00:00
|
|
|
/// Add all admin tools
|
|
|
|
if ($hassiteconfig) {
|
|
|
|
$ADMIN->add('modules', new admin_category('tools', new lang_string('tools', 'admin')));
|
|
|
|
$ADMIN->add('tools', new admin_externalpage('managetools', new lang_string('toolsmanage', 'admin'),
|
|
|
|
$CFG->wwwroot . '/' . $CFG->admin . '/tools.php'));
|
|
|
|
}
|
|
|
|
|
2013-10-04 22:40:44 +02:00
|
|
|
// Now add various admin tools.
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('tool');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\tool $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, null, $hassiteconfig);
|
2011-09-17 08:43:58 +02:00
|
|
|
}
|
2009-06-19 14:25:56 +00:00
|
|
|
|
2012-09-17 08:41:40 +12:00
|
|
|
// Now add the Cache plugins
|
|
|
|
if ($hassiteconfig) {
|
|
|
|
$ADMIN->add('modules', new admin_category('cache', new lang_string('caching', 'cache')));
|
|
|
|
$ADMIN->add('cache', new admin_externalpage('cacheconfig', new lang_string('cacheconfig', 'cache'), $CFG->wwwroot .'/cache/admin.php'));
|
|
|
|
$ADMIN->add('cache', new admin_externalpage('cachetestperformance', new lang_string('testperformance', 'cache'), $CFG->wwwroot . '/cache/testperformance.php'));
|
2021-09-20 18:04:02 +01:00
|
|
|
$ADMIN->add('cache', new admin_externalpage('cacheusage',
|
|
|
|
new lang_string('cacheusage', 'cache'), $CFG->wwwroot . '/cache/usage.php'));
|
2012-09-17 08:41:40 +12:00
|
|
|
$ADMIN->add('cache', new admin_category('cachestores', new lang_string('cachestores', 'cache')));
|
2016-05-16 18:09:59 +07:00
|
|
|
$ADMIN->locate('cachestores')->set_sorting(true);
|
2013-07-16 22:36:11 +02:00
|
|
|
foreach (core_component::get_plugin_list('cachestore') as $plugin => $path) {
|
2012-09-17 08:41:40 +12:00
|
|
|
$settingspath = $path.'/settings.php';
|
|
|
|
if (file_exists($settingspath)) {
|
2012-09-17 10:04:47 +12:00
|
|
|
$settings = new admin_settingpage('cachestore_'.$plugin.'_settings', new lang_string('pluginname', 'cachestore_'.$plugin), 'moodle/site:config');
|
2012-09-17 08:41:40 +12:00
|
|
|
include($settingspath);
|
|
|
|
$ADMIN->add('cachestores', $settings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-21 17:14:07 +08:00
|
|
|
// Add Calendar type settings.
|
|
|
|
if ($hassiteconfig) {
|
|
|
|
$ADMIN->add('modules', new admin_category('calendartype', new lang_string('calendartypes', 'calendar')));
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('calendartype');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2015-11-27 08:49:04 +08:00
|
|
|
/** @var \core\plugininfo\calendartype $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, 'calendartype', $hassiteconfig);
|
2013-11-21 17:14:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-01 16:23:33 +02:00
|
|
|
// Content bank content types.
|
|
|
|
if ($hassiteconfig) {
|
2020-06-15 13:35:43 +02:00
|
|
|
$ADMIN->add('modules', new admin_category('contentbanksettings', new lang_string('contentbank')));
|
2020-04-01 16:23:33 +02:00
|
|
|
$temp = new admin_settingpage('managecontentbanktypes', new lang_string('managecontentbanktypes'));
|
|
|
|
$temp->add(new admin_setting_managecontentbankcontenttypes());
|
2020-06-15 13:35:43 +02:00
|
|
|
$ADMIN->add('contentbanksettings', $temp);
|
2020-04-01 16:23:33 +02:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('contenttype');
|
|
|
|
foreach ($plugins as $plugin) {
|
|
|
|
/** @var \core\plugininfo\contentbank $plugin */
|
2020-06-15 13:35:43 +02:00
|
|
|
$plugin->load_settings($ADMIN, 'contentbanksettings', $hassiteconfig);
|
2020-04-01 16:23:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-19 14:25:56 +00:00
|
|
|
/// Add all local plugins - must be always last!
|
2010-02-08 16:03:37 +00:00
|
|
|
if ($hassiteconfig) {
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('modules', new admin_category('localplugins', new lang_string('localplugins')));
|
|
|
|
$ADMIN->add('localplugins', new admin_externalpage('managelocalplugins', new lang_string('localpluginsmanage'),
|
2010-02-08 16:03:37 +00:00
|
|
|
$CFG->wwwroot . '/' . $CFG->admin . '/localplugins.php'));
|
|
|
|
}
|
2009-06-19 14:25:56 +00:00
|
|
|
|
2013-10-04 22:40:44 +02:00
|
|
|
// Extend settings for each local plugin. Note that their settings may be in any part of the
|
|
|
|
// settings tree and may be visible not only for administrators.
|
2016-05-16 18:09:59 +07:00
|
|
|
$plugins = core_plugin_manager::instance()->get_plugins_of_type('local');
|
|
|
|
core_collator::asort_objects_by_property($plugins, 'displayname');
|
|
|
|
foreach ($plugins as $plugin) {
|
2013-10-04 22:40:44 +02:00
|
|
|
/** @var \core\plugininfo\local $plugin */
|
|
|
|
$plugin->load_settings($ADMIN, null, $hassiteconfig);
|
2009-07-24 02:44:44 +00:00
|
|
|
}
|