Skip to content

Commit

Permalink
moved captchaEnabled to the view
Browse files Browse the repository at this point in the history
moved captchaEnabled to the view
  • Loading branch information
alikon authored Sep 7, 2016
1 parent ecd159f commit 1ce657b
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions components/com_contact/views/contact/tmpl/default_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,11 @@
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

$captchaEnabled = false;

$captchaSet = $this->params->get('captcha', JFactory::getApplication()->get('captcha', '0'));

foreach (JPluginHelper::getPlugin('captcha') as $plugin)
{
if ($captchaSet === $plugin->name)
{
$captchaEnabled = true;
break;
}
}
?>
<div class="contact-form">
<form id="contact-form" action="<?php echo JRoute::_('index.php'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset): ?>
<?php if ($fieldset->name === 'captcha' && !$captchaEnabled) : ?>
<?php if ($fieldset->name === 'captcha' && !$this->captchaEnabled) : ?>
<?php continue; ?>
<?php endif; ?>
<?php $fields = $this->form->getFieldset($fieldset->name); ?>
Expand Down

0 comments on commit 1ce657b

Please sign in to comment.