public function setUp() { parent::setUp(); $helper = new Application_View_Helper_JQueryEnabled(); if (!$helper->jQueryEnabled()) { $this->markTestSkipped('Javascript not enabled (JQuery missing).'); } }
/** * Creates the reset button to form. * * The button uses Javascript to clear the form without submitting a request, if jQuery is present. * The necessary decorators are set for the button. * * @return void|Zend_Form */ public function createResetButton() { $button = $this->createElement('submit', self::ELEMENT_RESET, array('id' => 'edit-reset-advanced-search', 'class' => 'form-submit', 'label' => 'advanced_search_form_reset_action')); $helper = new Application_View_Helper_JQueryEnabled(); if ($helper->jQueryEnabled()) { $button->setAttrib('onclick', 'return resetAdvancedSearchForm();'); } $button->setDecorators(array('ViewHelper', array(array('submit-wrapper' => 'HtmlTag'), array('tag' => 'span', 'class' => 'form-submit-wrapper')), array(array('form-item' => 'HtmlTag'), array('tag' => 'div', 'id' => 'edit-reset-advanced-search-wrapper', 'class' => 'form-item')))); return $button; }