From ed93542c0c6eed39d991050f88a40133ac06b319 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 14 Jun 2016 15:38:53 +0800 Subject: [PATCH] Removed the 'posx' and 'posy' form elements --- classes/element.php | 2 -- classes/element_helper.php | 16 ---------------- element/image/classes/element.php | 10 ---------- lang/en/customcert.php | 4 ---- 4 files changed, 32 deletions(-) diff --git a/classes/element.php b/classes/element.php index f309d67..5f85ab2 100644 --- a/classes/element.php +++ b/classes/element.php @@ -112,8 +112,6 @@ abstract class element { $element->font = (isset($data->font)) ? $data->font : null; $element->size = (isset($data->size)) ? $data->size : null; $element->colour = (isset($data->colour)) ? $data->colour : null; - $element->posx = (isset($data->posx)) ? $data->posx : null; - $element->posy = (isset($data->posy)) ? $data->posy : null; $element->width = (isset($data->width)) ? $data->width : null; $element->refpoint = (isset($data->refpoint)) ? $data->refpoint : null; $element->timemodified = time(); diff --git a/classes/element_helper.php b/classes/element_helper.php index 71a00ef..01df420 100644 --- a/classes/element_helper.php +++ b/classes/element_helper.php @@ -154,14 +154,6 @@ class element_helper { * @param \mod_customcert\edit_element_form $mform the edit_form instance. */ public static function render_form_element_position($mform) { - $mform->addElement('text', 'posx', get_string('posx', 'customcert'), array('size' => 10)); - $mform->setType('posx', PARAM_INT); - $mform->setDefault('posx', 0); - $mform->addHelpButton('posx', 'posx', 'customcert'); - $mform->addElement('text', 'posy', get_string('posy', 'customcert'), array('size' => 10)); - $mform->setType('posy', PARAM_INT); - $mform->setDefault('posy', 0); - $mform->addHelpButton('posy', 'posy', 'customcert'); $mform->addElement('text', 'width', get_string('elementwidth', 'customcert'), array('size' => 10)); $mform->setType('width', PARAM_INT); $mform->setDefault('width', 0); @@ -199,14 +191,6 @@ class element_helper { */ public static function validate_form_element_position($data) { $errors = array(); - // Check if posx is not set, or not numeric or less than 0. - if ((!isset($data['posx'])) || (!is_numeric($data['posx'])) || ($data['posx'] < 0)) { - $errors['posx'] = get_string('invalidposition', 'customcert', 'X'); - } - // Check if posy is not set, or not numeric or less than 0. - if ((!isset($data['posy'])) || (!is_numeric($data['posy'])) || ($data['posy'] < 0)) { - $errors['posy'] = get_string('invalidposition', 'customcert', 'Y'); - } // Check if width is less than 0. if (isset($data['width']) && $data['width'] < 0) { $errors['width'] = get_string('invalidelementwidth', 'customcert'); diff --git a/element/image/classes/element.php b/element/image/classes/element.php index 43c6cfd..a4c25c2 100644 --- a/element/image/classes/element.php +++ b/element/image/classes/element.php @@ -64,16 +64,6 @@ class element extends \mod_customcert\element { $mform->setDefault('height', 0); $mform->addHelpButton('height', 'height', 'customcertelement_image'); - $mform->addElement('text', 'posx', get_string('posx', 'customcert'), array('size' => 10)); - $mform->setType('posx', PARAM_INT); - $mform->setDefault('posx', '0'); - $mform->addHelpButton('posx', 'posx', 'customcert'); - - $mform->addElement('text', 'posy', get_string('posy', 'customcert'), array('size' => 10)); - $mform->setType('posy', PARAM_INT); - $mform->setDefault('posy', '0'); - $mform->addHelpButton('posy', 'posy', 'customcert'); - $mform->addElement('filemanager', 'customcertimage', get_string('uploadimage', 'customcert'), '', $this->filemanageroptions); } diff --git a/lang/en/customcert.php b/lang/en/customcert.php index 96113db..57e633f 100644 --- a/lang/en/customcert.php +++ b/lang/en/customcert.php @@ -93,10 +93,6 @@ $string['pluginadministration'] = 'Custom certificate administration'; $string['pluginname'] = 'Custom certificate'; $string['print'] = 'Print'; $string['portrait'] = 'Portrait'; -$string['posx'] = 'Position X'; -$string['posx_help'] = 'This is the position in mm from the top left corner you wish the element\'s reference point to locate in the x direction.'; -$string['posy'] = 'Position Y'; -$string['posy_help'] = 'This is the position in mm from the top left corner you wish the element\'s reference point to locate in the y direction.'; $string['rearrangeelements'] = 'Rearrange elements'; $string['rearrangeelementsheading'] = 'Drag and drop elements to change where they are positioned on the certificate.'; $string['receiveddate'] = 'Received date';