public function init() { $this->setName("delete"); $this->setMethod('POST'); $this->addAttribs(array('load-in' => 'content-container')); $description = new Agana_Form_Element_Html('delete_data_description'); $description->setLabel($this->_dataMessage); $this->addElement($description); if (is_array($this->_hiddenFields)) { foreach ($this->_hiddenFields as $field => $value) { $this->addElement('hidden', $field, array('value' => $value)); } } else { $this->_hiddenFields = array(); } $elements = array_merge(array('delete_data_description'), array_keys($this->_hiddenFields)); $this->addDisplayGroup(array('delete_data_description'), 'deleteFormGroup', array('legend' => 'Delete')); $this->addElement('submit', 'confirm', array('buttonType' => Twitter_Bootstrap_Form_Element_Button::BUTTON_DANGER, 'required' => false, 'ignore' => FALSE, 'label' => 'Confirm', 'xload-in' => 'content-container')); // $this->getElement('confirm')->addDecorator('HtmlTag', array( // 'tag' => 'span', // 'style' => 'float:left', //// 'openOnly' => true, //// 'placement' => Zend_Form_Decorator_Abstract::PREPEND // )); $this->addElement('submit', 'cancel', array('buttonType' => Twitter_Bootstrap_Form_Element_Button::BUTTON_PRIMARY, 'required' => false, 'label' => 'Cancel', 'load-in' => 'content-container')); // $this->getElement('cancel')->addDecorator('HtmlTag', array( // 'tag' => 'span', // 'style' => 'float:left;margin-left:1em;', //// 'openOnly' => true, //// 'placement' => Zend_Form_Decorator_Abstract::PREPEND // )); $this->addDisplayGroup(array('cancel', 'confirm', 'cancel-link'), 'actions-end', array('disableLoadDefaultDecorators' => true, 'decorators' => array('Actions'))); }
private function _addElementPersonPerformed() { $translate = Zend_Registry::get("Zend_Translate"); $url = new Zend_View_Helper_Url(); $urlSearch = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'search-form'), null, true); $urlNew = $url->url(array('module' => 'persons', 'controller' => 'person', 'action' => 'create'), null, true); $append = ''; if ($this->_action == self::ACTION_ADD) { $append .= '<a id="btnPersonPerformedSearch" href="' . $urlSearch . '" ' . ' rel="colorbox-search" search-return-id="id" search-return-value="person_name">' . '<i class="icon-search" rel="tooltip" data-original-title="' . $translate->_("Search person") . '"></i>' . '</a>'; } $description = new Agana_Form_Element_Html('person_performed_name', array()); //$description->addDecorator('Agana_Form_Decorator_Highlighted'); $description->setLabel('Person'); $this->addElement($description); $this->addElement('text', 'person_performed_name', array('label' => 'Person', 'value' => $this->_model ? $this->_model->getPerson()->getName() : '', 'dimension' => 2, 'disabled' => true, 'placeholder' => $translate->_('Use the links aside to search a person or create a new one'), 'append' => $append . ' | ' . '<a class="hide" id="btnPersonDetails" href="#" rel="colorbox-details">' . $translate->_("Details") . '</a>' . ' | ' . '<a class="hide" id="btnPersonCreate" href="' . $urlNew . '" rel="colorbox">' . '<i class="icon-plus-sign" rel="tooltip" data-original-title="' . $translate->_("Add new") . ' ' . $translate->_("person") . '"></i>' . '</a>')); }
public function init() { $this->setName("login"); $this->setMethod('post'); $this->addElement('text', 'name', array('filters' => array('StringTrim', 'StringToLower'), 'validators' => array(array('StringLength', false, array(0, 50))), 'required' => true, 'label' => 'User name', 'title' => $this->getTranslator()->_('Your user name identification'))); $this->addElement('password', 'pwd', array('filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(0, 50))), 'required' => true, 'label' => _('Password'))); $this->addDisplayGroup(array('name', 'pwd'), 'logingroup', array('legend' => 'User authentication')); $this->addElement('submit', 'btnLogin', array('required' => false, 'ignore' => true, 'label' => 'Login')); $forgot = new Agana_Form_Element_Html('forgotPwd'); $forgot->setValue($this->getTranslator()->_('Forgot your password? You can ask for reset it.') . ' <a href="reset-password"><translate>Reset password</translate></a>'); // $forgot->s('Forgot your password? You can ask for reset it.'); // $forgot->setDecorators(array( // array('Label', array('tag' => 'dt', 'class' => 'note_label')) // )); $this->addElement($forgot); // $token = new Zend_Form_Element_Hash('token'); // $token->setSalt(md5(uniqid(rand(), TRUE))); // $token->setTimeout(30); // $this->addElement($token); }