/** * Sets the data on the form when editing an element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function definition_after_data($mform) { $this->element->userfield = $this->element->data; parent::definition_after_data($mform); }
/** * Sets the data on the form when editing an element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function definition_after_data($mform) { $this->element->teacher = $this->element->data; parent::definition_after_data($mform); }
/** * Sets the data on the form when editing an element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function definition_after_data($mform) { global $COURSE; // Set the image, width and height for this element. $imageinfo = json_decode($this->element->data); $this->element->image = $imageinfo->pathnamehash; $this->element->width = $imageinfo->width; $this->element->height = $imageinfo->height; // Editing existing instance - copy existing files into draft area. $draftitemid = file_get_submitted_draft_itemid('customcertimage'); $filemanageroptions = array('maxbytes' => $COURSE->maxbytes, 'subdirs' => 1, 'accepted_types' => 'image'); file_prepare_draft_area($draftitemid, context_course::instance($COURSE->id)->id, 'mod_customcert', 'image', 0, $filemanageroptions); $element = $mform->getElement('customcertimage'); $element->setValue($draftitemid); parent::definition_after_data($mform); }
/** * Sets the data on the form when editing an element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function definition_after_data($mform) { // Set the item and format for this element. $dateinfo = json_decode($this->element->data); $this->element->dateitem = $dateinfo->dateitem; $this->element->dateformat = $dateinfo->dateformat; parent::definition_after_data($mform); }
/** * Sets the data on the form when editing an element. * * @param mod_customcert_edit_element_form $mform the edit_form instance */ public function definition_after_data($mform) { $this->element->gradeitem = $this->element->data; parent::definition_after_data($mform); }