Exemple #1
0
 /**
  * HardFreeze the field if locked.
  * @param moodleform $mform instance of the moodleform class
  */
 public function edit_field_set_locked($mform)
 {
     if (!$mform->elementExists($this->inputname)) {
         return;
     }
     if ($this->is_locked() and !has_capability('moodle/user:update', context_system::instance())) {
         $mform->hardFreeze($this->inputname);
         $mform->setConstant($this->inputname, $this->data);
     }
 }
Exemple #2
0
 /**
  * HardFreeze the field if locked.
  *
  * @param moodleform $mform 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->data);
     }
 }