/** * Sets the data on the form when editing an element. * Can be overridden if more functionality is needed. * * @param mod_customcert_edit_element_form $mform the edit_form instance * @param array the form elements to set */ public function definition_after_data($mform) { // Loop through the properties of the element and set the values // of the corresponding form element, if it exists. foreach ($this->element as $property => $value) { if ($mform->elementExists($property)) { $element = $mform->getElement($property); $element->setValue($value); } } }