From 548f265a22af71e0539dbd7367fc3e3e639f29c1 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 31 Jan 2017 12:45:00 +0800 Subject: [PATCH] #74 Ensure image element does not ignore 'showposxy' setting --- element/image/classes/element.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/element/image/classes/element.php b/element/image/classes/element.php index af82b88..c445da7 100644 --- a/element/image/classes/element.php +++ b/element/image/classes/element.php @@ -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; }