Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / admin / enrol_config.php
blob6adca6d13c8e292a3ad74173b1b2cd236ea1e0f3
1 <?PHP // $Id$
2 // enrol_config.php - allows admin to edit all enrollment variables
3 // Yes, enrol is correct English spelling.
5 require_once("../config.php");
6 require_once($CFG->libdir.'/adminlib.php');
8 admin_externalpage_setup('enrolment');
10 $enrol = required_param('enrol', PARAM_ALPHA);
11 $CFG->pagepath = 'enrol/' . $enrol;
14 require_once("$CFG->dirroot/enrol/enrol.class.php"); /// Open the factory class
16 $enrolment = enrolment_factory::factory($enrol);
18 /// If data submitted, then process and store.
20 if ($frm = data_submitted()) {
21 if (!confirm_sesskey()) {
22 error(get_string('confirmsesskeybad', 'error'));
24 if ($enrolment->process_config($frm)) {
25 redirect("enrol.php?sesskey=$USER->sesskey", get_string("changessaved"), 1);
27 } else {
28 $frm = $CFG;
31 /// Otherwise fill and print the form.
33 /// get language strings
34 $str = get_strings(array('enrolmentplugins', 'configuration', 'users', 'administration'));
36 unset($options);
38 $modules = get_list_of_plugins("enrol");
39 foreach ($modules as $module) {
40 $options[$module] = get_string("enrolname", "enrol_$module");
42 asort($options);
44 admin_externalpage_print_header();
46 echo "<form $CFG->frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol_config.php\">";
47 echo "<div>";
48 echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\" />";
49 echo "<input type=\"hidden\" name=\"enrol\" value=\"".$enrol."\" />";
51 /// Print current enrolment type description
52 print_simple_box_start("center", "80%");
53 print_heading($options[$enrol]);
55 print_simple_box_start("center", "60%", '', 5, 'informationbox');
56 print_string("description", "enrol_$enrol");
57 print_simple_box_end();
59 echo "<hr />";
61 $enrolment->config_form($frm);
63 echo "<p class=\"centerpara\"><input type=\"submit\" value=\"".get_string("savechanges")."\" /></p>\n";
64 print_simple_box_end();
65 echo "</div>";
66 echo "</form>";
68 admin_externalpage_print_footer();
70 exit;