Patch for postgresql happiness
[moodle.git] / admin / module.php
blob1ab26d4e91e04a11a766803d37dba28557e7301f
1 <?PHP // $Id$
2 // module.php - allows admin to edit all local configuration variables for a module
4 require_once("../config.php");
6 require_login();
8 if (!isadmin()) {
9 error("Only an admin can use this page");
12 if (!$site = get_site()) {
13 error("Site isn't defined!");
16 if (!confirm_sesskey()) {
17 error(get_string('confirmsesskeybad', 'error'));
20 /// If data submitted, then process and store.
22 if ($config = data_submitted()) {
23 print_header();
24 foreach ($config as $name => $value) {
25 set_config($name, $value);
27 redirect("$CFG->wwwroot/$CFG->admin/modules.php", get_string("changessaved"), 1);
28 exit;
31 /// Otherwise print the form.
33 require_variable($module);
35 $module = clean_filename($module);
36 require_once("$CFG->dirroot/mod/$module/lib.php");
39 $stradmin = get_string("administration");
40 $strconfiguration = get_string("configuration");
41 $strmanagemodules = get_string("managemodules");
42 $strmodulename = get_string("modulename", $module);
44 print_header("$site->shortname: $strmodulename: $strconfiguration", $site->fullname,
45 "<a href=\"index.php\">$stradmin</a> -> ".
46 "<a href=\"configure.php\">$strconfiguration</a> -> ".
47 "<a href=\"modules.php\">$strmanagemodules</a> -> $strmodulename");
49 print_heading($strmodulename);
51 print_simple_box("<center>".get_string("configwarning")."</center>", "center", "50%");
52 echo "<br />";
54 print_simple_box_start("center", "", "$THEME->cellheading");
55 include("$CFG->dirroot/mod/$module/config.html");
56 print_simple_box_end();
58 print_footer();