Skip to content

Commit

Permalink
[com_contact] - moved the captchaEnabled var out of the default.php f…
Browse files Browse the repository at this point in the history
…ile to the view.html.php file

moved the captchaEnabled var out of the default.php file to the view.html.php file.
  • Loading branch information
alikon authored Sep 7, 2016
1 parent 72430f5 commit ecd159f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion components/com_contact/views/contact/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ class ContactViewContact extends JViewLegacy
*/
protected $return_page;

/**
* Should we show a captcha form for the submission of the contact request?
*
* @var bool
* @since __DEPLOY_VERSION__
*/
protected $captchaEnabled = false;

/**
* Execute and display a template script.
*
Expand Down Expand Up @@ -288,8 +296,17 @@ public function display($tpl = null)

$model = $this->getModel();
$model->hit();
$this->_prepareDocument();

foreach (JPluginHelper::getPlugin('captcha') as $plugin)
{
if ($captchaSet === $plugin->name)
{
$this->captchaEnabled = true;
break;
}
}

$this->_prepareDocument();
return parent::display($tpl);
}

Expand Down

0 comments on commit ecd159f

Please sign in to comment.