/** * setup administrator links and settings * * @param object $admin */ public static function set_adminsettings($admin) { $me = new self(); $me->grab_moodle_globals(); $context = context_course::instance(SITEID); $admin->add('localplugins', new admin_category('wspeoplesoft', $me->get_string('name'))); //$admin->add('wspeoplesoft', new admin_externalpage('pathxmlwspeoplesoft', $me->get_string('insertpath'), $me->get_config('wwwroot') . '/local/globalmessage/index.php?id=' . SITEID, 'moodle/site:config', false, $context)); $temp = new admin_settingpage('wspeoplesoftsettings', $me->get_string('wssettings')); $temp->add(new admin_setting_configcheckbox('wspeoplesoftcourseenable', $me->get_string('wsenabledcourse'), $me->get_string('enabledcoursedesc'), 0)); $temp->add(new admin_setting_configtext('wspeoplesoftcoursepath', $me->get_string('insertpathcourse'), $me->get_string('insertpathcoursedesc'), null, PARAM_TEXT)); $temp->add(new admin_setting_configcheckbox('wspeoplesoftuserenable', $me->get_string('wsenableduser'), $me->get_string('enableduserdesc'), 0)); $temp->add(new admin_setting_configtext('wspeoplesoftuserpath', $me->get_string('insertpathuser'), $me->get_string('insertpathuserdesc'), null, PARAM_TEXT)); $temp->add(new admin_setting_configcheckbox('wspeoplesoftmemberenable', $me->get_string('wsenabledmember'), $me->get_string('enabledmemberdesc'), 0)); $temp->add(new admin_setting_configtext('wspeoplesoftmemberpath', $me->get_string('insertpathmembers'), $me->get_string('insertpathmemberdesc'), null, PARAM_TEXT)); $temp->add(new admin_setting_configtext('wspeoplesofttoken', $me->get_string('wstoken'), $me->get_string('wstokendesc'), null, PARAM_TEXT)); $admin->add('wspeoplesoft', $temp); }
// 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/>. /** * Settings for module resource * * All the resourcelib specific functions, needed to implement the module * logic, should go here. Never include this file from your lib.php! * * @package local_courseblog * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; global $CFG, $PAGE; $ADMIN->add('localplugins', new admin_category('local_courseblog', get_string('pluginname', 'local_courseblog'))); $page = new admin_settingpage('courseblog', get_string('pluginname', 'local_courseblog')); $page->add(new admin_setting_configtext('local_courseblog/title', get_string('blog_title', 'local_courseblog'), null, null)); $ADMIN->add('local_courseblog', $page); $ADMIN->add('local_courseblog', new admin_externalpage('local_courseblog_categories', get_string('manage_categories', 'local_courseblog'), $CFG->wwwroot . '/local/courseblog/categories.php')); $ADMIN->add('local_courseblog', new admin_externalpage('local_courseblog_entries', get_string('manage_entries', 'local_courseblog'), $CFG->wwwroot . '/local/courseblog/entries.php'));
$temp->add($setting); // Slideshow Image FX $name = 'theme_lambda/slideshow_imgfx'; $title = get_string('slideshow_imgfx', 'theme_lambda'); $description = get_string('slideshow_imgfx_desc', 'theme_lambda'); $setting = new admin_setting_configtext($name, $title, $description, 'random', PARAM_URL); $temp->add($setting); // Slideshow Text FX $name = 'theme_lambda/slideshow_txtfx'; $title = get_string('slideshow_txtfx', 'theme_lambda'); $description = get_string('slideshow_txtfx_desc', 'theme_lambda'); $setting = new admin_setting_configtext($name, $title, $description, 'moveFromLeft', PARAM_URL); $temp->add($setting); $ADMIN->add('theme_lambda', $temp); // "frontpage carousel" settingpage $temp = new admin_settingpage('theme_lambda_carousel', get_string('settings_carousel', 'theme_lambda')); $temp->add(new admin_setting_heading('theme_lambda_carousel', get_string('carouselheadingsub', 'theme_lambda'), format_text(get_string('carouseldesc', 'theme_lambda'), FORMAT_MARKDOWN))); // Position $name = 'theme_lambda/carousel_position'; $title = get_string('carousel_position', 'theme_lambda'); $description = get_string('carousel_positiondesc', 'theme_lambda'); $default = '1'; $choices = array('0' => 'top', '1' => 'bottom'); $setting = new admin_setting_configselect($name, $title, $description, $default, $choices); $setting->set_updatedcallback('theme_reset_all_caches'); $temp->add($setting); // Heading $name = 'theme_lambda/carousel_h'; $title = get_string('carousel_h', 'theme_lambda'); $description = get_string('carousel_h_desc', 'theme_lambda'); $default = '';
} else { $securewwwroot = str_replace('http:', 'https:', $CFG->wwwroot); } // stuff under the "accounts" subcategory $ADMIN->add('accounts', new admin_externalpage('editusers', new lang_string('userlist', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/user.php", array('moodle/user:update', 'moodle/user:delete'))); if ($rolename != 'subadmin') { $ADMIN->add('accounts', new admin_externalpage('userbulk', new lang_string('userbulk', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete'))); } $ADMIN->add('accounts', new admin_externalpage('addnewuser', new lang_string('addnewuser'), "{$securewwwroot}/user/editadvanced.php?id=-1", 'moodle/user:create')); $ADMIN->add('accounts', new admin_externalpage('profilefields', new lang_string('profilefields', 'admin'), "{$CFG->wwwroot}/user/profile/index.php", 'moodle/site:config')); if ($rolename != 'subadmin') { $ADMIN->add('accounts', new admin_externalpage('cohorts', new lang_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view'))); } // stuff under the "roles" subcategory // "userpolicies" settingpage $temp = new admin_settingpage('userpolicies', new lang_string('userpolicies', 'admin')); if ($ADMIN->fulltree) { if (!during_initial_install()) { $context = context_system::instance(); $otherroles = array(); $guestroles = array(); $userroles = array(); $creatornewroles = array(); $defaultteacherid = null; $defaultuserid = null; $defaultguestid = null; $roles = role_fix_names(get_all_roles(), null, ROLENAME_ORIGINALANDSHORT); foreach ($roles as $role) { $rolename = $role->localname; switch ($role->archetype) { case 'manager':
// // 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/>. /** * Atto text editor integration version file. * * @package atto_morefontcolors * @copyright 2014 Université de Lausanne * @author Nicolas Dunand <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; $ADMIN->add('editoratto', new admin_category('atto_morefontcolors', new lang_string('pluginname', 'atto_morefontcolors'))); $settings = new admin_settingpage('atto_morefontcolors_settings', new lang_string('pluginname', 'atto_morefontcolors')); if ($ADMIN->fulltree) { $name = new lang_string('availablecolors', 'atto_morefontcolors'); $desc = new lang_string('availablecolors_desc', 'atto_morefontcolors'); $default = '#FFFFFF #EF4540 #FFCF35 #98CA3E #7D9FD3 #333333'; $setting = new admin_setting_configtextarea('atto_morefontcolors/availablecolors', $name, $desc, $default); $settings->add($setting); }
if (empty($CFG->loginhttps)) { $securewwwroot = $CFG->wwwroot; } else { $securewwwroot = str_replace('http:', 'https:', $CFG->wwwroot); } // stuff under the "accounts" subcategory $ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/user.php", array('moodle/user:update', 'moodle/user:delete'))); $ADMIN->add('accounts', new admin_externalpage('userbulk', get_string('userbulk', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete'))); $ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "{$securewwwroot}/user/editadvanced.php?id=-1", 'moodle/user:create')); $ADMIN->add('accounts', new admin_externalpage('uploadusers', get_string('uploadusers'), "{$CFG->wwwroot}/{$CFG->admin}/uploaduser.php", 'moodle/site:uploadusers')); $ADMIN->add('accounts', new admin_externalpage('uploadpictures', get_string('uploadpictures', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/uploadpicture.php", 'moodle/site:uploadusers')); $ADMIN->add('accounts', new admin_externalpage('profilefields', get_string('profilefields', 'admin'), "{$CFG->wwwroot}/user/profile/index.php", 'moodle/site:config')); // stuff under the "roles" subcategory $ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role'))); // "userpolicies" settingpage $temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin')); if ($ADMIN->fulltree) { if (!empty($CFG->rolesactive)) { $context = get_context_instance(CONTEXT_SYSTEM); if (!($guestrole = get_guest_role())) { $guestrole->id = 0; } if ($studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) { $studentrole = array_shift($studentroles); /// Take the first one } else { $studentrole->id = 0; } if ($userroles = get_roles_with_capability('moodle/legacy:user', CAP_ALLOW)) { $userrole = array_shift($userroles); /// Take the first one
$temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL)); $temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0)); $ADMIN->add('appearance', $temp); $temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php'); $ADMIN->add('appearance', $temp); $temp = new admin_externalpage('profilepage', new lang_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php'); $ADMIN->add('appearance', $temp); // coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc. $temp = new admin_settingpage('coursecontact', new lang_string('courses')); $temp->add(new admin_setting_special_coursecontact()); $temp->add(new admin_setting_configcheckbox('courselistshortnames', new lang_string('courselistshortnames', 'admin'), new lang_string('courselistshortnames_desc', 'admin'), 0)); $ADMIN->add('appearance', $temp); $temp = new admin_settingpage('ajax', new lang_string('ajaxuse')); $temp->add(new admin_setting_configcheckbox('enableajax', new lang_string('enableajax', 'admin'), new lang_string('configenableajax', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('useexternalyui', new lang_string('useexternalyui', 'admin'), new lang_string('configuseexternalyui', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1)); $setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1); $setting->set_updatedcallback('js_reset_all_caches'); $temp->add($setting); $temp->add(new admin_setting_configcheckbox('modchooserdefault', new lang_string('modchooserdefault', 'admin'), new lang_string('configmodchooserdefault', 'admin'), 1)); $ADMIN->add('appearance', $temp); // link to tag management interface $ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), "{$CFG->wwwroot}/tag/manage.php")); $temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin')); $temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin'))); $temp->add(new admin_setting_configtextarea('additionalhtmlhead', new lang_string('additionalhtmlhead', 'admin'), new lang_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW)); $temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', new lang_string('additionalhtmltopofbody', 'admin'), new lang_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW)); $temp->add(new admin_setting_configtextarea('additionalhtmlfooter', new lang_string('additionalhtmlfooter', 'admin'), new lang_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW)); $ADMIN->add('appearance', $temp); } // end of speedup
$temp = new admin_settingpage('cleanup', new lang_string('cleanup', 'admin')); $temp->add(new admin_setting_configselect('deleteunconfirmed', new lang_string('deleteunconfirmed', 'admin'), new lang_string('configdeleteunconfirmed', 'admin'), 168, array(0 => new lang_string('never'), 168 => new lang_string('numdays', '', 7), 144 => new lang_string('numdays', '', 6), 120 => new lang_string('numdays', '', 5), 96 => new lang_string('numdays', '', 4), 72 => new lang_string('numdays', '', 3), 48 => new lang_string('numdays', '', 2), 24 => new lang_string('numdays', '', 1), 12 => new lang_string('numhours', '', 12), 6 => new lang_string('numhours', '', 6), 1 => new lang_string('numhours', '', 1)))); $temp->add(new admin_setting_configselect('deleteincompleteusers', new lang_string('deleteincompleteusers', 'admin'), new lang_string('configdeleteincompleteusers', 'admin'), 0, array(0 => new lang_string('never'), 168 => new lang_string('numdays', '', 7), 144 => new lang_string('numdays', '', 6), 120 => new lang_string('numdays', '', 5), 96 => new lang_string('numdays', '', 4), 72 => new lang_string('numdays', '', 3), 48 => new lang_string('numdays', '', 2), 24 => new lang_string('numdays', '', 1)))); $temp->add(new admin_setting_configcheckbox('logguests', new lang_string('logguests', 'admin'), new lang_string('logguests_help', 'admin'), 1)); $temp->add(new admin_setting_configselect('loglifetime', new lang_string('loglifetime', 'admin'), new lang_string('configloglifetime', 'admin'), 0, array(0 => new lang_string('neverdeletelogs'), 1000 => new lang_string('numdays', '', 1000), 365 => new lang_string('numdays', '', 365), 180 => new lang_string('numdays', '', 180), 150 => new lang_string('numdays', '', 150), 120 => new lang_string('numdays', '', 120), 90 => new lang_string('numdays', '', 90), 60 => new lang_string('numdays', '', 60), 35 => new lang_string('numdays', '', 35), 10 => new lang_string('numdays', '', 10), 5 => new lang_string('numdays', '', 5), 2 => new lang_string('numdays', '', 2)))); $temp->add(new admin_setting_configcheckbox('disablegradehistory', new lang_string('disablegradehistory', 'grades'), new lang_string('disablegradehistory_help', 'grades'), 0)); $temp->add(new admin_setting_configselect('gradehistorylifetime', new lang_string('gradehistorylifetime', 'grades'), new lang_string('gradehistorylifetime_help', 'grades'), 0, array(0 => new lang_string('neverdeletehistory', 'grades'), 1000 => new lang_string('numdays', '', 1000), 365 => new lang_string('numdays', '', 365), 180 => new lang_string('numdays', '', 180), 150 => new lang_string('numdays', '', 150), 120 => new lang_string('numdays', '', 120), 90 => new lang_string('numdays', '', 90), 60 => new lang_string('numdays', '', 60), 30 => new lang_string('numdays', '', 30)))); $ADMIN->add('server', $temp); $ADMIN->add('server', new admin_externalpage('environment', new lang_string('environment', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/environment.php")); $ADMIN->add('server', new admin_externalpage('phpinfo', new lang_string('phpinfo'), "{$CFG->wwwroot}/{$CFG->admin}/phpinfo.php")); // "performance" settingpage $temp = new admin_settingpage('performance', new lang_string('performance', 'admin')); $temp->add(new admin_setting_configtext('numcoursesincombo', new lang_string('numcoursesincombo', 'admin'), new lang_string('numcoursesincombo_help', 'admin'), 500)); $temp->add(new admin_setting_configselect('extramemorylimit', new lang_string('extramemorylimit', 'admin'), new lang_string('configextramemorylimit', 'admin'), '512M', array('64M' => '64M', '128M' => '128M', '256M' => '256M', '512M' => '512M', '1024M' => '1024M'))); $temp->add(new admin_setting_configtext('curlcache', new lang_string('curlcache', 'admin'), new lang_string('configcurlcache', 'admin'), 120, PARAM_INT)); $temp->add(new admin_setting_configtext('curltimeoutkbitrate', new lang_string('curltimeoutkbitrate', 'admin'), new lang_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT)); $ADMIN->add('server', $temp); $ADMIN->add('server', new admin_externalpage('adminregistration', new lang_string('hubs', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/registration/index.php")); // "update notifications" settingpage if (empty($CFG->disableupdatenotifications)) { $temp = new admin_settingpage('updatenotifications', new lang_string('updatenotifications', 'core_admin')); $temp->add(new admin_setting_configcheckbox('updateautocheck', new lang_string('updateautocheck', 'core_admin'), new lang_string('updateautocheck_desc', 'core_admin'), 1)); if (empty($CFG->disableupdateautodeploy)) { $temp->add(new admin_setting_configcheckbox('updateautodeploy', new lang_string('updateautodeploy', 'core_admin'), new lang_string('updateautodeploy_desc', 'core_admin'), 0)); } $temp->add(new admin_setting_configselect('updateminmaturity', new lang_string('updateminmaturity', 'core_admin'), new lang_string('updateminmaturity_desc', 'core_admin'), MATURITY_STABLE, array(MATURITY_ALPHA => new lang_string('maturity' . MATURITY_ALPHA, 'core_admin'), MATURITY_BETA => new lang_string('maturity' . MATURITY_BETA, 'core_admin'), MATURITY_RC => new lang_string('maturity' . MATURITY_RC, 'core_admin'), MATURITY_STABLE => new lang_string('maturity' . MATURITY_STABLE, 'core_admin')))); $temp->add(new admin_setting_configcheckbox('updatenotifybuilds', new lang_string('updatenotifybuilds', 'core_admin'), new lang_string('updatenotifybuilds_desc', 'core_admin'), 0)); $ADMIN->add('server', $temp); } } // end of speedup
if ($strreportname[0] == '[') { $textlib = textlib_get_instance(); $strreportname = $textlib->strtotitle($report . ' report'); } $reportsbyname[$strreportname] = $report; } } ksort($reportsbyname); } // Create the organizer settings page. if (empty($reportsbyname)) { $pagetitle = get_string('modulename', 'organizer'); } else { $pagetitle = get_string('generalsettings', 'admin'); } $organizersettings = new admin_settingpage('modsettingorganizer', $pagetitle, 'moodle/site:config'); // Introductory explanation that all the settings are defaults for the add quiz form. $organizersettings->add(new admin_setting_heading('organizerintro', '', get_string('configintro', 'organizer'))); // Set modintro required (default) or optional $organizersettings->add(new admin_setting_configcheckbox('organizer/requiremodintro', get_string('requiremodintro', 'organizer'), get_string('configrequiremodintro', 'organizer'), 1)); // Maximum grade $organizersettings->add(new admin_setting_configtext('organizer/maximumgrade', get_string('maximumgrade'), get_string('configmaximumgrade', 'organizer'), 10, PARAM_INT)); // E-mail teachers $pickeroptions = array(); $pickeroptions[ORGANIZER_MESSAGES_NONE] = get_string('messages_none', 'organizer'); $pickeroptions[ORGANIZER_MESSAGES_RE_UNREG] = get_string('messages_re_unreg', 'organizer'); $pickeroptions[ORGANIZER_MESSAGES_ALL] = get_string('messages_all', 'organizer'); // Appointment digest $organizersettings->add(new admin_setting_configselect('organizer/emailteachers', get_string('configemailteachers_label', 'organizer'), get_string('configemailteachers', 'organizer'), 1, $pickeroptions)); $pickeroptions = array(); $pickeroptions['never'] = get_string('configdontsend', 'organizer');
$temp = new admin_settingpage('modulesecurity', get_string('modulesecurity', 'admin')); $temp->add(new admin_setting_configselect('restrictmodulesfor', get_string('restrictmodulesfor', 'admin'), get_string('configrestrictmodulesfor', 'admin'), 'none', array('none' => 'No courses', 'all' => 'All courses', 'requested' => 'Requested courses'))); $temp->add(new admin_setting_configcheckbox('restrictbydefault', get_string('restrictbydefault', 'admin'), get_string('configrestrictbydefault', 'admin'), 0)); if (!($options = get_records("modules"))) { $options = array(); } $options2 = array(); foreach ($options as $option) { $options2[$option->id] = $option->name; } $temp->add(new admin_setting_configmultiselect('defaultallowedmodules', get_string('defaultallowedmodules', 'admin'), get_string('configdefaultallowedmodules', 'admin'), array(), $options2)); $ADMIN->add('security', $temp); // "notifications" settingpage $temp = new admin_settingpage('notifications', get_string('notifications', 'admin')); $temp->add(new admin_setting_configselect('displayloginfailures', get_string('displayloginfailures', 'admin'), get_string('configdisplayloginfailures', 'admin'), '', array('' => get_string('nobody'), 'admin' => get_string('administrators'), 'teacher' => get_string('administratorsandteachers'), 'everybody' => get_string('everybody')))); $temp->add(new admin_setting_configselect('notifyloginfailures', get_string('notifyloginfailures', 'admin'), get_string('confignotifyloginfailures', 'admin'), '', array('' => get_string('nobody'), 'mainadmin' => get_string('administrator'), 'alladmins' => get_string('administratorsall')))); $options = array(); for ($i = 1; $i <= 100; $i++) { $options[$i] = $i; } $temp->add(new admin_setting_configselect('notifyloginthreshold', get_string('notifyloginthreshold', 'admin'), get_string('confignotifyloginthreshold', 'admin'), '10', $options)); $ADMIN->add('security', $temp); // "antivirus" settingpage $temp = new admin_settingpage('antivirus', get_string('antivirus', 'admin')); $temp->add(new admin_setting_configcheckbox('runclamonupload', get_string('runclamavonupload', 'admin'), get_string('configrunclamavonupload', 'admin'), 0)); $temp->add(new admin_setting_configexecutable('pathtoclam', get_string('pathtoclam', 'admin'), get_string('configpathtoclam', 'admin'), '')); $temp->add(new admin_setting_configdirectory('quarantinedir', get_string('quarantinedir', 'admin'), get_string('configquarantinedir', 'admin'), '')); $temp->add(new admin_setting_configselect('clamfailureonupload', get_string('clamfailureonupload', 'admin'), get_string('configclamfailureonupload', 'admin'), 'donothing', array('donothing' => get_string('configclamdonothing', 'admin'), 'actlikevirus' => get_string('configclamactlikevirus', 'admin')))); $ADMIN->add('security', $temp); } // end of speedup
// 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/>. /** * An activity to interface with WebEx. * * @package mod_webexactvity * @author Eric Merrill <*****@*****.**> * @copyright 2014 Oakland University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; // Create a settings page object to add to. $settings = new admin_settingpage($section, get_string('settings', 'mod_webexactivity'), 'moodle/site:config', $module->is_enabled() === false); // Build up the full settings page if we need it. if ($ADMIN->fulltree) { // --------------------------------------------------- // API Settings. // --------------------------------------------------- $settings->add(new admin_setting_heading('apisettings', get_string('apisettings', 'mod_webexactivity'), '')); $settings->add(new admin_setting_configtext('webexactivity/sitename', get_string('sitename', 'mod_webexactivity'), get_string('sitename_help', 'mod_webexactivity'), '')); $settings->add(new admin_setting_configtext('webexactivity/apiusername', get_string('apiusername', 'mod_webexactivity'), get_string('apiusername_help', 'mod_webexactivity'), '')); $settings->add(new admin_setting_configpasswordunmask('webexactivity/apipassword', get_string('apipassword', 'mod_webexactivity'), get_string('apipassword_help', 'mod_webexactivity'), '')); $settings->add(new admin_setting_configtext('webexactivity/prefix', get_string('prefix', 'mod_webexactivity'), get_string('prefix_help', 'mod_webexactivity'), 'mdl_')); // --------------------------------------------------- // Meeting Types. // --------------------------------------------------- $settings->add(new admin_setting_heading('meetingtypes', get_string('meetingtypes', 'mod_webexactivity'), get_string('meetingtypes_desc', 'mod_webexactivity'))); $typeopts = array(\mod_webexactivity\webex::WEBEXACTIVITY_TYPE_INSTALLED => get_string('typeinstalled', 'mod_webexactivity'), \mod_webexactivity\webex::WEBEXACTIVITY_TYPE_ALL => get_string('typeforall', 'mod_webexactivity'), \mod_webexactivity\webex::WEBEXACTIVITY_TYPE_PASSWORD_REQUIRED => get_string('typepwreq', 'mod_webexactivity'));
*/ defined('MOODLE_INTERNAL') || die; if ($hassiteconfig) { $ADMIN->add('root', new admin_category('mobileapp', new lang_string('mobileapp', 'tool_mobile')), 'development'); $temp = new admin_settingpage('mobilesettings', new lang_string('mobilesettings', 'tool_mobile'), 'moodle/site:config', false); // We should wait to the installation to finish since we depend on some configuration values that are set once // the admin user profile is configured. if (!during_initial_install()) { $enablemobiledocurl = new moodle_url(get_docs_url('Enable_mobile_web_services')); $enablemobiledoclink = html_writer::link($enablemobiledocurl, new lang_string('documentation')); $default = is_https() ? 1 : 0; $temp->add(new admin_setting_enablemobileservice('enablemobilewebservice', new lang_string('enablemobilewebservice', 'admin'), new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), $default)); } $ADMIN->add('mobileapp', $temp); // Show only mobile settings if the mobile service is enabled. if (!empty($CFG->enablemobilewebservice)) { // Type of login. $temp = new admin_settingpage('mobileauthentication', new lang_string('mobileauthentication', 'tool_mobile')); $options = array(tool_mobile\api::LOGIN_VIA_APP => new lang_string('loginintheapp', 'tool_mobile'), tool_mobile\api::LOGIN_VIA_BROWSER => new lang_string('logininthebrowser', 'tool_mobile'), tool_mobile\api::LOGIN_VIA_EMBEDDED_BROWSER => new lang_string('loginintheembeddedbrowser', 'tool_mobile')); $temp->add(new admin_setting_configselect('tool_mobile/typeoflogin', new lang_string('typeoflogin', 'tool_mobile'), new lang_string('typeoflogin_desc', 'tool_mobile'), 1, $options)); $temp->add(new admin_setting_configtext('tool_mobile/forcedurlscheme', new lang_string('forcedurlscheme_key', 'tool_mobile'), new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_NOTAGS)); $ADMIN->add('mobileapp', $temp); // Appearance related settings. $temp = new admin_settingpage('mobileappearance', new lang_string('mobileappearance', 'tool_mobile')); $temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'tool_mobile'), new lang_string('configmobilecssurl', 'tool_mobile'), '', PARAM_URL)); $temp->add(new admin_setting_heading('tool_mobile/smartappbanners', new lang_string('smartappbanners', 'tool_mobile'), '')); $temp->add(new admin_setting_configcheckbox('tool_mobile/enablesmartappbanners', new lang_string('enablesmartappbanners', 'tool_mobile'), new lang_string('enablesmartappbanners_desc', 'tool_mobile'), 0)); $temp->add(new admin_setting_configtext('tool_mobile/iosappid', new lang_string('iosappid', 'tool_mobile'), new lang_string('iosappid_desc', 'tool_mobile'), '633359593', PARAM_ALPHANUM)); $ADMIN->add('mobileapp', $temp); } }
// 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/>. /** * Inbound Message Settings. * * @package tool_messageinbound * @copyright 2014 Andrew Nicols * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; if ($hassiteconfig) { $category = new admin_category('messageinbound', new lang_string('incomingmailconfiguration', 'tool_messageinbound')); // Create a settings page for all of the mail server settings. $settings = new admin_settingpage('messageinbound_mailsettings', new lang_string('mailsettings', 'tool_messageinbound')); $settings->add(new admin_setting_heading('messageinbound_generalconfiguration', new lang_string('messageinboundgeneralconfiguration', 'tool_messageinbound'), new lang_string('messageinboundgeneralconfiguration_desc', 'tool_messageinbound'), '')); $settings->add(new admin_setting_configcheckbox('messageinbound_enabled', new lang_string('messageinboundenabled', 'tool_messageinbound'), new lang_string('messageinboundenabled_desc', 'tool_messageinbound'), 0)); // These settings are used when generating a Inbound Message address. $settings->add(new admin_setting_heading('messageinbound_mailboxconfiguration', new lang_string('mailboxconfiguration', 'tool_messageinbound'), new lang_string('messageinboundmailboxconfiguration_desc', 'tool_messageinbound'), '')); $settings->add(new admin_setting_configtext('messageinbound_mailbox', new lang_string('mailbox', 'tool_messageinbound'), null, '', PARAM_RAW)); $settings->add(new admin_setting_configtext('messageinbound_domain', new lang_string('domain', 'tool_messageinbound'), null, '', PARAM_RAW)); // These settings are used when checking the incoming mailbox for mail. $settings->add(new admin_setting_heading('messageinbound_serversettings', new lang_string('incomingmailserversettings', 'tool_messageinbound'), new lang_string('incomingmailserversettings_desc', 'tool_messageinbound'), '')); $settings->add(new admin_setting_configtext('messageinbound_host', new lang_string('messageinboundhost', 'tool_messageinbound'), new lang_string('configmessageinboundhost', 'tool_messageinbound'), '', PARAM_RAW)); $options = array('' => get_string('noencryption', 'tool_messageinbound'), 'ssl' => get_string('ssl', 'tool_messageinbound'), 'sslv2' => get_string('sslv2', 'tool_messageinbound'), 'sslv3' => get_string('sslv3', 'tool_messageinbound'), 'tls' => get_string('tls', 'tool_messageinbound'), 'tlsv1' => get_string('tlsv1', 'tool_messageinbound')); $settings->add(new admin_setting_configselect('messageinbound_hostssl', new lang_string('messageinboundhostssl', 'tool_messageinbound'), new lang_string('messageinboundhostssl_desc', 'tool_messageinbound'), 'ssl', $options)); $settings->add(new admin_setting_configtext('messageinbound_hostuser', new lang_string('messageinboundhostuser', 'tool_messageinbound'), new lang_string('messageinboundhostuser_desc', 'tool_messageinbound'), '', PARAM_NOTAGS)); $settings->add(new admin_setting_configpasswordunmask('messageinbound_hostpass', new lang_string('messageinboundhostpass', 'tool_messageinbound'), new lang_string('messageinboundhostpass_desc', 'tool_messageinbound'), '')); $category->add('messageinbound', $settings); // Link to the external page for Inbound Message handler configuration.
/** * setup administrator links and settings * * @param object $admin */ public static function set_adminsettings($admin) { $me = new self(); $me->grab_moodle_globals(); $context = context_course::instance(SITEID); $admin->add('localplugins', new admin_category('globalmessage', $me->get_string('globalmessage'))); $admin->add('globalmessage', new admin_externalpage('globalmessagemanage', $me->get_string('globalmessagemanage'), $me->get_config('wwwroot') . '/local/globalmessage/index.php?id=' . SITEID, 'moodle/site:config', false, $context)); $admin->add('globalmessage', new admin_externalpage('globalmessageabout', $me->get_string('globalmessageabout'), $me->get_config('wwwroot') . '/local/globalmessage/index.php?action=about&id=' . SITEID, 'moodle/site:config', false, $context)); $temp = new admin_settingpage('globalmessagesettings', $me->get_string('globalmessagesettings')); $temp->add(new admin_setting_configcheckbox('globalmessageenable', $me->get_string_fromcore('enable'), $me->get_string('globalmessageenabledesc'), 1)); $temp->add(new admin_setting_configcheckbox('globalmessagedisableforadminrole', $me->get_string('disableforadminrole'), $me->get_string('disableforadminroledesc'), 0)); $temp->add(new admin_setting_configcheckbox('globalmessagedisableforadminpage', $me->get_string('disableforadminpage'), $me->get_string('disableforadminpagedesc'), 0)); $admin->add('globalmessage', $temp); }
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see http://opensource.org/licenses/gpl-3.0.html. * * @copyright Copyright (c) 2009 Moodlerooms Inc. (http://www.moodlerooms.com) * @license http://opensource.org/licenses/gpl-3.0.html GNU Public License * @package local_mr * @author Mark Nielsen */ defined('MOODLE_INTERNAL') or die('Direct access to this script is forbidden.'); if (defined('MR_CACHE_TEST') or defined('MR_DOCS')) { $ADMIN->add('root', new admin_category('local_mr', get_string('mrframework', 'local_mr'))); } if (defined('MR_CACHE_TEST')) { $lifetimes = array(0 => get_string('never'), MINSECS * 10 => get_string('xminutes', 'local_mr', 10), MINSECS * 30 => get_string('xminutes', 'local_mr', 30), HOURSECS => get_string('xhours', 'local_mr', 1), HOURSECS * 4 => get_string('xhours', 'local_mr', 4), HOURSECS * 12 => get_string('xhours', 'local_mr', 12), DAYSECS => get_string('xdays', 'local_mr', 1), WEEKSECS => get_string('xweeks', 'local_mr', 1), WEEKSECS * 4 => get_string('xweeks', 'local_mr', 4)); $settings = array(); $settings[] = new admin_setting_heading('cache_heading', get_string('cache_heading', 'local_mr'), get_string('cache_headingdesc', 'local_mr', $CFG->wwwroot . '/local/mr/view.php?action=cleancache')); $settings[] = new admin_setting_configselect('cache_lifetime', get_string('cache_lifetime', 'local_mr'), get_string('cache_lifetimedesc', 'local_mr'), 0, $lifetimes); // Define the config plugin so it is saved to // the config_plugin table then add to the settings page $page = new admin_settingpage('local_mr_cache', get_string('mrcache', 'local_mr')); foreach ($settings as $setting) { $setting->plugin = 'local/mr'; $page->add($setting); } $ADMIN->add('local_mr', $page); } if (defined('MR_DOCS')) { $ADMIN->add('local_mr', new admin_externalpage('local_mr_docs', get_string('local_mr_docs', 'local_mr'), "{$CFG->wwwroot}/local/mr/view.php?action=docs")); }
$settingsfile = $path . '/settings.php'; if (file_exists($settingsfile)) { $settings = new admin_settingpage('qtypesetting' . $qtype, get_string('pluginname', 'qtype_' . $qtype), 'moodle/question:config'); include($settingsfile); if ($settings) { $ADMIN->add('qtypesettings', $settings); } } } } // Plagiarism plugin settings if ($hassiteconfig && !empty($CFG->enableplagiarism)) { $ADMIN->add('modules', new admin_category('plagiarism', get_string('plagiarism', 'plagiarism'))); $temp = new admin_settingpage('plagiarismsettings', get_string('plagiarismsettings', 'plagiarism')); $temp->add(new admin_setting_manageplagiarism()); $ADMIN->add('plagiarism', $temp); foreach (get_plugin_list('plagiarism') as $plugin => $plugindir) { if (file_exists($plugindir.'/settings.php')) { $ADMIN->add('plagiarism', new admin_externalpage('plagiarism'.$plugin, get_string($plugin, 'plagiarism_'.$plugin), "$CFG->wwwroot/plagiarism/$plugin/settings.php", 'moodle/site:config')); } } } $ADMIN->add('reports', new admin_externalpage('comments', get_string('comments'), $CFG->wwwroot.'/comment/', 'moodle/site:viewreports')); // Course reports settings if ($hassiteconfig) { $pages = array(); foreach (get_plugin_list('coursereport') as $report => $path) { $file = $CFG->dirroot . '/course/report/' . $report . '/settings.php';
$options = array(0 => get_string('disable'), 1 => get_string('enable')); $temp->add(new admin_setting_configselect('maintenance_enabled', get_string('sitemaintenancemode', 'admin'), get_string('helpsitemaintenance', 'admin'), 0, $options)); $temp->add(new admin_setting_confightmleditor('maintenance_message', get_string('optionalmaintenancemessage', 'admin'), '', '')); $ADMIN->add('server', $temp); $temp = new admin_settingpage('cleanup', get_string('cleanup', 'admin')); $temp->add(new admin_setting_configselect('deleteunconfirmed', get_string('deleteunconfirmed', 'admin'), get_string('configdeleteunconfirmed', 'admin'), 168, array(0 => get_string('never'), 168 => get_string('numdays', '', 7), 144 => get_string('numdays', '', 6), 120 => get_string('numdays', '', 5), 96 => get_string('numdays', '', 4), 72 => get_string('numdays', '', 3), 48 => get_string('numdays', '', 2), 24 => get_string('numdays', '', 1), 12 => get_string('numhours', '', 12), 6 => get_string('numhours', '', 6), 1 => get_string('numhours', '', 1)))); $temp->add(new admin_setting_configselect('deleteincompleteusers', get_string('deleteincompleteusers', 'admin'), get_string('configdeleteincompleteusers', 'admin'), 0, array(0 => get_string('never'), 168 => get_string('numdays', '', 7), 144 => get_string('numdays', '', 6), 120 => get_string('numdays', '', 5), 96 => get_string('numdays', '', 4), 72 => get_string('numdays', '', 3), 48 => get_string('numdays', '', 2), 24 => get_string('numdays', '', 1)))); $temp->add(new admin_setting_configcheckbox('logguests', get_string('logguests', 'admin'), get_string('logguests_help', 'admin'), 1)); $temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'), 1000 => get_string('numdays', '', 1000), 365 => get_string('numdays', '', 365), 180 => get_string('numdays', '', 180), 150 => get_string('numdays', '', 150), 120 => get_string('numdays', '', 120), 90 => get_string('numdays', '', 90), 60 => get_string('numdays', '', 60), 35 => get_string('numdays', '', 35), 10 => get_string('numdays', '', 10), 5 => get_string('numdays', '', 5), 2 => get_string('numdays', '', 2)))); $temp->add(new admin_setting_configcheckbox('disablegradehistory', get_string('disablegradehistory', 'grades'), get_string('disablegradehistory_help', 'grades'), 0)); $temp->add(new admin_setting_configselect('gradehistorylifetime', get_string('gradehistorylifetime', 'grades'), get_string('gradehistorylifetime_help', 'grades'), 0, array(0 => get_string('neverdeletehistory', 'grades'), 1000 => get_string('numdays', '', 1000), 365 => get_string('numdays', '', 365), 180 => get_string('numdays', '', 180), 150 => get_string('numdays', '', 150), 120 => get_string('numdays', '', 120), 90 => get_string('numdays', '', 90), 60 => get_string('numdays', '', 60), 30 => get_string('numdays', '', 30)))); $ADMIN->add('server', $temp); $ADMIN->add('server', new admin_externalpage('environment', get_string('environment', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/environment.php")); $ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "{$CFG->wwwroot}/{$CFG->admin}/phpinfo.php")); // "performance" settingpage $temp = new admin_settingpage('performance', get_string('performance', 'admin')); $temp->add(new admin_setting_configtext('numcoursesincombo', get_string('numcoursesincombo', 'admin'), get_string('numcoursesincombo_help', 'admin'), 500)); $temp->add(new admin_setting_configselect('extramemorylimit', get_string('extramemorylimit', 'admin'), get_string('configextramemorylimit', 'admin'), '512M', array('64M' => '64M', '128M' => '128M', '256M' => '256M', '512M' => '512M', '1024M' => '1024M'))); $temp->add(new admin_setting_configtext('curlcache', get_string('curlcache', 'admin'), get_string('configcurlcache', 'admin'), 120, PARAM_INT)); $temp->add(new admin_setting_configtext('curltimeoutkbitrate', get_string('curltimeoutkbitrate', 'admin'), get_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT)); /* //TODO: we need to fix code instead of relying on slow rcache, enable this once we have some code that is actually using it $temp->add(new admin_setting_special_selectsetup('cachetype', get_string('cachetype', 'admin'), get_string('configcachetype', 'admin'), '', array( '' => get_string('none'), 'internal' => 'internal', 'memcached' => 'memcached', 'eaccelerator' => 'eaccelerator'))); // NOTE: $CFG->rcache is forced to bool in lib/setup.php $temp->add(new admin_setting_special_selectsetup('rcache', get_string('rcache', 'admin'), get_string('configrcache', 'admin'), 0, array( '0' => get_string('no'),
$default = ''; $setting = new admin_setting_configtextarea($name, $title, $description, $default); $setting->set_updatedcallback('theme_reset_all_caches'); $temp->add($setting); // Footnote setting. $name = 'theme_even_more/footnote'; $title = get_string('footnote', 'theme_even_more'); $description = get_string('footnotedesc', 'theme_even_more'); $default = ''; $setting = new admin_setting_confightmleditor($name, $title, $description, $default); $setting->set_updatedcallback('theme_reset_all_caches'); $temp->add($setting); //add the general settings page to the EvenMore entry (i.e. nest the general settings under EvenMore) $ADMIN->add('theme_even_more', $temp); //create a front page blocks settings page $temp = new admin_settingpage('theme_even_more_frontpage', get_string('frontpagesettings', 'theme_even_more')); $temp->add(new admin_setting_heading('theme_even_more_frontpage', get_string('frontpagesettingsheading', 'theme_even_more'), format_text(get_string('frontpagesettingsdescription', 'theme_even_more'), FORMAT_MARKDOWN))); //slidershow images $name = 'theme_even_more/blocksliderimage1'; $title = get_string('blocksliderimage1', 'theme_even_more'); $description = get_string('blocksliderimage1description', 'theme_even_more'); $default = ''; $setting = new admin_setting_configstoredfile($name, $title, $description, 'blocksliderimage1'); $setting->set_updatedcallback('theme_reset_all_caches'); $temp->add($setting); $name = 'theme_even_more/blocksliderimage1url'; $title = get_string('blocksliderimage1url', 'theme_even_more'); $description = get_string('blocksliderimage1urldescription', 'theme_even_more'); $default = ''; $setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL); $setting->set_updatedcallback('theme_reset_all_caches');
$defaults = array('value' => 0, 'forced' => false, 'adv' => true); $temp->add(new admin_setting_gradecat_combo('grade_aggregateoutcomes', new lang_string('aggregateoutcomes', 'grades'), new lang_string('aggregateoutcomes_help', 'grades'), $defaults, $options)); $options = array(0 => new lang_string('none')); for ($i = 1; $i <= 20; $i++) { $options[$i] = $i; } $defaults['value'] = 0; $defaults['forced'] = true; $temp->add(new admin_setting_gradecat_combo('grade_keephigh', new lang_string('keephigh', 'grades'), new lang_string('keephigh_help', 'grades'), $defaults, $options)); $defaults['forced'] = false; $temp->add(new admin_setting_gradecat_combo('grade_droplow', new lang_string('droplow', 'grades'), new lang_string('droplow_help', 'grades'), $defaults, $options)); $temp->add(new admin_setting_configcheckbox('grade_overridecat', new lang_string('overridecat', 'grades'), new lang_string('overridecat_help', 'grades'), 1)); } $ADMIN->add('grades', $temp); /// Grade item settings $temp = new admin_settingpage('gradeitemsettings', new lang_string('gradeitemsettings', 'grades'), 'moodle/grade:manage'); if ($ADMIN->fulltree) { $temp->add(new admin_setting_configselect('grade_displaytype', new lang_string('gradedisplaytype', 'grades'), new lang_string('gradedisplaytype_help', 'grades'), GRADE_DISPLAY_TYPE_REAL, $display_types)); $temp->add(new admin_setting_configselect('grade_decimalpoints', new lang_string('decimalpoints', 'grades'), new lang_string('decimalpoints_help', 'grades'), 2, array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5'))); $temp->add(new admin_setting_configmultiselect('grade_item_advanced', new lang_string('gradeitemadvanced', 'grades'), new lang_string('gradeitemadvanced_help', 'grades'), array('iteminfo', 'idnumber', 'gradepass', 'plusfactor', 'multfactor', 'display', 'decimals', 'hiddenuntil', 'locktime'), array('iteminfo' => new lang_string('iteminfo', 'grades'), 'idnumber' => new lang_string('idnumbermod'), 'gradetype' => new lang_string('gradetype', 'grades'), 'scaleid' => new lang_string('scale'), 'grademin' => new lang_string('grademin', 'grades'), 'grademax' => new lang_string('grademax', 'grades'), 'gradepass' => new lang_string('gradepass', 'grades'), 'plusfactor' => new lang_string('plusfactor', 'grades'), 'multfactor' => new lang_string('multfactor', 'grades'), 'display' => new lang_string('gradedisplaytype', 'grades'), 'decimals' => new lang_string('decimalpoints', 'grades'), 'hidden' => new lang_string('hidden', 'grades'), 'hiddenuntil' => new lang_string('hiddenuntil', 'grades'), 'locked' => new lang_string('locked', 'grades'), 'locktime' => new lang_string('locktime', 'grades'), 'aggregationcoef' => new lang_string('aggregationcoef', 'grades'), 'parentcategory' => new lang_string('parentcategory', 'grades')))); } $ADMIN->add('grades', $temp); /// Scales and outcomes $scales = new admin_externalpage('scales', new lang_string('scales'), $CFG->wwwroot . '/grade/edit/scale/index.php', 'moodle/grade:manage'); $ADMIN->add('grades', $scales); if (!empty($CFG->enableoutcomes)) { $outcomes = new admin_externalpage('outcomes', new lang_string('outcomes', 'grades'), $CFG->wwwroot . '/grade/edit/outcome/index.php', 'moodle/grade:manage'); $ADMIN->add('grades', $outcomes); } $letters = new admin_externalpage('letters', new lang_string('letters', 'grades'), $CFG->wwwroot . '/grade/edit/letter/index.php', 'moodle/grade:manageletters'); $ADMIN->add('grades', $letters);
<?php /** * Add page to menu. * * @package local_pearson * @copyright * @license */ defined('MOODLE_INTERNAL') || die; if ($hassiteconfig) { // needs this condition or there is error on login page require_once $CFG->dirroot . '/local/pearson/locallib.php'; $settings = new admin_settingpage('local_pearson', get_string('pearson_config_title', 'local_pearson')); $strConfigPageText = get_string('pearson_config_text', 'local_pearson'); $html = '<p>' . $strConfigPageText . '</p>'; if (pearsondirect_showkeymasterlink()) { $html .= '</br>'; $html .= '<a href="' . pearsondirect_getkeymasterlink() . '" target="_blank">' . get_string('pearson_keymaster_link', 'local_pearson') . '</a>'; } $settings->add(new admin_setting_heading('pearson_config_heading', get_string('pearson_config_heading', 'local_pearson'), format_text($html, FORMAT_HTML))); $settings->add(new admin_setting_configtext('pearson_url', get_string('pearson_url_label', 'local_pearson'), get_string('pearson_url_desc', 'local_pearson'), '', PARAM_TEXT)); $settings->add(new admin_setting_configtext('pearson_key', get_string('pearson_key_label', 'local_pearson'), get_string('pearson_key_desc', 'local_pearson'), '', PARAM_TEXT)); $settings->add(new admin_setting_configtext('pearson_secret', get_string('pearson_secret_label', 'local_pearson'), get_string('pearson_secret_desc', 'local_pearson'), '', PARAM_TEXT)); $settings->add(new admin_setting_configcheckbox('pearson_use_icons', get_string('pearson_use_icons_label', 'local_pearson'), get_string('pearson_use_icons_desc', 'local_pearson'), 1)); $ADMIN->add('localplugins', $settings); }
<?php // $Id$ // "locations" settingpage $temp = new admin_settingpage('locationsettings', get_string('locationsettings', 'admin')); $options = get_list_of_timezones(); $options[99] = get_string('serverlocaltime'); $temp->add(new admin_setting_configselect('timezone', get_string('timezone', 'admin'), get_string('configtimezone', 'admin'), 99, $options)); $options[99] = get_string('timezonenotforced', 'admin'); $temp->add(new admin_setting_configselect('forcetimezone', get_string('forcetimezone', 'admin'), get_string('helpforcetimezone', 'admin'), 99, $options)); $options = get_list_of_countries(); $options[0] = get_string('choose') . '...'; $temp->add(new admin_setting_configselect('country', get_string('country', 'admin'), get_string('configcountry', 'admin'), 0, $options)); $iplookups = array(); if ($plugins = get_list_of_plugins('iplookup')) { foreach ($plugins as $plugin) { $iplookups[$plugin] = $plugin; } } $temp->add(new admin_setting_configselect('iplookup', get_string('iplookup', 'admin'), get_string('configiplookup', 'admin'), 'hostip', $iplookups)); $ADMIN->add('location', $temp); $ADMIN->add('location', new admin_externalpage('timezoneimport', get_string('updatetimezones', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/timezoneimport.php"));
// 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/>. /** * This file adds the settings pages to the navigation menu * * @package mod_assign * @copyright 2012 NetSpot {@link http://www.netspot.com.au} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die; require_once $CFG->dirroot . '/mod/assign/adminlib.php'; $ADMIN->add('modsettings', new admin_category('modassignfolder', new lang_string('pluginname', 'mod_assign'), $module->is_enabled() === false)); $settings = new admin_settingpage($section, get_string('settings', 'mod_assign'), 'moodle/site:config', $module->is_enabled() === false); if ($ADMIN->fulltree) { $menu = array(); foreach (core_component::get_plugin_list('assignfeedback') as $type => $notused) { $visible = !get_config('assignfeedback_' . $type, 'disabled'); if ($visible) { $menu['assignfeedback_' . $type] = new lang_string('pluginname', 'assignfeedback_' . $type); } } // The default here is feedback_comments (if it exists). $name = new lang_string('feedbackplugin', 'mod_assign'); $description = new lang_string('feedbackpluginforgradebook', 'mod_assign'); $settings->add(new admin_setting_configselect('assign/feedback_plugin_for_gradebook', $name, $description, 'assignfeedback_comments', $menu)); $name = new lang_string('showrecentsubmissions', 'mod_assign'); $description = new lang_string('configshowrecentsubmissions', 'mod_assign'); $settings->add(new admin_setting_configcheckbox('assign/showrecentsubmissions', $name, $description, 0));
$temp->add(new admin_setting_heading('progress', get_string('progress', 'completion'), '')); $temp->add(new admin_setting_configselect('moodlecourse/enablecompletion', get_string('completion', 'completion'), '', 1, array(0 => get_string('completiondisabled', 'completion'), 1 => get_string('completionenabled', 'completion')))); } $ADMIN->add('courses', $temp); /// "courserequests" settingpage $temp = new admin_settingpage('courserequest', get_string('courserequest')); $temp->add(new admin_setting_configcheckbox('enablecourserequests', get_string('enablecourserequests', 'admin'), get_string('configenablecourserequests', 'admin'), 0)); $temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1)); $temp->add(new admin_setting_users_with_capability('courserequestnotify', get_string('courserequestnotify', 'admin'), get_string('configcourserequestnotify2', 'admin'), array(), 'moodle/site:approvecourse')); $ADMIN->add('courses', $temp); /// Pending course requests. if (!empty($CFG->enablecourserequests)) { $ADMIN->add('courses', new admin_externalpage('coursespending', get_string('pendingrequests'), $CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse'))); } /// "backups" settingpage $temp = new admin_settingpage('backups', get_string('backups', 'admin'), 'moodle/site:backup'); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_modules', get_string('includemodules'), get_string('backupincludemoduleshelp'), 0)); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_withuserdata', get_string('includemoduleuserdata'), get_string('backupincludemoduleuserdatahelp'), 0)); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_metacourse', get_string('metacourse'), get_string('backupmetacoursehelp'), 0)); $temp->add(new admin_setting_configselect('backup/backup_sche_users', get_string('users'), get_string('backupusershelp'), 0, array(0 => get_string('all'), 1 => get_string('course')))); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_logs', get_string('logs'), get_string('backuplogshelp'), 0)); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_userfiles', get_string('userfiles'), get_string('backupuserfileshelp'), 0)); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_coursefiles', get_string('coursefiles'), get_string('backupcoursefileshelp'), 0)); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_sitefiles', get_string('sitefiles'), get_string('backupsitefileshelp'), 0)); $temp->add(new admin_setting_configcheckbox('backup_sche_gradebook_history', get_string('gradebookhistories', 'grades'), get_string('backupgradebookhistoryhelp'), 0)); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_messages', get_string('messages', 'message'), get_string('backupmessageshelp', 'message'), 0)); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_blogs', get_string('blogs', 'blog'), get_string('backupblogshelp', 'blog'), 0)); $keepoptoins = array(0 => get_string('all'), 1 => '1', 2 => '2', 5 => '5', 10 => '10', 20 => '20', 30 => '30', 40 => '40', 50 => '50', 100 => '100', 200 => '200', 300 => '300', 400 => '400', 500 => '500'); $temp->add(new admin_setting_configselect('backup/backup_sche_keep', get_string('keep'), get_string('backupkeephelp'), 1, $keepoptoins)); $temp->add(new admin_setting_configcheckbox('backup/backup_sche_active', get_string('active'), get_string('backupactivehelp'), 0)); $temp->add(new admin_setting_special_backupdays());
// "courserequests" settingpage $temp = new admin_settingpage('courserequest', get_string('courserequest')); $temp->add(new admin_setting_configcheckbox('enablecourserequests', get_string('enablecourserequests', 'admin'), get_string('configenablecourserequests', 'admin'), 0)); $temp->add(new admin_settings_coursecat_select('defaultrequestcategory', get_string('defaultrequestcategory', 'admin'), get_string('configdefaultrequestcategory', 'admin'), 1)); $ADMIN->add('courses', $temp); // "backups" settingpage if (!empty($CFG->backup_version)) { $bi = array(); $bi[] = new admin_setting_configcheckbox('backup_sche_modules', get_string('includemodules'), get_string('backupincludemoduleshelp'), 0); $bi[] = new admin_setting_configcheckbox('backup_sche_withuserdata', get_string('includemoduleuserdata'), get_string('backupincludemoduleuserdatahelp'), 0); $bi[] = new admin_setting_configcheckbox('backup_sche_metacourse', get_string('metacourse'), get_string('backupmetacoursehelp'), 0); $bi[] = new admin_setting_configselect('backup_sche_users', get_string('users'), get_string('backupusershelp'), 0, array(0 => get_string('all'), 1 => get_string('course'))); $bi[] = new admin_setting_configcheckbox('backup_sche_logs', get_string('logs'), get_string('backuplogshelp'), 0); $bi[] = new admin_setting_configcheckbox('backup_sche_userfiles', get_string('userfiles'), get_string('backupuserfileshelp'), 0); $bi[] = new admin_setting_configcheckbox('backup_sche_coursefiles', get_string('coursefiles'), get_string('backupcoursefileshelp'), 0); $bi[] = new admin_setting_configcheckbox('backup_sche_sitefiles', get_string('sitefiles'), get_string('backupsitefileshelp'), 0); $bi[] = new admin_setting_configcheckbox('backup_sche_messages', get_string('messages', 'message'), get_string('backupmessageshelp', 'message'), 0); $bi[] = new admin_setting_configselect('backup_sche_keep', get_string('keep'), get_string('backupkeephelp'), 1, array(0 => get_string('all'), 1 => '1', 2 => '2', 5 => '5', 10 => '10', 20 => '20', 30 => '30', 40 => '40', 50 => '50', 100 => '100', 200 => '200', 300 => '300', 400 => '400', 500 => '500')); $bi[] = new admin_setting_configcheckbox('backup_sche_active', get_string('active'), get_string('backupactivehelp'), 0); $bi[] = new admin_setting_special_backupdays(); $bi[] = new admin_setting_configtime('backup_sche_hour', 'backup_sche_minute', get_string('executeat'), get_string('backupexecuteathelp'), array('h' => 0, 'm' => 0)); $bi[] = new admin_setting_configdirectory('backup_sche_destination', get_string('saveto'), get_string('backupsavetohelp'), ''); $temp = new admin_settingpage('backups', get_string('backups', 'admin'), 'moodle/site:backup'); foreach ($bi as $backupitem) { $backupitem->plugin = 'backup'; $temp->add($backupitem); } $ADMIN->add('courses', $temp); } } // end of speedup
<?php // This file defines settingpages and externalpages under the "appearance" category if ($hassiteconfig) { // "languageandlocation" settingpage $temp = new admin_settingpage('langsettings', new lang_string('languagesettings', 'admin')); $temp->add(new admin_setting_configcheckbox('autolang', new lang_string('autolang', 'admin'), new lang_string('configautolang', 'admin'), 1)); $temp->add(new admin_setting_configselect('lang', new lang_string('lang', 'admin'), new lang_string('configlang', 'admin'), current_language(), get_string_manager()->get_list_of_translations())); // $CFG->lang might be set in installer already, default en is in setup.php $temp->add(new admin_setting_configcheckbox('langmenu', new lang_string('langmenu', 'admin'), new lang_string('configlangmenu', 'admin'), 1)); $temp->add(new admin_setting_langlist()); $temp->add(new admin_setting_configcheckbox('langcache', new lang_string('langcache', 'admin'), new lang_string('langcache_desc', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('langstringcache', new lang_string('langstringcache', 'admin'), new lang_string('configlangstringcache', 'admin'), 1)); $temp->add(new admin_setting_configtext('locale', new lang_string('localetext', 'admin'), new lang_string('configlocale', 'admin'), '', PARAM_FILE)); $temp->add(new admin_setting_configselect('latinexcelexport', new lang_string('latinexcelexport', 'admin'), new lang_string('configlatinexcelexport', 'admin'), '0', array('0' => 'Unicode', '1' => 'Latin'))); $ADMIN->add('language', $temp); } // end of speedup
<?php // $Id: misc.php,v 1.14.2.5 2009/03/09 23:30:55 stronk7 Exp $ // * Miscellaneous settings if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page // Experimental settings page $temp = new admin_settingpage('experimental', get_string('experimental', 'admin')); $temp->add(new admin_setting_configcheckbox('enableglobalsearch', get_string('enableglobalsearch', 'admin'), get_string('configenableglobalsearch', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('smartpix', get_string('smartpix', 'admin'), get_string('configsmartpix', 'admin'), 0)); $item = new admin_setting_configcheckbox('enablehtmlpurifier', get_string('enablehtmlpurifier', 'admin'), get_string('configenablehtmlpurifier', 'admin'), 0); $item->set_updatedcallback('reset_text_filters_cache'); $temp->add($item); $temp->add(new admin_setting_configcheckbox('enablegroupings', get_string('enablegroupings', 'admin'), get_string('configenablegroupings', 'admin'), 0)); $rqsetting = new admin_setting_configcheckbox('selectmanual', get_string('selectmanualquestions', 'qtype_random'), get_string('configselectmanualquestions', 'qtype_random'), 0); $rqsetting->plugin = 'qtype_random'; $temp->add($rqsetting); $temp->add(new admin_setting_configcheckbox('experimentalsplitrestore', get_string('experimentalsplitrestore', 'admin'), get_string('configexperimentalsplitrestore', 'admin'), 0)); $ADMIN->add('misc', $temp); // XMLDB editor $ADMIN->add('misc', new admin_externalpage('xmldbeditor', get_string('xmldbeditor'), "{$CFG->wwwroot}/{$CFG->admin}/xmldb/")); // hidden scripts linked from elsewhere $ADMIN->add('misc', new admin_externalpage('oacleanup', 'Online Assignment Cleanup', $CFG->wwwroot . '/' . $CFG->admin . '/oacleanup.php', 'moodle/site:config', true)); $ADMIN->add('misc', new admin_externalpage('upgradeforumread', 'Upgrade forum', $CFG->wwwroot . '/' . $CFG->admin . '/upgradeforumread.php', 'moodle/site:config', true)); $ADMIN->add('misc', new admin_externalpage('upgradelogs', 'Upgrade logs', $CFG->wwwroot . '/' . $CFG->admin . '/upgradelogs.php', 'moodle/site:config', true)); $ADMIN->add('misc', new admin_externalpage('multilangupgrade', get_string('multilangupgrade', 'admin'), $CFG->wwwroot . '/' . $CFG->admin . '/multilangupgrade.php', 'moodle/site:config', !empty($CFG->filter_multilang_converted))); } // end of speedup
$ADMIN->add('portfoliosettings', $temp); $ADMIN->add('portfoliosettings', new admin_externalpage('portfolionew', get_string('addnewportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url); $ADMIN->add('portfoliosettings', new admin_externalpage('portfoliodelete', get_string('deleteportfolio', 'portfolio'), $url, 'moodle/site:config', true), '', $url); $ADMIN->add('portfoliosettings', new admin_externalpage('portfoliocontroller', get_string('manageportfolios', 'portfolio'), $url, 'moodle/site:config', true), '', $url); foreach (portfolio_instances(false, false) as $portfolio) { require_once $CFG->dirroot . '/portfolio/type/' . $portfolio->get('plugin') . '/lib.php'; $classname = 'portfolio_plugin_' . $portfolio->get('plugin'); $ADMIN->add('portfoliosettings', new admin_externalpage('portfoliosettings' . $portfolio->get('id'), $portfolio->get('name'), $url . '?edit=' . $portfolio->get('id'), 'moodle/site:config', !$portfolio->get('visible')), $portfolio->get('name'), $url . ' ?edit=' . $portfolio->get('id')); } // repository setting require_once "{$CFG->dirroot}/repository/lib.php"; $catname = get_string('repositories', 'repository'); $managerepo = get_string('manage', 'repository'); $url = $CFG->wwwroot . '/' . $CFG->admin . '/repository.php'; $ADMIN->add('modules', new admin_category('repositorysettings', $catname)); $temp = new admin_settingpage('managerepositories', $managerepo); $temp->add(new admin_setting_heading('managerepositories', get_string('activerepository', 'repository'), '')); $temp->add(new admin_setting_managerepository()); $temp->add(new admin_setting_heading('managerepositoriescommonheading', get_string('commonsettings', 'admin'), '')); $temp->add(new admin_setting_configtext('repositorycacheexpire', get_string('cacheexpire', 'repository'), get_string('configcacheexpire', 'repository'), 120)); $ADMIN->add('repositorysettings', $temp); $ADMIN->add('repositorysettings', new admin_externalpage('repositorynew', get_string('addplugin', 'repository'), $url, 'moodle/site:config', true), '', $url); $ADMIN->add('repositorysettings', new admin_externalpage('repositorydelete', get_string('deleterepository', 'repository'), $url, 'moodle/site:config', true), '', $url); $ADMIN->add('repositorysettings', new admin_externalpage('repositorycontroller', get_string('managerepositories', 'repository'), $url, 'moodle/site:config', true), '', $url); $ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstancenew', get_string('createrepository', 'repository'), $url, 'moodle/site:config', true), '', $url); $ADMIN->add('repositorysettings', new admin_externalpage('repositoryinstanceedit', get_string('editrepositoryinstance', 'repository'), $url, 'moodle/site:config', true), '', $url); foreach (repository::get_types() as $repositorytype) { //display setup page for plugins with: general options or multiple instances (e.g. has instance config) $typeoptionnames = repository::static_function($repositorytype->get_typename(), 'get_type_option_names'); $instanceoptionnames = repository::static_function($repositorytype->get_typename(), 'get_instance_option_names'); if (!empty($typeoptionnames) || !empty($instanceoptionnames)) {
} // We cannot use $OUTPUT this early, doing so means that we lose the ability // to set the page layout on all admin pages. // $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key'); $url = new moodle_url(get_docs_url('How_to_get_a_security_key')); $wsdoclink = html_writer::tag('a', new lang_string('supplyinfo', 'webservice'), array('href' => $url)); $temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation', 'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false)); $ADMIN->add('webservicesettings', $temp); /// links to protocol pages foreach (core_plugin_manager::instance()->get_plugins_of_type('webservice') as $plugin) { /** @var \core\plugininfo\webservice $plugin */ $plugin->load_settings($ADMIN, 'webservicesettings', $hassiteconfig); } /// manage token page link $ADMIN->add('webservicesettings', new admin_externalpage('addwebservicetoken', new lang_string('managetokens', 'webservice'), "{$CFG->wwwroot}/{$CFG->admin}/webservice/tokens.php", 'moodle/site:config', true)); $temp = new admin_settingpage('webservicetokens', new lang_string('managetokens', 'webservice')); $temp->add(new admin_setting_managewebservicetokens()); if (empty($CFG->enablewebservices)) { $temp->add(new admin_setting_heading('webservicesaredisabled', '', new lang_string('disabledwarning', 'webservice'))); } $ADMIN->add('webservicesettings', $temp); } // Question type settings if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext)) { // Question behaviour settings. $ADMIN->add('modules', new admin_category('qbehavioursettings', new lang_string('questionbehaviours', 'admin'))); $ADMIN->add('qbehavioursettings', new admin_page_manageqbehaviours()); // Question type settings. $ADMIN->add('modules', new admin_category('qtypesettings', new lang_string('questiontypes', 'admin'))); $ADMIN->add('qtypesettings', new admin_page_manageqtypes()); // Question preview defaults.
<?php /* Icon navigation*/ $temp = new admin_settingpage('theme_pioneer_iconnav', get_string('iconnavheading', 'theme_pioneer')); // This is the descriptor for icon One $name = 'theme_pioneer/navicon1info'; $heading = get_string('navicon1', 'theme_pioneer'); $information = get_string('navicondesc', 'theme_pioneer'); $setting = new admin_setting_heading($name, $heading, $information); $temp->add($setting); // icon One $name = 'theme_pioneer/nav1icon'; $title = get_string('navicon', 'theme_pioneer'); $description = get_string('navicondesc', 'theme_pioneer'); $default = 'home'; $setting = new admin_setting_configtext($name, $title, $description, $default); $setting->set_updatedcallback('theme_reset_all_caches'); $temp->add($setting); $name = 'theme_pioneer/nav1buttontext'; $title = get_string('naviconbuttontext', 'theme_pioneer'); $description = get_string('naviconbuttontextdesc', 'theme_pioneer'); $default = 'My Home'; $setting = new admin_setting_configtext($name, $title, $description, $default); $setting->set_updatedcallback('theme_reset_all_caches'); $temp->add($setting); $name = 'theme_pioneer/nav1buttonurl'; $title = get_string('naviconbuttonurl', 'theme_pioneer'); $description = get_string('naviconbuttonurldesc', 'theme_pioneer'); $default = '/my/'; $setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL); $setting->set_updatedcallback('theme_reset_all_caches');
if (empty($CFG->loginhttps)) { $securewwwroot = $CFG->wwwroot; } else { $securewwwroot = str_replace('http:', 'https:', $CFG->wwwroot); } // stuff under the "accounts" subcategory $ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/user.php", array('moodle/user:update', 'moodle/user:delete'))); $ADMIN->add('accounts', new admin_externalpage('userbulk', get_string('userbulk', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete'))); $ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "{$securewwwroot}/user/editadvanced.php?id=-1", 'moodle/user:create')); $ADMIN->add('accounts', new admin_externalpage('uploadusers', get_string('uploadusers', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/uploaduser.php", 'moodle/site:uploadusers')); $ADMIN->add('accounts', new admin_externalpage('uploadpictures', get_string('uploadpictures', 'admin'), "{$CFG->wwwroot}/{$CFG->admin}/uploadpicture.php", 'moodle/site:uploadusers')); $ADMIN->add('accounts', new admin_externalpage('profilefields', get_string('profilefields', 'admin'), "{$CFG->wwwroot}/user/profile/index.php", 'moodle/site:config')); $ADMIN->add('accounts', new admin_externalpage('cohorts', get_string('cohorts', 'cohort'), $CFG->wwwroot . '/cohort/index.php', array('moodle/cohort:manage', 'moodle/cohort:view'))); // stuff under the "roles" subcategory // "userpolicies" settingpage $temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin')); if ($ADMIN->fulltree) { if (!during_initial_install()) { $context = get_context_instance(CONTEXT_SYSTEM); $otherroles = array(); $guestroles = array(); $userroles = array(); $creatornewroles = array(); $defaultteacherid = null; $defaultuserid = null; $defaultguestid = null; foreach (get_all_roles() as $role) { $rolename = strip_tags(format_string($role->name)) . ' (' . $role->shortname . ')'; switch ($role->archetype) { case 'manager': $creatornewroles[$role->id] = $rolename;