From: skodak Date: Sun, 15 Mar 2009 13:44:28 +0000 (+0000) Subject: MDL-18265 fixed regression in menu field - discovered and patched by Vlas Voloshin... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4d3e28a06c41333f512d0f79ce3e8db8b38c7f0d;p=moodle.git MDL-18265 fixed regression in menu field - discovered and patched by Vlas Voloshin, thanks!; merged from MOODLE_19_STABLE --- diff --git a/user/profile/field/menu/field.class.php b/user/profile/field/menu/field.class.php index fa60ab631d..69317ff45c 100644 --- a/user/profile/field/menu/field.class.php +++ b/user/profile/field/menu/field.class.php @@ -71,6 +71,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); + } + } } ?>