From ed6c22242324df558b9cc43824564b9b2785ad57 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 12 Feb 2015 11:10:10 -0500 Subject: [PATCH] Refactored common email form fields to shared template - fixed ReCaptcha bugs in the process. --- .../src/VuFind/Controller/AjaxController.php | 10 ++++- .../src/VuFind/Controller/CartController.php | 4 +- .../VuFind/Controller/SearchController.php | 4 +- .../templates/Helpers/email-form-fields.phtml | 14 +++++++ themes/blueprint/templates/cart/email.phtml | 14 +------ themes/blueprint/templates/record/email.phtml | 15 +------- themes/blueprint/templates/search/email.phtml | 14 +------ .../templates/Helpers/email-form-fields.phtml | 37 ++++++++++++++++++ themes/bootstrap3/templates/cart/email.phtml | 37 +----------------- .../bootstrap3/templates/record/email.phtml | 38 +------------------ .../bootstrap3/templates/search/email.phtml | 37 +----------------- .../templates/Helpers/email-form-fields.phtml | 17 +++++++++ .../jquerymobile/templates/record/email.phtml | 22 ++--------- .../jquerymobile/templates/search/email.phtml | 14 +------ 14 files changed, 93 insertions(+), 184 deletions(-) create mode 100644 themes/blueprint/templates/Helpers/email-form-fields.phtml create mode 100644 themes/bootstrap3/templates/Helpers/email-form-fields.phtml create mode 100644 themes/jquerymobile/templates/Helpers/email-form-fields.phtml diff --git a/module/VuFind/src/VuFind/Controller/AjaxController.php b/module/VuFind/src/VuFind/Controller/AjaxController.php index 3752acc2a81..52a59ea26e8 100644 --- a/module/VuFind/src/VuFind/Controller/AjaxController.php +++ b/module/VuFind/src/VuFind/Controller/AjaxController.php @@ -1021,7 +1021,7 @@ class AjaxController extends AbstractBase try { // Check captcha $this->recaptcha()->setErrorMode('throw'); - $useRecaptcha = $this->recaptcha()->active('sms'); + $useRecaptcha = $this->recaptcha()->active('email'); // Process form submission: if (!$this->formWasSubmitted('id', $useRecaptcha)) { throw new \Exception('recaptcha_not_passed'); @@ -1085,6 +1085,14 @@ class AjaxController extends AbstractBase // Attempt to send the email: try { + // Check captcha + $this->recaptcha()->setErrorMode('throw'); + $useRecaptcha = $this->recaptcha()->active('email'); + // Process form submission: + if (!$this->formWasSubmitted('url', $useRecaptcha)) { + throw new \Exception('recaptcha_not_passed'); + } + $view = $this->createEmailViewModel(); $mailer = $this->getServiceLocator()->get('VuFind\Mailer'); $mailer->sendLink( diff --git a/module/VuFind/src/VuFind/Controller/CartController.php b/module/VuFind/src/VuFind/Controller/CartController.php index 9975a1834f3..a632da93966 100644 --- a/module/VuFind/src/VuFind/Controller/CartController.php +++ b/module/VuFind/src/VuFind/Controller/CartController.php @@ -202,9 +202,11 @@ class CartController extends AbstractBase $view = $this->createEmailViewModel(); $view->records = $this->getRecordLoader()->loadBatch($ids); + // Set up reCaptcha + $view->useRecaptcha = $this->recaptcha()->active('email'); // Process form submission: - if ($this->formWasSubmitted('submit')) { + if ($this->formWasSubmitted('submit', $view->useRecaptcha)) { // Build the URL to share: $params = array(); foreach ($ids as $current) { diff --git a/module/VuFind/src/VuFind/Controller/SearchController.php b/module/VuFind/src/VuFind/Controller/SearchController.php index b26d708aad6..c2df102b1a9 100644 --- a/module/VuFind/src/VuFind/Controller/SearchController.php +++ b/module/VuFind/src/VuFind/Controller/SearchController.php @@ -82,6 +82,8 @@ class SearchController extends AbstractSearch // If a URL was explicitly passed in, use that; otherwise, try to // find the HTTP referrer. $view = $this->createEmailViewModel(); + // Set up reCaptcha + $view->useRecaptcha = $this->recaptcha()->active('email'); $view->url = $this->params()->fromPost( 'url', $this->params()->fromQuery( 'url', $this->getRequest()->getServer()->get('HTTP_REFERER') @@ -109,7 +111,7 @@ class SearchController extends AbstractSearch } // Process form submission: - if ($this->formWasSubmitted('submit')) { + if ($this->formWasSubmitted('submit', $view->useRecaptcha)) { // Attempt to send the email and show an appropriate flash message: try { // If we got this far, we're ready to send the email: diff --git a/themes/blueprint/templates/Helpers/email-form-fields.phtml b/themes/blueprint/templates/Helpers/email-form-fields.phtml new file mode 100644 index 00000000000..72f6eec68f1 --- /dev/null +++ b/themes/blueprint/templates/Helpers/email-form-fields.phtml @@ -0,0 +1,14 @@ +<label class="displayBlock" for="email_to"><?=$this->transEsc('To')?>:</label> +<input id="email_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" size="40" class="mainFocus <?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> +<? if (!$this->disableFrom): ?> + <label class="displayBlock" for="email_from"><?=$this->transEsc('From')?>:</label> + <input id="email_from" type="text" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> +<? endif; ?> +<label class="displayBlock" for="email_message"><?=$this->transEsc('Message')?>:</label> +<textarea id="email_message" name="message" rows="3" cols="40"><?=isset($this->message) ? $this->message : ''?></textarea> +<br/> +<?=$this->recaptcha()->html($this->useRecaptcha) ?> +<input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> +<? if ($this->disableFrom && $this->userEmailInFrom): ?> + <input type="checkbox" id="ccme" name="ccself"/><label for="ccme"><?=$this->translate('send_email_copy_to_me'); ?></label> +<? endif; ?> diff --git a/themes/blueprint/templates/cart/email.phtml b/themes/blueprint/templates/cart/email.phtml index e7f3976cc32..f89e5ca4c7a 100644 --- a/themes/blueprint/templates/cart/email.phtml +++ b/themes/blueprint/templates/cart/email.phtml @@ -13,17 +13,5 @@ <input type="hidden" name="ids[]" value="<?=$this->escapeHtmlAttr($current->getResourceSource() . '|' . $current->getUniqueId())?>" /> <? endforeach; ?> <br /> - <label class="displayBlock" for="email_to"><?=$this->transEsc('To')?>:</label> - <input id="email_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" size="40" class="mainFocus <?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> - <? if (!$this->disableFrom): ?> - <label class="displayBlock" for="email_from"><?=$this->transEsc('From')?>:</label> - <input id="email_from" type="text" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> - <? endif; ?> - <label class="displayBlock" for="email_message"><?=$this->transEsc('Message')?>:</label> - <textarea id="email_message" name="message" rows="3" cols="40"><?=isset($this->message) ? $this->message : ''?></textarea> - <br/> - <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> - <? if ($this->disableFrom && $this->userEmailInFrom): ?> - <input type="checkbox" id="ccme" name="ccself"/><label for="ccme"><?=$this->translate('send_email_copy_to_me'); ?></label> - <? endif; ?> + <?=$this->render('Helpers/email-form-fields.phtml')?> </form> diff --git a/themes/blueprint/templates/record/email.phtml b/themes/blueprint/templates/record/email.phtml index 45486d7f079..762fd95d2a0 100644 --- a/themes/blueprint/templates/record/email.phtml +++ b/themes/blueprint/templates/record/email.phtml @@ -10,18 +10,5 @@ <form action="" method="post" name="emailRecord"> <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" /> <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" /> - <label class="displayBlock" for="email_to"><?=$this->transEsc('To')?>:</label> - <input id="email_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" size="40" class="mainFocus <?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> - <? if (!$this->disableFrom): ?> - <label class="displayBlock" for="email_from"><?=$this->transEsc('From')?>:</label> - <input id="email_from" type="text" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> - <? endif; ?> - <label class="displayBlock" for="email_message"><?=$this->transEsc('Message')?>:</label> - <textarea id="email_message" name="message" rows="3" cols="40"><?=isset($this->message) ? $this->message : ''?></textarea> - <br/> - <?=$this->recaptcha()->html($this->useRecaptcha) ?> - <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> - <? if ($this->disableFrom && $this->userEmailInFrom): ?> - <input type="checkbox" id="ccme" name="ccself"/><label for="ccme"><?=$this->translate('send_email_copy_to_me'); ?></label> - <? endif; ?> + <?=$this->render('Helpers/email-form-fields.phtml')?> </form> diff --git a/themes/blueprint/templates/search/email.phtml b/themes/blueprint/templates/search/email.phtml index e026683a8e1..3d4b9378e90 100644 --- a/themes/blueprint/templates/search/email.phtml +++ b/themes/blueprint/templates/search/email.phtml @@ -9,17 +9,5 @@ <?=$this->flashmessages()?> <form action="" method="post" name="emailSearch"> <input type="hidden" name="url" value="<?=$this->escapeHtmlAttr($this->url)?>" /> - <label class="displayBlock" for="email_to"><?=$this->transEsc('To')?>:</label> - <input id="email_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" size="40" class="mainFocus <?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> - <? if (!$this->disableFrom): ?> - <label class="displayBlock" for="email_from"><?=$this->transEsc('From')?>:</label> - <input id="email_from" type="text" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> - <? endif; ?> - <label class="displayBlock" for="email_message"><?=$this->transEsc('Message')?>:</label> - <textarea id="email_message" name="message" rows="3" cols="40"><?=isset($this->message) ? $this->message : ''?></textarea> - <br/> - <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> - <? if ($this->disableFrom && $this->userEmailInFrom): ?> - <input type="checkbox" id="ccme" name="ccself"/><label for="ccme"><?=$this->translate('send_email_copy_to_me'); ?></label> - <? endif; ?> + <?=$this->render('Helpers/email-form-fields.phtml')?> </form> diff --git a/themes/bootstrap3/templates/Helpers/email-form-fields.phtml b/themes/bootstrap3/templates/Helpers/email-form-fields.phtml new file mode 100644 index 00000000000..25d914108bf --- /dev/null +++ b/themes/bootstrap3/templates/Helpers/email-form-fields.phtml @@ -0,0 +1,37 @@ +<div class="form-group"> + <label class="col-sm-3 control-label" for="email_to"><?=$this->transEsc('To')?>:</label> + <div class="col-sm-9"> + <input type="email" id="email_to" class="form-control" oninvalid="$('#modal .fa-spinner').remove()" name="to" value="<?=isset($this->to) ? $this->to : ''?>"/> + </div> +</div> +<? if (!$this->disableFrom): ?> + <div class="form-group"> + <label class="col-sm-3 control-label" for="email_from"><?=$this->transEsc('From')?>:</label> + <div class="col-sm-9"> + <input type="email" id="email_from" oninvalid="$('#modal .fa-spinner').remove()" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="form-control"/> + </div> + </div> +<? endif; ?> +<div class="form-group"> + <label class="col-sm-3 control-label" for="email_message"><?=$this->transEsc('Message')?>:</label> + <div class="col-sm-9"> + <textarea id="email_message" class="form-control" name="message" rows="4"><?=isset($this->message) ? $this->message : ''?></textarea> + </div> +</div> +<? if ($this->disableFrom && $this->userEmailInFrom): ?> + <div class="form-group"> + <div class="col-sm-9 col-sm-offset-3"> + <div class="checkbox"> + <label> + <input type="checkbox" name="ccself"/> <?=$this->translate('send_email_copy_to_me'); ?> + </label> + </div> + </div> + </div> +<? endif ?> +<?=$this->recaptcha()->html($this->useRecaptcha) ?> +<div class="form-group"> + <div class="col-sm-9 col-sm-offset-3"> + <input type="submit" class="btn btn-primary" name="submit" value="<?=$this->transEsc('Send')?>"/> + </div> +</div> diff --git a/themes/bootstrap3/templates/cart/email.phtml b/themes/bootstrap3/templates/cart/email.phtml index 782aa11992d..1c78eaab2fb 100644 --- a/themes/bootstrap3/templates/cart/email.phtml +++ b/themes/bootstrap3/templates/cart/email.phtml @@ -31,42 +31,7 @@ <? endif; ?> </div> </div> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_to"><?=$this->transEsc('To')?>:</label> - <div class="col-sm-9"> - <input id="email_to" type="email" name="to" value="<?=isset($this->to) ? $this->to : ''?>" size="40" class="form-control" oninvalid="$('#modal .fa-spinner').remove()"/> - </div> - </div> - <? if (!$this->disableFrom): ?> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_from"><?=$this->transEsc('From')?>:</label> - <div class="col-sm-9"> - <input id="email_from" type="email" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="form-control" oninvalid="$('#modal .fa-spinner').remove()"/> - </div> - </div> - <? endif; ?> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_message"><?=$this->transEsc('Message')?>:</label> - <div class="col-sm-9"> - <textarea id="email_message" name="message" rows="3" cols="40" class="form-control"><?=isset($this->message) ? $this->message : ''?></textarea> - </div> - </div> - <? if ($this->disableFrom && $this->userEmailInFrom): ?> - <div class="form-group"> - <div class="col-sm-9 col-sm-offset-3"> - <div class="checkbox"> - <label> - <input type="checkbox" name="ccself"/> <?=$this->translate('send_email_copy_to_me'); ?> - </label> - </div> - </div> - </div> - <? endif ?> - <div class="form-group"> - <div class="col-sm-9 col-sm-offset-3"> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> - </div> - </div> + <?=$this->render('Helpers/email-form-fields.phtml')?> </form> <? $script = <<<JS diff --git a/themes/bootstrap3/templates/record/email.phtml b/themes/bootstrap3/templates/record/email.phtml index 45e0973acad..ee0bfce24d5 100644 --- a/themes/bootstrap3/templates/record/email.phtml +++ b/themes/bootstrap3/templates/record/email.phtml @@ -11,41 +11,5 @@ <form class="form-horizontal" action="" method="post" name="emailRecord"> <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" /> <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" /> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_to"><?=$this->transEsc('To')?>:</label> - <div class="col-sm-9"> - <input type="email" id="email_to" class="form-control" oninvalid="$('#modal .fa-spinner').remove()" name="to" value="<?=isset($this->to) ? $this->to : ''?>"/> - </div> - </div> - <? if (!$this->disableFrom): ?> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_from"><?=$this->transEsc('From')?>:</label> - <div class="col-sm-9"> - <input type="email" id="email_from" oninvalid="$('#modal .fa-spinner').remove()" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="form-control"/> - </div> - </div> - <? endif; ?> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_message"><?=$this->transEsc('Message')?>:</label> - <div class="col-sm-9"> - <textarea id="email_message" class="form-control" name="message" rows="4"><?=isset($this->message) ? $this->message : ''?></textarea> - </div> - </div> - <? if ($this->disableFrom && $this->userEmailInFrom): ?> - <div class="form-group"> - <div class="col-sm-9 col-sm-offset-3"> - <div class="checkbox"> - <label> - <input type="checkbox" name="ccself"/> <?=$this->translate('send_email_copy_to_me'); ?> - </label> - </div> - </div> - </div> - <? endif ?> - <?=$this->recaptcha()->html($this->useRecaptcha) ?> - <div class="form-group"> - <div class="col-sm-9 col-sm-offset-3"> - <input type="submit" class="btn btn-primary" name="submit" value="<?=$this->transEsc('Send')?>"/> - </div> - </div> + <?=$this->render('Helpers/email-form-fields.phtml')?> </form> diff --git a/themes/bootstrap3/templates/search/email.phtml b/themes/bootstrap3/templates/search/email.phtml index 4e31a12c175..5366ddb993e 100644 --- a/themes/bootstrap3/templates/search/email.phtml +++ b/themes/bootstrap3/templates/search/email.phtml @@ -9,40 +9,5 @@ <?=$this->flashmessages()?> <form class="form-horizontal" action="" method="post" name="emailSearch"> <input type="hidden" name="url" value="<?=$this->escapeHtmlAttr($this->url)?>" /> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_to"><?=$this->transEsc('To')?>:</label> - <div class="col-sm-9"> - <input class="form-control" id="email_to" type="email" name="to" value="<?=isset($this->to) ? $this->to : ''?>"/> - </div> - </div> - <? if (!$this->disableFrom): ?> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_from"><?=$this->transEsc('From')?>:</label> - <div class="col-sm-9"> - <input class="form-control" id="email_from" type="email" name="from" value="<?=isset($this->from) ? $this->from : ''?>"/> - </div> - </div> - <? endif; ?> - <div class="form-group"> - <label class="col-sm-3 control-label" for="email_message"><?=$this->transEsc('Message')?>:</label> - <div class="col-sm-9"> - <textarea class="form-control" id="email_message" name="message" rows="3"><?=isset($this->message) ? $this->message : ''?></textarea> - </div> - </div> - <? if ($this->disableFrom && $this->userEmailInFrom): ?> - <div class="form-group"> - <div class="col-sm-9 col-sm-offset-3"> - <div class="checkbox"> - <label> - <input type="checkbox" name="ccself"/> <?=$this->translate('send_email_copy_to_me'); ?> - </label> - </div> - </div> - </div> - <? endif ?> - <div class="form-group"> - <div class="col-sm-9 col-sm-offset-3"> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> - </div> - </div> + <?=$this->render('Helpers/email-form-fields.phtml')?> </form> diff --git a/themes/jquerymobile/templates/Helpers/email-form-fields.phtml b/themes/jquerymobile/templates/Helpers/email-form-fields.phtml new file mode 100644 index 00000000000..0e9e2a00eb9 --- /dev/null +++ b/themes/jquerymobile/templates/Helpers/email-form-fields.phtml @@ -0,0 +1,17 @@ +<div data-role="fieldcontain"> + <label for="email_to"><?=$this->transEsc('To')?>:</label> + <input id="email_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" size="40" class="mainFocus <?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> + <? if (!$this->disableFrom): ?> + <label for="email_from"><?=$this->transEsc('From')?>:</label> + <input id="email_from" type="text" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> + <? endif; ?> + <label for="email_message"><?=$this->transEsc('Message')?>:</label> + <textarea id="email_message" name="message"><?=isset($this->message) ? $this->message : ''?></textarea> +</div> +<?=$this->recaptcha()->html($this->useRecaptcha) ?> +<div data-role="fieldcontain"> + <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> +</div> +<? if ($this->disableFrom && $this->userEmailInFrom): ?> + <input type="checkbox" id="ccme" name="ccself"/><label for="ccme"><?=$this->translate('send_email_copy_to_me'); ?></label> +<? endif; ?> diff --git a/themes/jquerymobile/templates/record/email.phtml b/themes/jquerymobile/templates/record/email.phtml index 5012278b798..a8b3798c65a 100644 --- a/themes/jquerymobile/templates/record/email.phtml +++ b/themes/jquerymobile/templates/record/email.phtml @@ -7,25 +7,9 @@ <div data-role="content"> <?=$this->flashmessages()?> <form method="post" name="emailRecord" data-ajax="false"> - <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" /> - <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" /> - <div data-role="fieldcontain"> - <label for="email_to"><?=$this->transEsc('To')?>:</label> - <input id="email_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" size="40" class="mainFocus <?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> - <? if (!$this->disableFrom): ?> - <label for="email_from"><?=$this->transEsc('From')?>:</label> - <input id="email_from" type="text" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" class="<?=$this->jqueryValidation(array('required'=>'This field is required', 'email'=>'Email address is invalid'))?>"/> - <? endif; ?> - <label for="email_message"><?=$this->transEsc('Message')?>:</label> - <textarea id="email_message" name="message"><?=isset($this->message) ? $this->message : ''?></textarea> - </div> - <?=$this->recaptcha()->html($this->useRecaptcha) ?> - <div data-role="fieldcontain"> - <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> - </div> - <? if ($this->disableFrom && $this->userEmailInFrom): ?> - <input type="checkbox" id="ccme" name="ccself"/><label for="ccme"><?=$this->translate('send_email_copy_to_me'); ?></label> - <? endif; ?> + <input type="hidden" name="id" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" /> + <input type="hidden" name="source" value="<?=$this->escapeHtmlAttr($this->driver->getResourceSource())?>" /> + <?=$this->render('Helpers/email-form-fields.phtml')?> </form> </div> <?=$this->mobileMenu()->footer()?> diff --git a/themes/jquerymobile/templates/search/email.phtml b/themes/jquerymobile/templates/search/email.phtml index e3e629aae14..6b879aee162 100644 --- a/themes/jquerymobile/templates/search/email.phtml +++ b/themes/jquerymobile/templates/search/email.phtml @@ -8,19 +8,7 @@ <?=$this->flashmessages()?> <form method="post" name="emailSearch" data-ajax="false"> <input type="hidden" name="url" value="<?=$this->escapeHtmlAttr($this->url)?>" /> - <div data-role="fieldcontain"> - <label for="email_to"><?=$this->transEsc('To')?>:</label> - <input id="email_to" type="text" name="to" value="<?=isset($this->to) ? $this->to : ''?>" size="40" /> - <? if (!$this->disableFrom): ?> - <label for="email_from"><?=$this->transEsc('From')?>:</label> - <input id="email_from" type="text" name="from" value="<?=isset($this->from) ? $this->from : ''?>" size="40" /> - <? endif; ?> - <label for="email_message"><?=$this->transEsc('Message')?>:</label> - <textarea id="email_message" name="message"><?=isset($this->message) ? $this->message : ''?></textarea> - </div> - <div data-role="fieldcontain"> - <input class="button" type="submit" name="submit" value="<?=$this->transEsc('Send')?>"/> - </div> + <?=$this->render('Helpers/email-form-fields.phtml')?> </form> </div> <?=$this->mobileMenu()->footer()?> -- GitLab