public function init() { parent::init(); $this->setDecorators(array('FormElements', 'Form')); $this->setUseNameAsLabel(true); $this->setLabelPrefix('admin_account_label_'); $this->addElement('Login', self::ELEMENT_LOGIN, array('label' => 'admin_account_label_login')); $this->getElement(self::ELEMENT_LOGIN)->addValidator(new Application_Form_Validate_LoginAvailable(array('ignoreCase' => true))); $this->addElement('Text', self::ELEMENT_FIRSTNAME); $this->addElement('Text', self::ELEMENT_LASTNAME); $this->addElement('Email', self::ELEMENT_EMAIL); $this->addElement('Password', self::ELEMENT_PASSWORD); $this->addElement('Password', self::ELEMENT_CONFIRM_PASSWORD, array('label' => 'admin_account_label_confirmpassword')); $this->getElement(self::ELEMENT_CONFIRM_PASSWORD)->addValidator(new Application_Form_Validate_Password()); $this->getElement(self::ELEMENT_PASSWORD)->addErrorMessages(array(Zend_Validate_StringLength::TOO_SHORT => 'admin_account_error_password_tooshort')); $this->addElement('Submit', self::ELEMENT_SUBMIT, array('label' => 'account_form_save')); }
/** * Initializes the form and its elements. * @throws Zend_Form_Exception */ public function init() { parent::init(); $this->setDecorators(array('FormElements', 'Form', array('HtmlTag', array('tag' => 'div', 'class' => 'form-wrapper')))); $this->setAttrib('class', 'opus_form'); // TODO with underline, change? if ($this->searchMode !== 'authorsearch') { $this->addSearchOptions(); } $searchFields = array('author', 'title', 'persons', 'referee', 'abstract', 'fulltext'); if ($this->searchMode !== 'authorsearch') { $searchFields[] = 'year'; } $this->addSearchFields($searchFields); $this->addElement($this->createSearchButton()); $this->addElement($this->createResetButton()); $this->addElement('hidden', self::ELEMENT_SEARCHTYPE, array('value' => 'advanced')); $this->addElement('hidden', self::ELEMENT_START, array('value' => 0)); $this->addElement('hidden', self::ELEMENT_SORTFIELD, array('value' => 'score')); $this->addElement('hidden', self::ELEMENT_SORTORDER, array('value' => 'desc')); }
/** * Initialisiert die Formularelement. */ public function init() { parent::init(); $this->addElement('hidden', self::ELEMENT_MODEL_ID, array('required' => true, 'validators' => array('int'))); $this->addElement('submit', self::ELEMENT_YES, array('label' => 'answer_yes')); $this->addElement('submit', self::ELEMENT_NO, array('label' => 'answer_no')); $this->setLegend($this->getFormLegend()); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'confirmation.phtml')), array('Fieldset', array('class' => 'headline')), 'Form')); }
/** * Initialisiert Formular. * * Setzt Decorators so, daß das Rendering in einem View Script erfolgt. */ public function init() { parent::init(); $this->initDecorators(); }
public function init() { parent::init(); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'tableheader.phtml')))); }