#74 Ensure image element does not ignore 'showposxy' setting
This commit is contained in:
parent
2ea16f9e5e
commit
548f265a22
1 changed files with 7 additions and 1 deletions
|
@ -64,6 +64,10 @@ class element extends \mod_customcert\element {
|
||||||
$mform->setDefault('height', 0);
|
$mform->setDefault('height', 0);
|
||||||
$mform->addHelpButton('height', 'height', 'customcertelement_image');
|
$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);
|
$mform->addElement('filemanager', 'customcertimage', get_string('uploadimage', 'customcert'), '', $this->filemanageroptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +93,9 @@ class element extends \mod_customcert\element {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate the position.
|
// 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;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue