<?php



namespace Website\Tool;



class ConnectAgencyForm extends \Zend_Form

{

    public $_email;

    public $_search;

    public $_agency;

    public $_submit;

    public $_submitSearch;



    public function init(){



        $this->setMethod('post');



        $this->_email = new \Zend_Form_Element_Hidden('email');

        $this->_email->setRequired(true);

        $this->_email->setFilters(array('StringTrim'));

        $this->addElement($this->_email);



        $this->_search = new \Zend_Form_Element_Text('search');

        $this->_search->setLabel('trad-search-your-agency');



        $this->_search->setFilters(array('StringTrim'));

        $this->addElement($this->_search);







        $this->_submitSearch = new \Zend_Form_Element_Submit('submit_search');

        $this->_submitSearch->setIgnore(true);

        $this->_submitSearch->setLabel('trad-submit-search');

        $this->addElement($this->_submitSearch);



        $this->_agency = new \Zend_Form_Element_Select('agency');

        $this->_agency->setLabel('trad-select-agency');

        $this->_agency->setFilters(array('StringTrim'));

        $this->_agency->setRegisterInArrayValidator(false);

        $this->addElement($this->_agency);



        $this->_submit = new \Zend_Form_Element_Submit('submit_link');

        $this->_submit->setIgnore(true);

        $this->_submit->setLabel('trad-submit');

        $this->addElement($this->_submit);



        $this->setDecorators(array(

            'FormElements',

            array('HtmlTag', array('tag' => 'div')),

            'Form'

        ));



        $this->setElementDecorators(array(

            'ViewHelper',

            'Errors',

            array(array('data' => 'HtmlTag'), array('tag' => 'span')),

            array('Label', array('tag' => 'span', "class" => 'label')),

            array(array('row' => 'HtmlTag'), array('tag' => 'div'))

        ));



        $this->_submit->setDecorators(array(

            'ViewHelper',

            'Errors',

            array(array('data' => 'HtmlTag'), array('tag' => 'span')),

            array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'submit'))

        ));



        $this->_submitSearch->setDecorators(array(

            'ViewHelper',

            'Errors',

            array(array('data' => 'HtmlTag'), array('tag' => 'span')),

            array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'submit'))

        ));



    }



}