mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Code to enable config.html files in the modules.
This commit is contained in:
parent
a21db785d1
commit
bda11d2acd
53
admin/module.php
Normal file
53
admin/module.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?PHP // $Id$
|
||||
// module.php - allows admin to edit all local configuration variables for a module
|
||||
|
||||
require_once("../config.php");
|
||||
|
||||
require_login();
|
||||
|
||||
if (!isadmin()) {
|
||||
error("Only an admin can use this page");
|
||||
}
|
||||
|
||||
if (!$site = get_site()) {
|
||||
error("Site isn't defined!");
|
||||
}
|
||||
|
||||
|
||||
/// If data submitted, then process and store.
|
||||
|
||||
if ($config = data_submitted()) {
|
||||
print_header();
|
||||
foreach ($config as $name => $value) {
|
||||
set_config($name, $value);
|
||||
}
|
||||
redirect("$CFG->wwwroot/$CFG->admin/modules.php", get_string("changessaved"), 1);
|
||||
exit;
|
||||
}
|
||||
|
||||
/// Otherwise print the form.
|
||||
|
||||
require_variable($module);
|
||||
|
||||
require_once("$CFG->dirroot/mod/$module/lib.php");
|
||||
|
||||
|
||||
$stradmin = get_string("administration");
|
||||
$strconfiguration = get_string("configuration");
|
||||
$strmanagemodules = get_string("managemodules");
|
||||
$strmodulename = get_string("modulename", $module);
|
||||
|
||||
print_header("$site->shortname: $strconfigvariables", $site->fullname,
|
||||
"<a href=\"index.php\">$stradmin</a> -> ".
|
||||
"<a href=\"configure.php\">$strconfiguration</a> -> ".
|
||||
"<a href=\"modules.php\">$strmanagemodules</a> -> $strmodulename", $focus);
|
||||
|
||||
print_heading($strmodulename);
|
||||
|
||||
print_simple_box_start("center", "", "$THEME->cellheading");
|
||||
include("$CFG->wwwroot/mod/$module/config.html");
|
||||
print_simple_box_end();
|
||||
|
||||
print_footer();
|
||||
|
||||
?>
|
@ -160,8 +160,8 @@
|
||||
|
||||
$delete = "<a href=\"modules.php?delete=$module->name\">$strdelete</a>";
|
||||
|
||||
if (file_exists("$CFG->dirroot/mod/$module->name/config.php")) {
|
||||
$settings = "<a href=\"$CFG->wwwroot/mod/$module->name/config.php\">$strsettings</a>";
|
||||
if (file_exists("$CFG->dirroot/mod/$module->name/config.html")) {
|
||||
$settings = "<a href=\"module.php?module=$module->name\">$strsettings</a>";
|
||||
} else {
|
||||
$settings = "";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user