#74 Ensure image element does not ignore 'showposxy' setting

This commit is contained in:
Mark Nelson 2017-01-31 12:45:00 +08:00
parent 2ea16f9e5e
commit 548f265a22

View file

@ -64,6 +64,10 @@ class element extends \mod_customcert\element {
$mform->setDefault('height', 0);
$mform->addHelpButton('height', 'height', 'customcertelement_image');
if (get_config('customcert', 'showposxy')) {
\mod_customcert\element_helper::render_form_element_position($mform);
}
$mform->addElement('filemanager', 'customcertimage', get_string('uploadimage', 'customcert'), '', $this->filemanageroptions);
}
@ -89,7 +93,9 @@ class element extends \mod_customcert\element {
}
// Validate the position.
$errors += \mod_customcert\element_helper::validate_form_element_position($data);
if (get_config('customcert', 'showposxy')) {
$errors += \mod_customcert\element_helper::validate_form_element_position($data);
}
return $errors;
}