Ejemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     $helper = new Application_View_Helper_JQueryEnabled();
     if (!$helper->jQueryEnabled()) {
         $this->markTestSkipped('Javascript not enabled (JQuery missing).');
     }
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }