Better set_config (give immediate results)

This commit is contained in:
moodler 2003-08-18 17:41:06 +00:00
parent 5be7800c12
commit 42282810f8

View File

@ -54,6 +54,9 @@ function optional_variable(&$var, $default=0) {
function set_config($name, $value) {
/// No need for get_config because they are usually always available in $CFG
global $CFG;
$CFG->$name = $value; // So it's defined for this invocation at least
if (get_field("config", "name", "name", $name)) {
return set_field("config", "value", $value, "name", $name);