<?php



namespace Website\Tool;



class LoginForm extends \Zend_Form

{

    public $EmailLabel;

    public function getEmailLabel(){return $this->EmailLabel;}

    public function setEmailLabel($param){

        $this->EmailLabel = $param;

        if($this->_email instanceof \Zend_Form_Element) $this->_email->setLabel($param);

    }



    public $PwdLabel;

    public function getPwdLabel(){return $this->PwdLabel;}

    public function setPwdLabel($param){

        $this->PwdLabel = $param;

        if($this->_password instanceof \Zend_Form_Element) $this->_password->setLabel($param);

    }



    public $RememberMeLabel;

    public function getRememberMeLabel(){return $this->RememberMeLabel;}

    public function setRememberMeLabel($param){

        $this->RememberMeLabel = $param;

        if($this->_rememberMe instanceof \Zend_Form_Element) $this->_rememberMe->setLabel($param);

    }



    public $SubmitLabel;

    public function getSubmitLabel(){return $this->SubmitLabel;}

    public function setSubmitLabel($param){

        $this->SubmitLabel = $param;

        if($this->_submit instanceof \Zend_Form_Element) $this->_submit->setLabel($param);

    }



    public $_email;

    public $_password;

    public $_rememberMe;

    public $_submit;





    public function init()

    {

        $this->setMethod('post');



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

        $this->_email->setLabel('trad-email');

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

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

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





        $this->_password = new \Zend_Form_Element_Password('password');

        $this->_password->setLabel('trad-password');

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

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





        $this->_rememberMe = new \Zend_Form_Element_Checkbox('rememberme');

        $this->_rememberMe->setLabel('trad-remember-me');

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





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

        $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')),

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

        ));



    }

}