|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 // This file is part of Moodle - http://moodle.org/ 00004 // 00005 // Moodle is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // Moodle is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00017 00027 defined('MOODLE_INTERNAL') || die(); 00028 00029 if ($ADMIN->fulltree) { 00030 00031 //--- general settings ----------------------------------------------------------------------------------- 00032 $settings->add(new admin_setting_heading('enrol_self_settings', '', get_string('pluginname_desc', 'enrol_self'))); 00033 00034 $settings->add(new admin_setting_configcheckbox('enrol_self/requirepassword', 00035 get_string('requirepassword', 'enrol_self'), get_string('requirepassword_desc', 'enrol_self'), 0)); 00036 00037 $settings->add(new admin_setting_configcheckbox('enrol_self/usepasswordpolicy', 00038 get_string('usepasswordpolicy', 'enrol_self'), get_string('usepasswordpolicy_desc', 'enrol_self'), 0)); 00039 00040 $settings->add(new admin_setting_configcheckbox('enrol_self/showhint', 00041 get_string('showhint', 'enrol_self'), get_string('showhint_desc', 'enrol_self'), 0)); 00042 00043 //--- enrol instance defaults ---------------------------------------------------------------------------- 00044 $settings->add(new admin_setting_heading('enrol_self_defaults', 00045 get_string('enrolinstancedefaults', 'admin'), get_string('enrolinstancedefaults_desc', 'admin'))); 00046 00047 $settings->add(new admin_setting_configcheckbox('enrol_self/defaultenrol', 00048 get_string('defaultenrol', 'enrol'), get_string('defaultenrol_desc', 'enrol'), 1)); 00049 00050 $options = array(ENROL_INSTANCE_ENABLED => get_string('yes'), 00051 ENROL_INSTANCE_DISABLED => get_string('no')); 00052 $settings->add(new admin_setting_configselect('enrol_self/status', 00053 get_string('status', 'enrol_self'), get_string('status_desc', 'enrol_self'), ENROL_INSTANCE_DISABLED, $options)); 00054 00055 $options = array(1 => get_string('yes'), 00056 0 => get_string('no')); 00057 $settings->add(new admin_setting_configselect('enrol_self/groupkey', 00058 get_string('groupkey', 'enrol_self'), get_string('groupkey_desc', 'enrol_self'), 0, $options)); 00059 00060 if (!during_initial_install()) { 00061 $options = get_default_enrol_roles(get_context_instance(CONTEXT_SYSTEM)); 00062 $student = get_archetype_roles('student'); 00063 $student = reset($student); 00064 $settings->add(new admin_setting_configselect('enrol_self/roleid', 00065 get_string('defaultrole', 'enrol_self'), get_string('defaultrole_desc', 'enrol_self'), $student->id, $options)); 00066 } 00067 00068 $settings->add(new admin_setting_configtext('enrol_self/enrolperiod', 00069 get_string('enrolperiod', 'enrol_self'), get_string('enrolperiod_desc', 'enrol_self'), 0, PARAM_INT)); 00070 00071 $options = array(0 => get_string('never'), 00072 1800 * 3600 * 24 => get_string('numdays', '', 1800), 00073 1000 * 3600 * 24 => get_string('numdays', '', 1000), 00074 365 * 3600 * 24 => get_string('numdays', '', 365), 00075 180 * 3600 * 24 => get_string('numdays', '', 180), 00076 150 * 3600 * 24 => get_string('numdays', '', 150), 00077 120 * 3600 * 24 => get_string('numdays', '', 120), 00078 90 * 3600 * 24 => get_string('numdays', '', 90), 00079 60 * 3600 * 24 => get_string('numdays', '', 60), 00080 30 * 3600 * 24 => get_string('numdays', '', 30), 00081 21 * 3600 * 24 => get_string('numdays', '', 21), 00082 14 * 3600 * 24 => get_string('numdays', '', 14), 00083 7 * 3600 * 24 => get_string('numdays', '', 7)); 00084 $settings->add(new admin_setting_configselect('enrol_self/longtimenosee', 00085 get_string('longtimenosee', 'enrol_self'), get_string('longtimenosee_help', 'enrol_self'), 0, $options)); 00086 00087 $settings->add(new admin_setting_configtext('enrol_self/maxenrolled', 00088 get_string('maxenrolled', 'enrol_self'), get_string('maxenrolled_help', 'enrol_self'), 0, PARAM_INT)); 00089 00090 $settings->add(new admin_setting_configcheckbox('enrol_self/sendcoursewelcomemessage', 00091 get_string('sendcoursewelcomemessage', 'enrol_self'), get_string('sendcoursewelcomemessage_help', 'enrol_self'), 1)); 00092 }