本文整理汇总了PHP中admin_settingpage::add方法的典型用法代码示例。如果您正苦于以下问题:PHP admin_settingpage::add方法的具体用法?PHP admin_settingpage::add怎么用?PHP admin_settingpage::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin_settingpage
的用法示例。
在下文中一共展示了admin_settingpage::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_adminsettings
/**
* 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);
}
示例2:
// 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'));
示例3: array
// 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 = '';
$setting = new admin_setting_configtextarea($name, $title, $description, $default, PARAM_TEXT);
示例4: unset
$creatornewroles[$role->id] = $rolename;
$otherroles[$role->id] = $rolename;
break;
}
}
if (empty($guestroles)) {
$guestroles[0] = new lang_string('none');
$defaultguestid = 0;
}
if (empty($userroles)) {
$userroles[0] = new lang_string('none');
$defaultuserid = 0;
}
$restorersnewrole = $creatornewroles;
$restorersnewrole[0] = new lang_string('none');
$temp->add(new admin_setting_configselect('notloggedinroleid', new lang_string('notloggedinroleid', 'admin'), new lang_string('confignotloggedinroleid', 'admin'), $defaultguestid, $guestroles + $otherroles));
$temp->add(new admin_setting_configselect('guestroleid', new lang_string('guestroleid', 'admin'), new lang_string('guestroleid_help', 'admin'), $defaultguestid, $guestroles + $otherroles));
$temp->add(new admin_setting_configselect('defaultuserroleid', new lang_string('defaultuserroleid', 'admin'), new lang_string('configdefaultuserroleid', 'admin'), $defaultuserid, $userroles + $otherroles));
$temp->add(new admin_setting_configselect('creatornewroleid', new lang_string('creatornewroleid', 'admin'), new lang_string('creatornewroleid_help', 'admin'), $defaultteacherid, $creatornewroles));
$temp->add(new admin_setting_configselect('restorernewroleid', new lang_string('restorernewroleid', 'admin'), new lang_string('restorernewroleid_help', 'admin'), $defaultteacherid, $restorersnewrole));
// release memory
unset($otherroles);
unset($guestroles);
unset($userroles);
unset($creatornewroles);
unset($restorersnewrole);
}
$temp->add(new admin_setting_configcheckbox('autologinguests', new lang_string('autologinguests', 'admin'), new lang_string('configautologinguests', 'admin'), 0));
$temp->add(new admin_setting_configmultiselect('hiddenuserfields', new lang_string('hiddenuserfields', 'admin'), new lang_string('confighiddenuserfields', 'admin'), array(), array('description' => new lang_string('description'), 'city' => new lang_string('city'), 'country' => new lang_string('country'), 'webpage' => new lang_string('webpage'), 'icqnumber' => new lang_string('icqnumber'), 'skypeid' => new lang_string('skypeid'), 'yahooid' => new lang_string('yahooid'), 'aimid' => new lang_string('aimid'), 'msnid' => new lang_string('msnid'), 'firstaccess' => new lang_string('firstaccess'), 'lastaccess' => new lang_string('lastaccess'), 'mycourses' => new lang_string('mycourses'), 'groups' => new lang_string('groups'), 'suspended' => new lang_string('suspended', 'auth'))));
// Select fields to display as part of user identity (only to those
// with moodle/site:viewuseridentity).
示例5:
//
// 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 <nicolas.dunand@unil.ch>
* @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);
}
示例6: array
}
// we must not use assignable roles here:
// 1/ unsetting roles as assignable for admin might bork the settings!
// 2/ default user role should not be assignable anyway
$allroles = array();
$nonguestroles = array();
if ($roles = get_all_roles()) {
foreach ($roles as $role) {
$rolename = strip_tags(format_string($role->name, true));
$allroles[$role->id] = $rolename;
if (!isset($guestroles[$role->id])) {
$nonguestroles[$role->id] = $rolename;
}
}
}
$temp->add(new admin_setting_configselect('notloggedinroleid', get_string('notloggedinroleid', 'admin'), get_string('confignotloggedinroleid', 'admin'), $defaultguestid, $allroles));
$temp->add(new admin_setting_configselect('guestroleid', get_string('guestroleid', 'admin'), get_string('configguestroleid', 'admin'), $defaultguestid, $allroles));
$temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'), get_string('configdefaultuserroleid', 'admin'), $userrole->id, $nonguestroles));
// guest role here breaks a lot of stuff
}
// enable auto assign role LPC #2 in "Yesumy lemida" category #7 (nadavkav)
$temp->add(new admin_setting_configcheckbox('autoassignlpctocategory', get_string('autoassignlpctocategory', 'admin'), get_string('configautoassignlpctocategory', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('nodefaultuserrolelists', get_string('nodefaultuserrolelists', 'admin'), get_string('confignodefaultuserrolelists', 'admin'), 0));
if (!empty($CFG->rolesactive)) {
$temp->add(new admin_setting_configselect('defaultcourseroleid', get_string('defaultcourseroleid', 'admin'), get_string('configdefaultcourseroleid', 'admin'), $studentrole->id, $allroles));
$temp->add(new admin_setting_configselect('creatornewroleid', get_string('creatornewroleid', 'admin'), get_string('configcreatornewroleid', 'admin'), $CFG->creatornewroleid, $allroles));
}
$temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
if (!empty($CFG->rolesactive)) {
$temp->add(new admin_setting_configmultiselect('nonmetacoursesyncroleids', get_string('nonmetacoursesyncroleids', 'admin'), get_string('confignonmetacoursesyncroleids', 'admin'), array(), $allroles));
}
示例7:
$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
示例8: array
$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
示例9: ksort
$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');
for ($i = 0; $i < 24; $i++) {
$pickeroptions[$i * 3600] = userdate($i * 3600, get_string('timetemplate', 'organizer'), 0);
示例10: array
$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
示例11: array
* An activity to interface with WebEx.
*
* @package mod_webexactvity
* @author Eric Merrill <merrill@oakland.edu>
* @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'));
$setting = new admin_setting_configmulticheckbox('webexactivity/typemeetingcenter', get_string('typemeetingcenter', 'mod_webexactivity'), get_string('typemeetingcenter_desc', 'mod_webexactivity'), array(\mod_webexactivity\webex::WEBEXACTIVITY_TYPE_PASSWORD_REQUIRED => 1), $typeopts);
$settings->add($setting);
$setting = new admin_setting_configmulticheckbox('webexactivity/typetrainingcenter', get_string('typetrainingcenter', 'mod_webexactivity'), get_string('typetrainingcenter_desc', 'mod_webexactivity'), array(\mod_webexactivity\webex::WEBEXACTIVITY_TYPE_PASSWORD_REQUIRED => 1), $typeopts);
$settings->add($setting);
// ---------------------------------------------------
// Meeting Settings.
示例12: array
*/
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);
}
}
示例13: array
//
// 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.
$category->add('messageinbound', new admin_externalpage('messageinbound_handlers', new lang_string('message_handlers', 'tool_messageinbound'), "{$CFG->wwwroot}/{$CFG->admin}/tool/messageinbound/index.php"));
示例14: set_adminsettings
/**
* 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);
}
示例15: die
* 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"));
}