MDL-18265 fixed regression in menu field - discovered and patched by Vlas Voloshin, thanks!; merged from MOODLE_19_STABLE

This commit is contained in:
skodak
2009-03-15 13:45:57 +00:00
parent ccbe95b8cd
commit 57317806b9
+13
View File
@@ -64,6 +64,19 @@ class profile_field_menu extends profile_field_base {
$user->{$this->inputname} = $this->datakey;
}
/**
* HardFreeze the field if locked.
* @param object instance of the moodleform class
*/
function edit_field_set_locked(&$mform) {
if (!$mform->elementExists($this->inputname)) {
return;
}
if ($this->is_locked() and !has_capability('moodle/user:update', get_context_instance(CONTEXT_SYSTEM))) {
$mform->hardFreeze($this->inputname);
$mform->setConstant($this->inputname, $this->datakey);
}
}
}
?>