Merge branch 'w36_MDL-34097_m22_environment' of git://github.com/skodak/moodle into...
[moodle.git] / enrol / flatfile / settings.php
blob904e24e05b05cad0830fb1c8d0997a1194b5354c
1 <?php
3 // This file is part of Moodle - http://moodle.org/
4 //
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 /**
19 * Flatfile enrolments plugin settings and presets.
21 * @package enrol
22 * @subpackage flatfile
23 * @copyright 2010 Eugene Venter
24 * @author Eugene Venter - based on code by Petr Skoda and others
25 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28 defined('MOODLE_INTERNAL') || die();
30 if ($ADMIN->fulltree) {
32 //--- general settings -----------------------------------------------------------------------------------
33 $settings->add(new admin_setting_heading('enrol_flatfile_settings', '', get_string('pluginname_desc', 'enrol_flatfile')));
35 $settings->add(new admin_setting_configtext('enrol_flatfile/location', get_string('location', 'enrol_flatfile'), '', ''));
37 $settings->add(new admin_setting_configcheckbox('enrol_flatfile/mailstudents', get_string('mailstudents', 'enrol_flatfile'), '', 0));
39 $settings->add(new admin_setting_configcheckbox('enrol_flatfile/mailteachers', get_string('mailteachers', 'enrol_flatfile'), '', 0));
41 $settings->add(new admin_setting_configcheckbox('enrol_flatfile/mailadmins', get_string('mailadmin', 'enrol_flatfile'), '', 0));
43 //--- mapping -------------------------------------------------------------------------------------------
44 if (!during_initial_install()) {
45 $settings->add(new admin_setting_heading('enrol_flatfile_mapping', get_string('mapping', 'enrol_flatfile'), ''));
47 $roles = $DB->get_records('role', null, '', 'id, name, shortname');
49 foreach ($roles as $id => $record) {
50 $settings->add(new admin_setting_configtext('enrol_flatfile/map_'.$id, format_string($record->name), '', format_string($record->shortname)));