public function init() { $this->setName(strtolower(get_class())); $this->setMethod("post"); $oFormName = new Zend_Form_Element_Hidden("form_name"); $oFormName->setValue(get_class()); $oFormName->setIgnore(FALSE)->removeDecorator("Label"); $this->addElement($oFormName); $oSearchedText = new Zend_Form_Element_Text("searched_text"); $oSearchedText->setLabel("Szukana fraza:"); $oSearchedText->setRequired(TRUE); $oSearchedText->setFilters($this->_aFilters); $oSearchedText->setAttrib("class", "valid"); $this->addElement($oSearchedText); $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200)); $this->getElement("csrf_token")->removeDecorator("Label"); $oSubmit = $this->createElement("submit", "submit"); $oSubmit->setLabel("Szukaj"); $this->addElement($oSubmit); $oViewScript = new Zend_Form_Decorator_ViewScript(); $oViewScript->setViewModule("admin"); $oViewScript->setViewScript("_forms/_defaultform.phtml"); $this->clearDecorators(); $this->setDecorators(array(array($oViewScript))); $oElements = $this->getElements(); foreach ($oElements as $oElement) { $oElement->setFilters($this->_aFilters); $oElement->removeDecorator("Errors"); } }
public function init() { $this->setName(strtolower(get_class())); $this->setMethod("post"); $oFormName = new Zend_Form_Element_Hidden("form_name"); $oFormName->setValue(get_class()); $oFormName->setIgnore(FALSE)->removeDecorator("Label"); $this->addElement($oFormName); $oPostStep = new Zend_Form_Element_Hidden("post_step"); $oPostStep->addValidator(new Zend_Validate_GreaterThan(0)); $oPostStep->addValidator(new Zend_Validate_LessThan(2)); $oPostStep->setValue(1); $oPostStep->setIgnore(FALSE)->removeDecorator("Label"); $this->addElement($oPostStep); $oUserIdSelect = new Zend_Form_Element_Select("search_notification_user_id"); $oUserIdSelect->setLabel("Konsultant:"); $oUserIdSelect->setRequired(FALSE); $oUserIdSelect->addMultiOptions($this->_aAllUser); $this->addElement($oUserIdSelect); $oFromInitDate = new Zend_Form_Element_Text("from_init_date"); $oFromInitDate->setLabel("Data rozpoczęcia (od):"); $oFromInitDate->setRequired(FALSE); $oFromInitDate->setFilters($this->_aFilters); $this->addElement($oFromInitDate); $oToInitDate = new Zend_Form_Element_Text("to_init_date"); $oToInitDate->setLabel("Data rozpoczęcia (do):"); $oToInitDate->setRequired(FALSE); $oToInitDate->setFilters($this->_aFilters); $this->addElement($oToInitDate); $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200)); $this->getElement("csrf_token")->removeDecorator("Label"); $oSubmit = $this->createElement("submit", "search_statistics"); $oSubmit->setLabel("Szukaj"); $this->addElement($oSubmit); $oViewScript = new Zend_Form_Decorator_ViewScript(); $oViewScript->setViewModule("admin"); $oViewScript->setViewScript("_forms/_defaultform.phtml"); $this->clearDecorators(); $this->setDecorators(array(array($oViewScript))); $oElements = $this->getElements(); foreach ($oElements as $oElement) { $oElement->setFilters($this->_aFilters); $oElement->removeDecorator("Errors"); } }
public function init() { $this->setName(strtolower(get_class())); $this->setMethod("post"); $oSearchedText = new Zend_Form_Element_Text("smart_searched_text"); $oSearchedText->removeDecorator("label"); $oSearchedText->setRequired(FALSE); $oSearchedText->setFilters($this->_aFilters); $this->addElement($oSearchedText); $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200)); $this->getElement("csrf_token")->removeDecorator("Label"); $oViewScript = new Zend_Form_Decorator_ViewScript(); $oViewScript->setViewModule("admin"); $oViewScript->setViewScript("_forms/smartsearch.phtml"); $this->clearDecorators(); $this->setDecorators(array(array($oViewScript))); $oElements = $this->getElements(); foreach ($oElements as $oElement) { $oElement->setFilters($this->_aFilters); $oElement->removeDecorator("Errors"); } }
public function init() { $this->setName(strtolower(get_class())); $this->setMethod("post"); $oFormName = new Zend_Form_Element_Hidden("form_name"); $oFormName->removeDecorator("Label"); $oFormName->setValue(get_class()); $this->addElement($oFormName); $oRoleName = new Zend_Form_Element_Text("role_name"); $oRoleName->setLabel("Nazwa:"); $oRoleName->addValidator(new Zend_Validate_StringLength(array("min" => 1, "max" => 40))); $oRoleName->addValidator(new AppCms2_Validate_UserRole()); $oRoleName->setFilters($this->_aFilters); $oRoleName->setRequired(TRUE); $oRoleName->setAttrib("class", "valid"); $this->addElement($oRoleName); $oRoleEditId = new Zend_Form_Element_Hidden("role_edit_id"); $oRoleEditId->setValue(0); $oRoleEditId->setIgnore(FALSE)->removeDecorator("Label"); $this->addElement($oRoleEditId); $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200)); $this->getElement("csrf_token")->removeDecorator("Label"); $oSubmit = $this->createElement("submit", "submit"); $oSubmit->setLabel("Zapisz"); $this->addElement($oSubmit); $oViewScript = new Zend_Form_Decorator_ViewScript(); $oViewScript->setViewModule("admin"); $oViewScript->setViewScript("_forms/userrole.phtml"); $this->clearDecorators(); $this->setDecorators(array(array($oViewScript))); $oElements = $this->getElements(); foreach ($oElements as $oElement) { $oElement->setFilters($this->_aFilters); $oElement->removeDecorator("Errors"); } }
public function init() { $this->setMethod('post')->setAttrib('id', 'frmTest')->setAttrib('enctype', 'multipart/form-data'); // Elemento: Nombre $e = new Zend_Form_Element_Text('nombre'); $e->setLabel('Nombre'); $e->setFilters(array('StringToLower')); $this->addElement($e); // Elemento: activo $e = new Zend_Form_Element_Checkbox('activo'); $e->setLabel('Activo'); $this->addElement($e); // Elemento: activo2 $e = new Zend_Form_Element_Radio('activo2'); $e->setLabel('Activo2'); $_cat = new Application_Model_Categoria(); $values = $_cat->getComboValues(); $e->setMultiOptions($values); $e->setValue(array_rand($values)); $v = new Zend_Validate_InArray(array_keys($values)); $this->addElement($e); $e = new Zend_Form_Element_File('imagen'); $e->setLabel('Upload an image:'); $e->setDestination(APPLICATION_PATH . '/../public/uploads/'); $f = new Zend_Filter_File_Rename(array('target' => '123.jpg')); // Renombrar archivo $e->addFilter($f); $e->addValidator('Count', false, 1); // Solo 1 archivo $e->addValidator('Size', false, 102400); // limite de 100K $e->addValidator('Extension', false, 'jpg,png,gif'); // solo JPEG, PNG, and GIFs $this->addElement($e); $this->addElement('submit', 'Enviar'); }
public function init() { $this->setName(strtolower(get_class())); $this->setMethod("post"); $oFormName = new Zend_Form_Element_Hidden("form_name"); $oFormName->setValue(get_class()); $oFormName->setIgnore(FALSE)->removeDecorator("Label"); $this->addElement($oFormName); $oNotificationTypeId = new Zend_Form_Element_MultiCheckbox("notification_type_id"); $oNotificationTypeId->setLabel("Typ:"); $oNotificationTypeId->setRequired(FALSE); $oNotificationTypeId->addMultiOptions($this->_aAllNotificationType); $this->addElement($oNotificationTypeId); $oNotificationStatusId = new Zend_Form_Element_MultiCheckbox("notification_status_id"); $oNotificationStatusId->setLabel("Status:"); $oNotificationStatusId->setRequired(FALSE); $oNotificationStatusId->addMultiOptions($this->_aAllNotificationStatus); $this->addElement($oNotificationStatusId); $oNotificationPriorityId = new Zend_Form_Element_MultiCheckbox("notification_priority_id"); $oNotificationPriorityId->setLabel("Priorytet:"); $oNotificationPriorityId->setRequired(FALSE); $oNotificationPriorityId->addMultiOptions($this->_aAllNotificationPriority); $this->addElement($oNotificationPriorityId); $oNotificationCategoryId = new Zend_Form_Element_Select("search_notification_category_id"); $oNotificationCategoryId->setLabel("Kategoria pytania:"); $oNotificationCategoryId->setRequired(FALSE); $oNotificationCategoryId->addMultiOptions($this->_aAllNotificationCategory); $this->addElement($oNotificationCategoryId); $oUserId = new Zend_Form_Element_Select("search_notification_user_id"); $oUserId->setLabel("Konsultant:"); $oUserId->setRequired(FALSE); $oUserId->addMultiOptions($this->_aAllUser); $this->addElement($oUserId); $oInitDate = new Zend_Form_Element_Text("init_date"); $oInitDate->setLabel("Data rozpoczęcia:"); $oInitDate->setRequired(FALSE); $oInitDate->setFilters($this->_aFilters); $this->addElement($oInitDate); $oBlankNotificationUserId = new Zend_Form_Element_Checkbox("search_blank_notification_user_id"); $oBlankNotificationUserId->setLabel("Pokaż nieprzydzielone zgłoszenia:"); $this->addElement($oBlankNotificationUserId); $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200)); $this->getElement("csrf_token")->removeDecorator("Label"); $oSubmit = $this->createElement("submit", "search_notification"); $oSubmit->setLabel("Szukaj"); $this->addElement($oSubmit); $oViewScript = new Zend_Form_Decorator_ViewScript(); $oViewScript->setViewModule("admin"); $oViewScript->setViewScript("_forms/_defaultform.phtml"); $this->clearDecorators(); $this->setDecorators(array(array($oViewScript))); $oElements = $this->getElements(); foreach ($oElements as $oElement) { $oElement->setFilters($this->_aFilters); $oElement->removeDecorator("Errors"); } }