diff --git a/components/com_contact/layouts/joomla/form/renderfield.php b/components/com_contact/layouts/joomla/form/renderfield.php new file mode 100644 index 0000000000000..a0b789ee424a3 --- /dev/null +++ b/components/com_contact/layouts/joomla/form/renderfield.php @@ -0,0 +1,41 @@ + +
> + +
+ + + + +
+ +
+
diff --git a/components/com_contact/models/forms/contact.xml b/components/com_contact/models/forms/contact.xml index 1500d002a6ab1..1ec9116477bee 100644 --- a/components/com_contact/models/forms/contact.xml +++ b/components/com_contact/models/forms/contact.xml @@ -1,55 +1,65 @@
-
- + + - - - - -
-
\ No newline at end of file + diff --git a/components/com_contact/views/contact/tmpl/default_form.php b/components/com_contact/views/contact/tmpl/default_form.php index 23055078ca3f8..e30e963ff73e6 100644 --- a/components/com_contact/views/contact/tmpl/default_form.php +++ b/components/com_contact/views/contact/tmpl/default_form.php @@ -12,41 +12,40 @@ JHtml::_('behavior.keepalive'); JHtml::_('behavior.formvalidator'); -if (isset($this->error)) : ?> -
- error; ?> -
- +$captchaEnabled = false; +foreach (JPluginHelper::getPlugin('captcha') as $plugin) +{ + if (JFactory::getApplication()->get('captcha', '0') === $plugin->name) + { + $captchaEnabled = true; + break; + } +} +?>
-
-
- - - form->getFieldsets() as $fieldset) : ?> - form->getFieldset($fieldset->name) as $field) : ?> - name === 'contact_email_copy' && !$this->params->get('show_email_copy')) : ?> - + + form->getFieldsets() as $fieldset): ?> + name === 'captcha' && !$captchaEnabled) : ?> + + + form->getFieldset($fieldset->name); ?> + +
+ label) && strlen($legend = trim(JText::_($fieldset->label)))) : ?> + -
- hidden) : ?> -
- input; ?> -
- -
- label; ?> - required && $field->type != 'Spacer') : ?> - - -
-
input; ?>
+ + name === 'contact_email_copy' && !$this->params->get('show_email_copy')) : ?> + -
- - - -
+ renderField(); ?> + +
+ + +
+
@@ -54,6 +53,7 @@
+
diff --git a/language/en-GB/en-GB.com_contact.ini b/language/en-GB/en-GB.com_contact.ini index 826042703ec10..ecc50744b34b9 100644 --- a/language/en-GB/en-GB.com_contact.ini +++ b/language/en-GB/en-GB.com_contact.ini @@ -3,14 +3,13 @@ ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php ; Note : All ini files need to be saved as UTF-8 - COM_CONTACT_ADDRESS="Address" COM_CONTACT_ARTICLES_HEADING="Contact's articles" COM_CONTACT_CAPTCHA_LABEL="Captcha" COM_CONTACT_CAPTCHA_DESC="Type in the textbox what you see in the image." COM_CONTACT_CAT_NUM="# of Contacts :" COM_CONTACT_CONTACT_EMAIL_A_COPY_DESC="Sends a copy of the message to the address you have supplied." -COM_CONTACT_CONTACT_EMAIL_A_COPY_LABEL="Send Copy to Yourself" +COM_CONTACT_CONTACT_EMAIL_A_COPY_LABEL="Send copy to yourself" COM_CONTACT_CONTACT_EMAIL_NAME_DESC="Your name." COM_CONTACT_CONTACT_EMAIL_NAME_LABEL="Name" COM_CONTACT_CONTACT_ENTER_MESSAGE_DESC="Enter your message here." @@ -39,7 +38,7 @@ COM_CONTACT_ENQUIRY_TEXT="This is an enquiry email via %s from:" COM_CONTACT_ERROR_CONTACT_NOT_FOUND="Contact not found" COM_CONTACT_FAX="Fax" COM_CONTACT_FAX_NUMBER="Fax: %s" -COM_CONTACT_FORM_LABEL="Send an Email. All fields with an asterisk (*) are required." +COM_CONTACT_CONTACT_DEFAULT_LABEL="Send an Email" COM_CONTACT_FORM_NC="Please make sure the form is complete and valid." COM_CONTACT_IMAGE_DETAILS="Contact image" COM_CONTACT_LINKS="Links" @@ -49,6 +48,7 @@ COM_CONTACT_MOBILE_NUMBER="Mobile: %s" COM_CONTACT_NO_CONTACTS="There are no Contacts to display" COM_CONTACT_NOT_MORE_THAN_ONE_EMAIL_ADDRESS="You can't enter more than one email address." COM_CONTACT_NUM_ITEMS="Contact Count:" +COM_CONTACT_CONTACT_REQUIRED="* Required field" COM_CONTACT_OPTIONAL="(optional)" COM_CONTACT_OTHER_INFORMATION="Miscellaneous Information" COM_CONTACT_POSITION="Position" diff --git a/layouts/joomla/form/field/radio.php b/layouts/joomla/form/field/radio.php index 6962914a5b2b8..904a029332198 100644 --- a/layouts/joomla/form/field/radio.php +++ b/layouts/joomla/form/field/radio.php @@ -52,10 +52,8 @@ * %4 = any other attributes */ $format = ''; - -$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $name); +$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $name); ?> -
diff --git a/layouts/joomla/form/renderfield.php b/layouts/joomla/form/renderfield.php index 9632d8fc27ca7..6fa028f10e54d 100644 --- a/layouts/joomla/form/renderfield.php +++ b/layouts/joomla/form/renderfield.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +extract($displayData); + /** * Layout variables * --------------------- @@ -17,19 +19,18 @@ * $input : (string) The input field html code */ -if (!empty($displayData['options']['showonEnabled'])) +if (!empty($options['showonEnabled'])) { JHtml::_('jquery.framework'); JHtml::_('script', 'jui/cms.js', false, true); } -$class = empty($displayData['options']['class']) ? "" : " " . $displayData['options']['class']; -$rel = empty($displayData['options']['rel']) ? "" : " " . $displayData['options']['rel']; +$class = empty($options['class']) ? '' : ' ' . $options['class']; +$rel = empty($options['rel']) ? '' : ' ' . $options['rel']; ?> -
> - -
+ +
-
+
diff --git a/layouts/joomla/form/renderlabel.php b/layouts/joomla/form/renderlabel.php index 443f1268711f1..0022ff9046750 100644 --- a/layouts/joomla/form/renderlabel.php +++ b/layouts/joomla/form/renderlabel.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +extract($displayData); + /** * Layout variables * --------------------- @@ -20,31 +22,24 @@ * $position : (string) The tooltip position. Bottom for alias */ -$text = $displayData['text']; -$desc = $displayData['description']; -$for = $displayData['for']; -$req = $displayData['required']; -$classes = array_filter((array) $displayData['classes']); -$position = $displayData['position']; +$classes = array_filter((array) $classes); $id = $for . '-lbl'; $title = ''; -// If a description is specified, use it to build a tooltip. -if (!empty($desc)) +if (!empty($description)) { JHtml::_('bootstrap.tooltip'); $classes[] = 'hasTooltip'; - $title = ' title="' . JHtml::tooltipText(trim($text, ':'), $desc, 0) . '"'; + $title = ' title="' . JHtml::tooltipText(trim($text, ':'), $description, 0) . '"'; } -// If required, there's a class for that. -if ($req) +if ($required) { $classes[] = 'required'; } ?> \ No newline at end of file +  * + diff --git a/libraries/joomla/form/field.php b/libraries/joomla/form/field.php index 6fa2b8754a08a..f1223bc0c6943 100644 --- a/libraries/joomla/form/field.php +++ b/libraries/joomla/form/field.php @@ -923,9 +923,9 @@ public function renderField($options = array()) $options['hiddenLabel'] = true; } - if ($showon = $this->getAttribute('showon')) + if (($showon = $this->getAttribute('showon'))) { - $showon = explode(':', $showon, 2); + $showon = explode(':', $showon, 2); $options['class'] .= ' showon_' . implode(' showon_', explode(',', $showon[1])); $id = $this->getName($showon[0]); $id = $this->multiple ? str_replace('[]', '', $id) : $id;