Пример #1
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('dieaxis');
     $die_axis_name = new Zend_Form_Element_Text('die_axis_name');
     $die_axis_name->setLabel('Die axis term: ')->setRequired(true)->setAttrib('size', 70)->addErrorMessage('Please enter a term.')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Die axis term is in use: ')->setRequired(true)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper');
     $submit->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($die_axis_name, $valid, $submit));
     $this->addDisplayGroup(array('die_axis_name', 'valid'), 'details');
     $this->details->setLegend('Die axis details: ');
     $this->details->removeDecorator('HtmlTag');
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Пример #2
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('quotes');
     $quote = new Pas_Form_Element_RTE('quote');
     $quote->setLabel('Quote or announcement: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Basic')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $quotedBy = new Zend_Form_Element_Text('quotedBy');
     $quotedBy->setLabel('Origin of quote/announcement: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please state where this comes from.');
     $expire = new Zend_Form_Element_Text('expire');
     $expire->setLabel('Expires from use: ')->setRequired(true)->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please provide expiry date.')->setDecorators($decorators);
     $valid = new Zend_Form_Element_Checkbox('status');
     $valid->setLabel('Quote/Announcement is in use: ')->setRequired(true)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setValue('quote')->addMultiOptions(array(NULL => 'Choose type', 'quote' => 'Quote', 'announcement' => 'Announcement'))->setDecorators($decorators);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper');
     $submit->removeDecorator('HtmlTag');
     $this->addElements(array($quote, $quotedBy, $valid, $expire, $type, $submit));
     $this->addDisplayGroup(array('quote', 'quotedBy', 'status', 'expire', 'type', 'submit'), 'details');
     $this->details->removeDecorator('HtmlTag');
     $this->details->removeDecorator('DtDdWrapper');
 }
Пример #3
0
 public function __construct($options = null)
 {
     $authors = new Users();
     $authorOptions = $authors->getAuthors();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setName('addcontent');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Content Title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addValidator('NotEmpty')->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $menuTitle = new Zend_Form_Element_Text('menuTitle');
     $menuTitle->setLabel('Menu Title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addValidator('NotEmpty')->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $author = new Zend_Form_Element_Select('author');
     $author->setLabel('Set the author of the article: ')->addMultiOptions(array('Choose an author' => $authorOptions))->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addErrorMessage('You must choose an author')->setDecorators($decorators);
     $excerpt = new Zend_Form_Element_Textarea('excerpt');
     $excerpt->setLabel('Optional excerpt: ')->setRequired(false)->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StripTags', 'StringTrim'));
     $body = new Pas_Form_Element_RTE('body');
     $body->setLabel('Main body of text: ')->setRequired(true)->setAttrib('rows', 30)->setAttrib('cols', 60)->addErrorMessage('You must enter a main body of text')->addFilter('HtmlBody')->setAttrib('Height', 400)->addFilter('EmptyParagraph')->addFilter('StringTrim')->addFilter('WordChars');
     $section = new Zend_Form_Element_Select('section');
     $section->setLabel('Set site section to appear under: ')->addMultiOptions(array('index' => 'Home page', 'info' => 'Site information', 'staffs' => 'Staffordshire Hoard Symposium', 'getinvolved' => 'Get involved', 'frg' => 'Voluntary recording guide', 'byzantinecoins' => 'Byzantine coin guide', 'greekromancoins' => 'Greek and Roman coin guide', 'conservation' => 'Conservation pages', 'news' => 'News', 'reviews' => 'Scheme reviews', 'reports' => 'Annual reports', 'treports' => 'Treasure annual reports', 'romancoins' => 'Roman coin guide', 'ironagecoins' => 'Iron Age coin guide', 'earlymedievalcoins' => 'Early Medieval coin guide', 'medievalcoins' => 'Medieval coin guide', 'postmedievalcoins' => 'Post Medieval coin guide', 'research' => 'Research', 'api' => 'Applications Programming Interface', 'databasehelp' => 'Database help', 'events' => 'Events', 'treasure' => 'Treasure', 'help' => 'Help section', 'publications' => 'Publications', 'database' => 'Database front page', 'oai' => 'OAI instructions', 'bronzeage' => 'Bronze Age guide'))->setDecorators($decorators)->setRequired(true)->addErrorMessage('You must choose a section for this to be filed under');
     $parentcontent = new Zend_Form_Element_Select('parent');
     $parentcontent->setLabel('Does this have a parent?: ')->setDecorators($decorators)->setRequired(false);
     $metaKeywords = new Zend_Form_Element_Textarea('metaKeywords');
     $metaKeywords->setLabel('Meta keywords: ')->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
     $metaDescription = new Zend_Form_Element_Textarea('metaDescription');
     $metaDescription->setLabel('Meta description: ')->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
     $publishState = new Zend_Form_Element_Select('publishState');
     $publishState->setLabel('Publishing status: ')->addMultiOptions(array('Please choose publish state' => array('1' => 'Draft', '2' => 'Admin to review', '3' => 'Published')))->setValue(1)->setDecorators($decorators)->setRequired(true);
     $slug = new Zend_Form_Element_Text('slug');
     $slug->setLabel('Page slug: ')->setAttrib('size', 50)->setDecorators($decorators)->addFilter('UrlSlug')->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
     $frontPage = new Zend_Form_Element_Checkbox('frontPage');
     $frontPage->setLabel('Appear on section\'s front page?: ')->setDecorators($decorators)->addValidator('NotEmpty', 'Integer')->setRequired(true);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large');
     $submit->removeDecorator('DtDdWrapper');
     $submit->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($title, $author, $body, $section, $publishState, $excerpt, $metaKeywords, $metaDescription, $slug, $frontPage, $submit, $menuTitle));
     $this->addDisplayGroup(array('title', 'menuTitle', 'author', 'body', 'section', 'publishState', 'excerpt', 'metaKeywords', 'metaDescription', 'slug', 'frontPage'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit')->removeDecorator('HtmlTag');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
     $this->details->setLegend('Add new site content');
 }
Пример #4
0
 public function init()
 {
     $this->setName('Form User Edit');
     $this->setAttrib('class', 'Form_Edit');
     $this->setMethod('post')->setAction('/user/save');
     $id = new Zend_Form_Element_Hidden('id');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name:')->setRequired(true)->addValidator('alnum')->addValidator('regex', false, array('/^[a-z]+/'))->addValidator('stringLength', false, array(4, 12))->addFilter('StringToLower');
     $pwd = new Zend_Form_Element_Password('pwd');
     $pwd->setLabel('Password:'******'re_pwd');
     $re_pwd->setLabel('Re-password:'******'role');
     $role->setLabel('Role:')->addMultiOptions(array(array('key' => 'guest', 'value' => 'Guest'), array('key' => 'memeber', 'value' => 'Member'), array('key' => 'admin', 'value' => 'Admin')))->setDescription('Choose one role');
     $truename = new Zend_Form_Element_Text('true_name');
     $truename->setLabel('Real Name:');
     $phone = new Zend_Form_Element_Text('cellphone');
     $phone->setLabel('Cell Phone:')->addValidator(new SP_Validate_CellPhone());
     $btnSubmit = new Zend_Form_Element_Submit('submit');
     $btnSubmit->setLabel('Submit');
     $this->addElements(array($id, $name, $pwd, $re_pwd, $role, $truename, $phone, $btnSubmit));
     parent::init();
     $this->addDecorator('OuterBox', array('attrs' => array('class' => 'form user_edit_form'), 'title' => 'Edit/Create User', 'placement' => 'PREPEND'));
     $id->removeDecorator('Label');
     $btnSubmit->removeDecorator('Label');
 }
Пример #5
0
 /**
  * Creates the form to log in.
  * @see Zend_Form::init()
  */
 public function init()
 {
     $this->setMethod('post');
     $this->setAction("/auth/login/");
     $usernameElement = new Zend_Form_Element_Text('username');
     $usernameElement->setLabel("Benutzername");
     $usernameElement->addValidator('regex', false, array('/^[a-z0-9]/i'));
     $usernameElement->addValidator('stringLength', false, array(2, 64));
     $usernameElement->setAttrib('maxLength', 64);
     $usernameElement->setRequired(true);
     $passwordElement = new Zend_Form_Element_Password('password');
     $passwordElement->setLabel("Passwort");
     $passwordElement->addValidator('regex', false, array('/^[a-z0-9]/i'));
     $passwordElement->addValidator('stringLength', false, array(8, 32));
     $passwordElement->setAttrib('maxLength', 32);
     $passwordElement->setRequired(true);
     $submitElement = new Zend_Form_Element_Submit('submit');
     $submitElement->setLabel('Anmelden');
     $submitElement->setIgnore(true);
     $submitElement->setAttrib('class', 'submit');
     $submitElement->removeDecorator('DtDdWrapper');
     $this->addElements(array($usernameElement, $passwordElement));
     $this->addDisplayGroup(array('username', 'password'), 'credentialGroup', array('legend' => 'Zugangsdaten'));
     $this->addElements(array($submitElement));
 }
Пример #6
0
 public function init()
 {
     $bookingid = new Zend_Form_Element_Hidden("booking_id");
     $priceModel = new Admin_Model_Price();
     $fromOption = $priceModel->getAllLocation();
     $toOption = $priceModel->getAllLocation(true);
     $numberOption = array();
     for ($i = 1; $i <= 20; $i++) {
         $numberOption[$i] = $i;
     }
     $timeOption = array();
     for ($j = 0; $j <= 23; $j++) {
         $timeOption[$j] = strlen($j) == 1 ? "0" . $j . ":00" : $j . ":00";
     }
     $pickupLocation = new Zend_Form_Element_Select("pickup_location");
     $pickupLocation->setLabel("Pickup Location")->setAttribs(array('class' => 'form-select', 'id' => 'pickup-location'))->addmultiOptions($fromOption)->setRequired(true);
     $returnLocation = new Zend_Form_Element_Select('return_location');
     $returnLocation->setLabel('Return Location')->setAttribs(array('class' => 'form-select', 'id' => 'return-location'))->addmultiOptions($toOption)->setRequired(true);
     $number = new Zend_Form_Element_Select("number");
     $number->setLabel("Number Of Vehicals")->setAttribs(array('class' => 'form-select'))->addmultiOptions($numberOption)->setRequired(true);
     $pickupDate = new Zend_Form_Element_Text("pickup_date");
     $pickupDate->setLabel("Pickup Date")->setAttribs(array('class' => 'form-text'))->setRequired(true);
     $returnDate = new Zend_Form_Element_Text("return_date");
     $returnDate->setLabel("Return Date")->setAttribs(array('class' => 'form-text'))->setRequired(true);
     $pickuptime = new Zend_Form_Element_Select("pickup_time");
     $pickuptime->setLabel("Pickup Time")->setAttribs(array('class' => 'form-number-select'))->addmultiOptions($timeOption)->setRequired(true);
     $returnTime = new Zend_Form_Element_Select("return_time");
     $returnTime->setLabel("Return Time")->setAttribs(array('class' => 'form-number-select'))->addmultiOptions($timeOption)->setRequired(true);
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setLabel("Book Now");
     $this->addElements(array($bookingid, $pickupLocation, $returnLocation, $number, $pickupDate, $pickuptime, $returnDate, $returnTime, $submit));
     $this->setElementDecorators(array('viewHelper', 'Errors'));
     $submit->setDecorators(array('viewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'submit-wrapper')), array('Label', array('tag' => 'div'))));
     $submit->removeDecorator("label");
 }
Пример #7
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $id = new Zend_Form_Element_Hidden('id');
     $hierarchyLevel = new Zend_Form_Element_Hidden('hierarchyLevel');
     $officeType = new Zend_Form_Element_Text('officeType');
     $officeType->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(4, 50))));
     // $officeType->addValidator($db_lookup_validator);
     $officeType->setAttrib('class', 'txt_put');
     $officeType->setAttrib('id', 'officeType');
     $officeCode = new Zend_Form_Element_Text('officeCode');
     //add validation
     $officeCode->setRequired(true)->addValidators(array(array('NotEmpty'), array('stringLength', false, array(2, 2))));
     $officeCode->setAttrib('class', 'txt_put');
     $officeCode->setAttrib('id', 'officeCode')->setAttrib('size', '2');
     $this->addElements(array($id, $officeType, $officeCode, $hierarchyLevel));
     $submit = new Zend_Form_Element_Submit('Edit');
     $submit->setAttrib('class', 'officebutton');
     $submit->setLabel('edit');
     $submit->removeDecorator('DtDdWrapper');
     $next = new Zend_Form_Element_Submit('Next');
     $next->setAttrib('class', 'officesubmit');
     $next->setLabel('Next');
     //add form element to form
     $this->addElements(array($submit, $next));
 }
Пример #8
0
 private function _setupElements()
 {
     $translate = Zend_Registry::get('Zend_Translate');
     $this->setAttrib('id', 'signupForm');
     $this->setTranslator($translate);
     $email = new Zend_Form_Element_Text('email');
     $email->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->addValidator('NotEmpty')->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'email')->addValidator('EmailAddress');
     $email->addValidator(new Ziown_Form_Validate_EmailAddress(), false);
     $email->getValidator('NotEmpty')->setMessage('Email Address is Required', 'isEmpty');
     $username = new Zend_Form_Element_Text('username');
     $username->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->addValidator('NotEmpty')->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'username');
     $username->addValidator(new Ziown_Form_Validate_UserName());
     $username->getValidator('NotEmpty')->setMessage('User name is Required', 'isEmpty');
     $password = new Zend_Form_Element_Password('password');
     $password->setRequired(true)->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'txt-password')->setErrorMessages(array('Password is required'));
     $identValidator = new Zend_Validate_Identical($_POST['password']);
     $identValidator->setMessages(array('notSame' => 'Password doesn\'t match!', 'missingToken' => 'Password doesn\'t match!'));
     $confirm_password = new Zend_Form_Element_Password('confirm_password');
     $confirm_password->setRequired(true)->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'txt-confirm-password')->addValidator($identValidator);
     $signup = new Zend_Form_Element_Submit('signup');
     $signup->setLabel('Sign Up');
     $signup->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setAttrib('class', 'u-login');
     $this->setDecorators(array(array('ViewScript', array('script' => 'signup.phtml'))));
     $this->addElements(array($username, $password, $confirm_password, $signup, $email));
 }
Пример #9
0
 public function __construct($options = null)
 {
     parent::__construct();
     $this->setName('layout_form');
     $this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator');
     $this->removeDecorator('Errors');
     $this->removeDecorator('HtmlTag');
     $this->removeDecorator('Label');
     //$this->setAction($this->_generateActionUrl());
     $layout_select = new Zend_Form_Element_Select('layout_select');
     $layout_select->setAttrib('onchange', '$("#submitLayoutSelection").click();');
     $layout_select->removeDecorator('Errors');
     $layout_select->removeDecorator('Label');
     $layout_select->removeDecorator('HtmlTag');
     /*foreach($options as $language)
     			$translation_select->addMultiOption($language['iso6391_lng'], $language['name_lng']);
     		*/
     $layout_select->addMultiOption('default', 'Default');
     $layout_select->addMultiOption('custom', 'Custom');
     //$layout_select->setValue($this->_getCurrentLayoutSelect());
     $layout_select->setValue('default');
     $submit = new Zend_Form_Element_Submit('submitLayoutSelection');
     $submit->removeDecorator('DtDdWrapper');
     $submit->setAttrib('style', 'display: none;');
     $this->addElements(array($layout_select, $submit));
 }
Пример #10
0
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setName('FormularioNoticia');
     $ID_NOTICIA = new Zend_Form_Element_Hidden('ID_NOTICIA');
     $ID_NOTICIA->addFilter('Int');
     $ID_NOTICIA->removeDecorator('Label');
     $FK_ARQUIVO = new Zend_Form_Element_Hidden('FK_ARQUIVO');
     $FK_ARQUIVO->addFilter('Int');
     $FK_ARQUIVO->removeDecorator('Label');
     $DS_TITULO = new Zend_Form_Element_Text('DS_TITULO');
     $DS_TITULO->setLabel('TÍTULO')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', "Enter t�tulo");
     $TX_NOTICIA = new Zend_Form_Element_Textarea('TX_NOTICIA');
     $TX_NOTICIA->setLabel('TEXTO')->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('rows', '20');
     $DS_RESUMO = new Zend_Form_Element_Textarea('DS_RESUMO');
     $DS_RESUMO->setLabel('RESUMO')->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('rows', '5');
     $DT_NOTICIA = new Zend_Form_Element_Hidden('DT_NOTICIA');
     $DT_NOTICIA->removeDecorator('Label');
     $tiposNoticia = array("1" => "NOTICIAS", "2" => "NOVIDADES", "3" => "RECADOS");
     $FK_TIPO_NOTICIA = new Zend_Form_Element_Select('FK_TIPO_NOTICIA');
     $FK_TIPO_NOTICIA->setLabel('TIPO NOTÍCIA')->setRequired(true)->addMultiOptions($tiposNoticia)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2')->setAttrib('placeholder', "Enter tipo not�cia");
     $FK_OPERADOR = new Zend_Form_Element_Hidden('FK_OPERADOR');
     $FK_OPERADOR->addFilter('Int');
     $FK_OPERADOR->removeDecorator('Label');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel("Adiconar");
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $this->addElements(array($ID_NOTICIA, $DS_TITULO, $TX_NOTICIA, $FK_ARQUIVO, $DS_RESUMO, $DT_NOTICIA, $FK_TIPO_NOTICIA, $FK_OPERADOR, $submit));
     $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioNoticia.phtml'))));
 }
Пример #11
0
 public function init()
 {
     $holidayname = new Zend_Form_Element_Text('holidayname');
     $holidayname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_holidayupdates', 'holidayname'));
     $holidayname->setAttrib('class', 'txt_put');
     $holidayname->setRequired(true)->addValidators(array(array('NotEmpty')));
     $office_id = new Zend_Form_Element_Select('office_id');
     $office_id->addMultiOption('', 'Select...');
     $office_id->addMultiOption('All', 'All');
     $office_id->setAttrib('class', 'txt_put');
     $office_id->setRequired(true)->addValidators(array(array('NotEmpty')));
     $holidayupdate_id = new Zend_Form_Element_Hidden('holidayupdate_id');
     $holidayfrom = new ZendX_JQuery_Form_Element_DatePicker('holidayfrom');
     $holidayfrom->setAttrib('class', 'txt_put');
     $holidayfrom->setJQueryParam('dateFormat', 'yy-mm-dd');
     $holidayfrom->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $holidayupto = new ZendX_JQuery_Form_Element_DatePicker('holidayupto');
     $holidayupto->setAttrib('class', 'txt_put');
     $holidayupto->setJQueryParam('dateFormat', 'yy-mm-dd');
     $holidayupto->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true, array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date')));
     $repayment_date = new ZendX_JQuery_Form_Element_DatePicker('repayment_date');
     $repayment_date->setAttrib('class', 'txt_put');
     $repayment_date->setJQueryParam('dateFormat', 'yy-mm-dd');
     $repayment_date->setRequired(true)->addValidators(array(array('NotEmpty')));
     array('messages' => array(Zend_Validate_Date::FALSEFORMAT => 'Enter the valid date'));
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->removeDecorator('DtDdWrapper');
     $this->addElements(array($holidayname, $office_id, $holidayfrom, $holidayupto, $repayment_date, $holidayupdate_id, $submit));
 }
Пример #12
0
 /**
  * Creates the form to edit a user profile.
  * @see Zend_Form::init()
  */
 public function init()
 {
     $em = Zend_Registry::getInstance()->entitymanager;
     $defaultNamespace = new Zend_Session_Namespace('Default');
     $this->setMethod('post');
     $usernameElement = new Zend_Form_Element_Text('username');
     $usernameElement->setLabel("Benutzername");
     $usernameElement->addValidator(new Unplagged_Validate_NoRecordExists('Application_Model_Personnel', 'username'));
     $usernameElement->setIgnore(true);
     $emailElement = new Zend_Form_Element_Text('email');
     $emailElement->setLabel("E-Mail");
     $emailElement->addValidator(new Unplagged_Validate_NoRecordExists('Application_Model_Personnel', 'email'));
     $emailElement->setIgnore(true);
     $firstnameElement = new Zend_Form_Element_Text('firstname');
     $firstnameElement->setLabel("Vorname");
     $firstnameElement->addValidator('stringLength', false, array(2, 64));
     $firstnameElement->setAttrib('maxLength', 64);
     $firstnameElement->setRequired(true);
     $lastnameElement = new Zend_Form_Element_Text('lastname');
     $lastnameElement->setLabel("Nachname");
     $lastnameElement->addValidator('stringLength', false, array(2, 64));
     $lastnameElement->setAttrib('maxLength', 64);
     $lastnameElement->setRequired(true);
     $submitElement = new Zend_Form_Element_Submit('submit');
     $submitElement->setLabel('Speichern');
     $submitElement->setIgnore(true);
     $submitElement->setAttrib('class', 'submit');
     $submitElement->removeDecorator('DtDdWrapper');
     $this->addElements(array($emailElement, $usernameElement, $firstnameElement, $lastnameElement));
     $this->addDisplayGroup(array('email', 'username', 'firstname', 'lastname'), 'personalGoup', array('legend' => 'Persönliche Informationen'));
     $this->addElements(array($submitElement));
 }
Пример #13
0
 public function init()
 {
     $languageFile = Zend_Registry::get('languageFile');
     $translate = new Zend_Translate('array', $languageFile, 'zh_CN');
     $this->setTranslator($translate);
     $this->setMethod('POST');
     $this->setName('contactForm');
     $element = new Zend_Form_Element_Text('name');
     $element->setLabel('怎么称呼您');
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('email');
     $element->setLabel('您的Email');
     //$element->setRequired(true);
     $this->addElement($element);
     $element = new Elements();
     $element->addReCaptcha($this);
     $this->addDisplayGroup(array('name', 'email', 'captcha'), 'leftSection');
     $this->getDisplayGroup('leftSection')->removeDecorator('DtDdWrapper');
     $element = new Zend_Form_Element_Textarea('body');
     $element->setLabel('想要开通城市地区和找房贴士,关于您的简单介绍');
     $element->addPrefixPath('My_Validator', 'My/Validator/', 'validate');
     $element->addValidator('FormValueNotNull', true);
     //$element->setRequired(true);
     $element->setAttrib('rows', 13);
     $this->addElement($element);
     $this->addDisplayGroup(array('body'), 'rightSection');
     $this->getDisplayGroup('rightSection')->removeDecorator('DtDdWrapper');
     $element = new Zend_Form_Element_Submit('post');
     $element->removeDecorator('Label');
     $this->addElement($element);
 }
Пример #14
0
 /**
  * (non-PHPdoc)
  * @see Zend_Form#init()
  */
 public function init()
 {
     $table = new Tri_Db_Table('activity_text');
     $validators = $table->getValidators();
     $filters = $table->getFilters();
     $translate = Zend_Registry::get('Zend_Translate');
     $this->setAction('activity/text/save')->setMethod('post');
     $activityId = new Zend_Form_Element_Hidden('activity_id');
     $activityId->addValidators($validators['activity_id'])->addFilters($filters['activity_id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $userId = new Zend_Form_Element_Hidden('user_id');
     $userId->addValidators($validators['user_id'])->addFilters($filters['user_id'])->removeDecorator('Label')->removeDecorator('HtmlTag');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description')->addValidators($validators['description'])->addFilters($filters['description'])->setAttrib('rows', 20)->setAttrib('cols', '70%')->setAttrib('id', 'text-description-text')->setAllowEmpty(false);
     $status = new Zend_Form_Element_Hidden('status');
     $status->removeDecorator('Label')->removeDecorator('HtmlTag');
     $this->addElement($userId)->addElement($activityId)->addElement($status)->addElement($description);
     if (Zend_Auth::getInstance()->getIdentity()->role == 'student') {
         $saveDraft = new Zend_Form_Element_Submit('saveDraft');
         $sendCorrection = new Zend_Form_Element_Submit('sendCorrection');
         $saveDraft->removeDecorator('Label')->removeDecorator('DtDdWrapper');
         $sendCorrection->removeDecorator('Label')->removeDecorator('DtDdWrapper');
         $this->addElement($saveDraft)->addElement($sendCorrection);
     } else {
         $openButton = new Zend_Form_Element_Submit('openButton');
         $finalize = new Zend_Form_Element_Submit('finalize');
         $openButton->removeDecorator('Label')->removeDecorator('DtDdWrapper');
         $finalize->removeDecorator('Label')->removeDecorator('DtDdWrapper');
         $note = new Zend_Form_Element_Text('note');
         $note->setLabel('Note')->addValidator('Int')->addFilter('Digits');
         $this->addElement($note)->addElement($openButton)->addElement($finalize);
     }
 }
Пример #15
0
 public function __construct($options = null)
 {
     $authors = new Users();
     $authorOptions = $authors->getAuthors();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setName('help');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Content Title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 60)->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $menuTitle = new Zend_Form_Element_Text('menuTitle');
     $menuTitle->setLabel('Menu Title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 60)->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $author = new Zend_Form_Element_Select('author');
     $author->setLabel('Set the author of the article: ')->addMultiOptions(array('Choose an author' => $authorOptions))->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must choose an author')->setDecorators($decorators);
     $excerpt = new Zend_Form_Element_Textarea('excerpt');
     $excerpt->setLabel('Optional excerpt: ')->setRequired(false)->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StringTrim', 'StripTags'));
     $body = new Pas_Form_Element_RTE('body');
     $body->setLabel('Main body of text: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $section = new Zend_Form_Element_Select('section');
     $section->setLabel('Set site section to appear under: ')->addMultiOptions(array('databasehelp' => 'Database help', 'help' => 'Site help'))->setDecorators($decorators)->setRequired(true)->addErrorMessage('You must choose a section for this to be filed under');
     $parentcontent = new Zend_Form_Element_Select('parent');
     $parentcontent->setLabel('Does this have a parent?: ')->setDecorators($decorators)->setRequired(false)->addFilters(array('StringTrim', 'StripTags'));
     $metaKeywords = new Zend_Form_Element_Textarea('metaKeywords');
     $metaKeywords->setLabel('Meta keywords: ')->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StringTrim', 'StripTags'))->setRequired(true);
     $metaDescription = new Zend_Form_Element_Textarea('metaDescription');
     $metaDescription->setLabel('Meta description: ')->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StringTrim', 'StripTags'))->setRequired(true);
     $publishState = new Zend_Form_Element_Select('publishState');
     $publishState->setLabel('Publishing status: ')->addMultiOptions(array('Please choose publish state' => array('1' => 'Draft', '2' => 'Admin to review', '3' => 'Published')))->setValue(1)->setDecorators($decorators)->setRequired(true)->addFilters(array('StringTrim', 'StripTags'));
     $slug = new Zend_Form_Element_Text('slug');
     $slug->setLabel('Page slug: ')->setAttrib('size', 50)->setDecorators($decorators)->addFilters(array('StringTrim', 'StripTags', 'UlSlug'))->setRequired(true);
     $frontPage = new Zend_Form_Element_Checkbox('frontPage');
     $frontPage->setLabel('Appear on section\'s front page?: ')->setDecorators($decorators)->setRequired(true)->addFilters(array('StringTrim', 'StripTags'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large');
     $submit->removeDecorator('DtDdWrapper');
     $submit->removeDecorator('HtmlTag');
     $this->addElements(array($title, $author, $body, $section, $publishState, $excerpt, $metaKeywords, $metaDescription, $slug, $frontPage, $submit, $menuTitle));
     $this->addDisplayGroup(array('title', 'menuTitle', 'author', 'body', 'section', 'publishState', 'excerpt', 'metaKeywords', 'metaDescription', 'slug', 'frontPage'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit')->removeDecorator('HtmlTag');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
     $this->details->setLegend('Add new site content');
 }
Пример #16
0
 /**
  * Creates the form to create a new case.
  * @see Zend_Form::init()
  */
 public function init()
 {
     $em = Zend_Registry::getInstance()->entitymanager;
     $this->setMethod('post');
     $sexElement = new Zend_Form_Element_Select('sex');
     $sexElement->setLabel("Geschlecht");
     $sexElement->addMultiOption("", "Bitte wählen");
     $sexElement->addMultiOption("male", "männlich");
     $sexElement->addMultiOption("female", "weiblich");
     $sexElement->setRequired(true);
     $firstnameElement = new Zend_Form_Element_Text('firstname');
     $firstnameElement->setLabel("Vorname");
     $firstnameElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
     $firstnameElement->addValidator('stringLength', false, array(2, 64));
     $firstnameElement->setRequired(true);
     $lastnameElement = new Zend_Form_Element_Text('lastname');
     $lastnameElement->setLabel("Nachname");
     $lastnameElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
     $lastnameElement->addValidator('stringLength', false, array(2, 64));
     $lastnameElement->setRequired(true);
     $birthdayElement = new Zend_Form_Element_Text('birthday');
     $birthdayElement->setLabel("Geburtstag");
     $birthdayElement->addValidator(new Zend_Validate_Date());
     $sizeElement = new Zend_Form_Element_Text('size');
     $sizeElement->setLabel("Körpergröße in cm");
     $sizeElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
     $sizeElement->addValidator('stringLength', false, array(2, 64));
     $weightElement = new Zend_Form_Element_Text('weight');
     $weightElement->setLabel("Gewicht in kg");
     $weightElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
     $weightElement->addValidator('stringLength', false, array(2, 64));
     $bloodGroupElement = new Zend_Form_Element_Text('bloodGroup');
     $bloodGroupElement->setLabel("Blutgruppe");
     $bloodGroupElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
     $bloodGroupElement->addValidator('stringLength', false, array(2, 64));
     $streetElement = new Zend_Form_Element_Text('street');
     $streetElement->setLabel("Straße");
     $streetElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
     $streetElement->addValidator('stringLength', false, array(2, 64));
     $zipcodeElement = new Zend_Form_Element_Text('zipcode');
     $zipcodeElement->setLabel("Postleitzahl");
     $zipcodeElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
     $zipcodeElement->addValidator('stringLength', false, array(2, 64));
     $cityElement = new Zend_Form_Element_Text('city');
     $cityElement->setLabel("Stadt");
     $cityElement->addValidator('regex', false, array('/^[a-z0-9ßöäüâáàéèñ]/i'));
     $cityElement->addValidator('stringLength', false, array(2, 64));
     $submitElement = new Zend_Form_Element_Submit('submit');
     $submitElement->setLabel('Speichern');
     $submitElement->setIgnore(true);
     $submitElement->setAttrib('class', 'submit');
     $submitElement->removeDecorator('DtDdWrapper');
     $this->addElements(array($firstnameElement, $lastnameElement, $sizeElement, $weightElement, $bloodGroupElement, $streetElement, $zipcodeElement, $cityElement, $sexElement, $birthdayElement));
     $this->addDisplayGroup(array('sex', 'firstname', 'lastname', 'birthday'), 'informationGroup', array('legend' => 'Allgemeine Informationen'));
     $this->addDisplayGroup(array('size', 'weight', 'bloodGroup'), 'vitalGroup', array('legend' => 'Vital Informationen'));
     $this->addDisplayGroup(array('street', 'zipcode', 'city'), 'addressGroup', array('legend' => 'Adresse'));
     $this->addElements(array($submitElement));
 }
Пример #17
0
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setName('nome');
     $this->setAttrib('enctype', 'multipart/form-data');
     $ID_OPERADOR = new Zend_Form_Element_Hidden('ID_OPERADOR');
     $ID_OPERADOR->addFilter('Int');
     $NM_OPERADOR = new Zend_Form_Element_Text('NM_OPERADOR');
     $NM_OPERADOR->setLabel('NOME')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter nome');
     $DS_TELEFONE_PESSOAL = new Zend_Form_Element_Text('DS_TELEFONE_PESSOAL');
     $DS_TELEFONE_PESSOAL->setLabel('TELEFONE PESSOAL')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter telefone pessoal');
     $DS_TELEFONE_BIOS = new Zend_Form_Element_Text('DS_TELEFONE_BIOS');
     $DS_TELEFONE_BIOS->setLabel('TELEFONE BIOS')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter telefone bios');
     $DS_EMAIL_PESSOAL = new Zend_Form_Element_Text('DS_EMAIL_PESSOAL');
     $DS_EMAIL_PESSOAL->setLabel('E-MAIL PESSOAL')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter e-mail pessoal');
     $DS_EMAIL_BIOS = new Zend_Form_Element_Text('DS_EMAIL_BIOS');
     $DS_EMAIL_BIOS->setLabel('E-MAIL BIOS')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter e-mail bios');
     $DS_ENDERECO = new Zend_Form_Element_Text('DS_ENDERECO');
     $DS_ENDERECO->setLabel('ENDEREÇO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter endereco');
     $DS_BAIRRO = new Zend_Form_Element_Text('DS_BAIRRO');
     $DS_BAIRRO->setLabel('BAIRRO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter bairro');
     $NR_CEP = new Zend_Form_Element_Text('NR_CEP');
     $NR_CEP->setLabel('CEP')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter cep');
     $NR_CPF = new Zend_Form_Element_Text('NR_CPF');
     $NR_CPF->setLabel('CPF')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter cpf');
     $NR_IDENTIDADE = new Zend_Form_Element_Text('NR_IDENTIDADE');
     $NR_IDENTIDADE->setLabel('Nº IDENTIDADE')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter nº identidade');
     $DT_NASCIMENTO = new Zend_Form_Element_Text('DT_NASCIMENTO');
     $DT_NASCIMENTO->setLabel('DATA NASCIMENTO')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter data nascimento');
     $DS_REGISTRO_PROFISSIONAL = new Zend_Form_Element_Text('DS_REGISTRO_PROFISSIONAL');
     $DS_REGISTRO_PROFISSIONAL->setLabel('REGISTRO PROFISSIONAL')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter data registro profissional');
     $DS_CTF_IBAM = new Zend_Form_Element_Text('DS_CTF_IBAM');
     $DS_CTF_IBAM->setLabel('CTF IBAMA')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter ctf ibama');
     $DS_SKYPE = new Zend_Form_Element_Text('DS_SKYPE');
     $DS_SKYPE->setLabel('SKYPE')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter skype');
     $DS_LOGIN = new Zend_Form_Element_Text('DS_LOGIN');
     $DS_LOGIN->setLabel('LOGIN')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter skype');
     $DS_SENHA = new Zend_Form_Element_Password('DS_SENHA');
     $DS_SENHA->setLabel('SENHA')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter senha');
     $REPETIR_SENHA = new Zend_Form_Element_Password('REPETIR_SENHA');
     $REPETIR_SENHA->setLabel('REPETIR SENHA')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter repetir senha');
     $NM_CONTATO_FAMILIAR = new Zend_Form_Element_Text('NM_CONTATO_FAMILIAR');
     $NM_CONTATO_FAMILIAR->setLabel('NOME CONTATO FAMILIAR')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter nome contato familiar');
     $NR_TELEFONE_CONTATO_FAMILIAR = new Zend_Form_Element_Text('NR_TELEFONE_CONTATO_FAMILIAR');
     $NR_TELEFONE_CONTATO_FAMILIAR->setLabel('Nº TELEFONE CONTATO FAMILIAR')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter n� telefone contato familiar');
     $FK_PERFIL = new Zend_Form_Element_Select('FK_PERFIL');
     $perfil = new Application_Model_DbTable_Perfil();
     $FK_PERFIL->setLabel('Perfil');
     $FK_PERFIL->setMultiOptions($perfil->getPerfil())->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control select2');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel("Adiconar");
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $this->addElements(array($ID_OPERADOR, $NM_OPERADOR, $DS_TELEFONE_PESSOAL, $DS_TELEFONE_BIOS, $DS_EMAIL_PESSOAL, $DS_EMAIL_BIOS, $DS_ENDERECO, $DS_BAIRRO, $NR_CEP, $NR_CPF, $NR_IDENTIDADE, $DT_NASCIMENTO, $DS_REGISTRO_PROFISSIONAL, $DS_CTF_IBAM, $DS_SKYPE, $DS_LOGIN, $DS_SENHA, $REPETIR_SENHA, $NM_CONTATO_FAMILIAR, $NR_TELEFONE_CONTATO_FAMILIAR, $FK_PERFIL, $submit));
     // $this->addElements(array($id, $nome, $email,$senha, $submit));
     $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioOperador.phtml'))));
 }
Пример #18
0
 private function _buildElements()
 {
     $yes = new Zend_Form_Element_Submit($this->_name . "_Yes");
     $yes->setLabel("Oui");
     $yes->removeDecorator("dtDdWrapper");
     $no = new Zend_Form_Element_Submit($this->_name . "_No");
     $no->setLabel("Non");
     $no->removeDecorator("dtDdWrapper");
     return array($yes, $no);
 }
Пример #19
0
 public function init()
 {
     $feefor = new Zend_Form_Element_Select('feefor');
     $feefor->addMultiOption('', 'Select...');
     $feefor->addMultiOption('All', 'All');
     $feefor->setAttrib('class', 'txt_put');
     $feefor->setRequired(true)->addValidators(array(array('NotEmpty')));
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->removeDecorator('DtDdWrapper');
     $this->addElements(array($feefor, $submit));
 }
Пример #20
0
 public function init()
 {
     $languages = new Zend_Form_Element_Select('languages');
     $languages->addMultiOption('', 'Select...');
     $languages->setAttrib('class', 'txt_put');
     $languages->setRequired(true)->addValidators(array(array('NotEmpty')));
     $languages->setAttrib('onchange', 'getmember(this.value,"' . $app . '")');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->removeDecorator('DtDdWrapper');
     $this->addElements(array($languages, $submit));
 }
Пример #21
0
 public function init()
 {
     $Ankieta = new Application_Model_DbTable_AnkietyPytania();
     $select = $Ankieta->select(array('id', 'pytanie', 'czy_obrazek'))->where('czy_wyswietlac = ?', 't')->where('sekcja = ?', 'lewa')->where('rodzaj = ?', 'normal')->order('kolejnosc DESC')->order('data_dodania DESC')->order('pytanie ASC')->limit(1);
     //echo $select->__toString();
     $ankieda = $Ankieta->fetchAll($select);
     foreach ($ankieda as $pytanie) {
         $pytania_id[] = $pytanie->id;
         $pytania[] = $pytanie->pytanie;
         $odpowiedziFetch = $pytanie->findApplication_Model_DbTable_AnkietyOdpowiedzi();
         // sortowanie
         $odpowiedziArray = $odpowiedziFetch->toArray();
         usort($odpowiedziArray, create_function('$a, $b', 'if ($a["kolejnosc"] == $b["kolejnosc"]) return 0; return ($a["kolejnosc"] < $b["kolejnosc"]) ? -1 : 1;'));
         // usort($odpowiedziArray, sort_answers($a, $b){
         // return strcmp($a["kolejnosc"], $b["kolejnosc"]);
         // });// sort
         foreach ($odpowiedziArray as $odpowiedz) {
             $odpowiedzi_id[] = $odpowiedz['id'];
             $odpowiedzi[] = $odpowiedz['odpowiedz'];
         }
     }
     $this->addElement('hidden', 'plaintext', array('description' => '<dt id="odpowiedzi-label"><h3 class="tytul">' . $pytania[0] . '</h3></dt>', 'decorators' => array(array('Description', array('escape' => false, 'tag' => '')))));
     $kontrolkaRadio = new Zend_Form_Element_Radio("odpowiedzi[]", array('multiOptions' => array_combine($odpowiedzi_id, $odpowiedzi), 'registerInArrayValidator' => false, 'validators' => array('NotEmpty' => array('validator' => 'NotEmpty', 'options' => array('messages' => 'Musisz wybrać jedną odpowiedź.')))));
     $kontrolkaRadio->setRequired(true);
     $kontrolkaRadio->removeDecorator('Label');
     $kontrolkaRadio->setSeparator(false);
     $this->addElement($kontrolkaRadio);
     if ($ankieda[0]->czy_obrazek == 't') {
         //first create an image type captcha
         $captchaimg = new Zend_Captcha_Image('captchaimg');
         $captchaimg->setFont(APPLICATION_PATH . '/../public/images/tresci/captcha/Tahoma.ttf');
         $captchaimg->setImgDir(APPLICATION_PATH . '/../public/images/tresci/captcha');
         $captchaimg->setImgUrl('/images/tresci/captcha');
         $captchaimg->setWordlen('5');
         $captchaimg->setMessages(array('badCaptcha' => 'Wpisany kod jest nieprawidłowy'));
         //            $captchaimg->generate();
         //create user input for captcha and include the captchaimg in form
         $adcaptcha = new Zend_Form_Element_Captcha('adcaptcha', array('captcha' => $captchaimg));
         $adcaptcha->setLabel('Wpisz kod z obrazka:');
         $adcaptcha->setRequired(true);
         $this->addElement($adcaptcha);
     }
     $kontrolkaSubmit = new Zend_Form_Element_Submit("submit", "Głosuj");
     //        $kontrolkaSubmit->removeDecorator('DtDdWrapper');
     //        $kontrolkaSubmit->setAttribs(array('style' => 'margin-left:130px;'));
     $kontrolkaSubmit->removeDecorator('Label');
     $this->addElement($kontrolkaSubmit);
     $this->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'sonda-content')), array('Form', array('class' => 'sonda-form'))));
     //echo $pytania_id[0];
     $this->setMethod('post');
     //$url = $view->url(array('controller' => 'sonda', 'action' => 'edit', 'id' => $pytania_id[0]), 'default');
     $url = $this->getView()->url(array('controller' => 'sonda', 'action' => 'edit', 'id' => $pytania_id[0]), 'default');
     $this->setAction($url);
 }
 public function init()
 {
     $this->setMethod('post');
     $elements = array();
     //render our form elements and the "form" tag
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setElementDecorators(array('ViewHelper', 'Label'));
     //Add id hidden field
     $input = new Zend_Form_Element_Hidden('id');
     $input->addValidators(array(new Zend_Validate_Digits(), new Zend_Validate_NotEmpty()));
     $input->removeDecorator('HtmlTag');
     $input->removeDecorator('Label');
     $elements[] = $input;
     //Add submit button
     $input = new Zend_Form_Element_Submit('submit');
     $input->removeDecorator('HtmlTag');
     $input->removeDecorator('Label');
     $input->removeDecorator('DtDdWrapper');
     $elements[] = $input;
     $this->addElements($elements);
 }
Пример #23
0
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Submit(self::ELEMENT_SAVE);
     $element->setValue('save');
     $element->removeDecorator('DtDdWrapper');
     $this->addElement($element);
     $element = new Zend_Form_Element_Submit(self::ELEMENT_CANCEL);
     $element->setValue('cancel');
     $element->removeDecorator('DtDdWrapper');
     $this->addElement($element);
 }
Пример #24
0
 public function __construct($options = null)
 {
     $decorator = new My_Decorator_SimpleInput();
     parent::__construct($options);
     $this->setDecorators(array('FormElements', 'Fieldset', 'Form'));
     $this->setName('datepicker');
     $datefrom = new Zend_Form_Element_Text('datefrom');
     $datefrom->setLabel('Date from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date');
     $datefrom->addDecorators(array($decorator));
     $dateto = new Zend_Form_Element_Text('dateto');
     $dateto->setLabel('Date to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date');
     $dateto->addDecorators(array($decorator));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setAttrib('class', 'datepick');
     $submit->removeDecorator('DtDdWrapper');
     $submit->removeDecorator('Label');
     $this->addElements(array($datefrom, $dateto, $submit));
     $this->setLegend('Choose your own dates: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Пример #25
0
 private function _setupElements()
 {
     $translate = Zend_Registry::get('Zend_Translate');
     $this->setAttrib('id', 'themeForm');
     $this->setTranslator($translate);
     $name = new Zend_Form_Element_Text('name');
     $name->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setErrorMessages(array('Username is required'));
     $cssProperty = new Zend_Form_Element_Hidden('cssProperty');
     $cssProperty->setRequired(true)->removeDecorator('HtmlTag')->removeDecorator('DtDWrapper')->removeDecorator('label')->setAttrib('id', 'css-property');
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setLabel('Save Theme');
     $submit->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setAttrib('class', 'u-login');
     $this->addElements(array($name, $cssProperty, $submit));
 }
Пример #26
0
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setName('FormularioContato');
     $ID_CONTATO = new Zend_Form_Element_Hidden('ID_CONTATO');
     $ID_CONTATO->addFilter('Int');
     $ID_CONTATO->removeDecorator('Label');
     $nm_contato = new Zend_Form_Element_Text('NM_CONTATO');
     $nm_contato->setLabel('NOME')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter nome');
     $nm_cargo = new Zend_Form_Element_Text('NM_CARGO');
     $nm_cargo->setLabel('CARGO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter cargo');
     $nr_telefone = new Zend_Form_Element_Text('NR_TELEFONE');
     $nr_telefone->setLabel('TELEFONE 1')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter telefone');
     $nr_telefone2 = new Zend_Form_Element_Text('NR_TELEFONE2');
     $nr_telefone2->setLabel('TELEFONE 2')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter telefone');
     $tx_observacao = new Zend_Form_Element_Textarea('TX_OBSERVACAO');
     $tx_observacao->setLabel('OBSERVA��O')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('rows', '5');
     $ds_email = new Zend_Form_Element_Text('DS_EMAIL');
     $ds_email->setLabel('E-MAIL')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter e-mail');
     $nm_logradouro = new Zend_Form_Element_Text('NM_LOGRADOURO');
     $nm_logradouro->setLabel('LOGRADOURO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter logradouro');
     $nr_endereco = new Zend_Form_Element_Text('NR_ENDERECO');
     $nr_endereco->setLabel('NÚMERO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter número');
     $ds_complemento = new Zend_Form_Element_Text('DS_COMPLEMENTO');
     $ds_complemento->setLabel('COMPLEMENTO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter complemento');
     $nm_bairro = new Zend_Form_Element_Text('NM_BAIRRO');
     $nm_bairro->setLabel('BAIRRO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter bairro');
     $nm_bairro = new Zend_Form_Element_Text('NM_BAIRRO');
     $nm_bairro->setLabel('BAIRRO')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter bairro');
     $estados = array("AC" => "Acre", "AL" => "Alagoas", "AM" => "Amazonas", "AP" => "Amapá", "BA" => "Bahia", "CE" => "Ceará", "DF" => "Distrito Federal", "ES" => "Espírito Santo", "GO" => "Goiás", "MA" => "Maranhão", "MT" => "Mato Grosso", "MS" => "Mato Grosso do Sul", "MG" => "Minas Gerais", "PA" => "Pará", "PB" => "Paraíba", "PR" => "Paraná", "PE" => "Pernambuco", "PI" => "Piauí", "RJ" => "Rio de Janeiro", "RN" => "Rio Grande do Norte", "RO" => "Rondônia", "RS" => "Rio Grande do Sul", "RR" => "Roraima", "SC" => "Santa Catarina", "SE" => "Sergipe", "SP" => "São Paulo", "TO" => "Tocantins");
     $nm_uf = new Zend_Form_Element_Select('NM_UF');
     $nm_uf->setLabel('UF')->addMultiOptions($estados)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control');
     $nr_cep = new Zend_Form_Element_Text('NR_CEP');
     $nr_cep->setLabel('CEP')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter cep');
     $fl_agenda = new Zend_Form_Element_Select('FL_AGENDA');
     $fl_agenda->setLabel('AGENDA')->addMultiOptions(array('0' => 'NAO', '1' => 'SIM'))->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter cep');
     //fk_CLIENTE
     $fk_cliente = new Zend_Form_Element_Select('FK_CLIENTE');
     $fk_cliente->setAttrib('class', 'form-control select2');
     $cliente = new Application_Model_DbTable_Cliente();
     $fk_cliente->setLabel('CLIENTE')->setRequired(true)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $listaClientes = $cliente->getClienteCombo();
     $fk_cliente->setMultiOptions($listaClientes);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel("Adiconar");
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $this->addElements(array($ID_CONTATO, $nm_contato, $nm_cargo, $nr_telefone, $nr_telefone2, $tx_observacao, $ds_email, $nm_logradouro, $nr_endereco, $ds_complemento, $nm_bairro, $nm_uf, $fk_cliente, $nr_cep, $fl_agenda, $submit));
     $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioContato.phtml'))));
 }
Пример #27
0
 public function init()
 {
     $fundingupdates_id = new Zend_Form_Element_Hidden('fundingupdates_id');
     $funding_id = new Zend_Form_Element_Hidden('funding_id');
     $funder_id = new Zend_Form_Element_Select('funder_id');
     $funder_id->addMultiOption('', 'Select...');
     $funder_id->setAttrib('class', 'txt_put');
     $funder_id->setRequired(true)->addValidators(array(array('NotEmpty')));
     //  $funder_id = new Zend_Form_Element_Text('funder_id');
     //         $funder_id->addValidators(array(array('NotEmpty')));
     //         $funder_id->setAttrib('class', 'txt_put');
     //         $funder_id->setRequired(true)
     // 		->addValidators(array(array('NotEmpty')));
     //
     $institutionName = new Zend_Form_Element_Select('institutionname');
     $institutionName->setAttrib('class', 'txt_put');
     $institutionName->setAttrib('id', 'institutionname');
     $institutionName->setLabel('institutionname')->setRequired(true);
     $institutionName->addMultiOption('', 'Select...');
     $fundingname = new Zend_Form_Element_Text('fundingname');
     $fundingname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_fundingdetails', 'fundingname'));
     $fundingname->setAttrib('class', 'txt_put');
     $fundingname->setRequired(true)->addValidators(array('NotEmpty', 'alpha'));
     $interest = new Zend_Form_Element_Text('interest');
     $interest->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_fundingdetails', 'fundingname'));
     $interest->setAttrib('class', 'txt_put');
     $interest->setRequired(true)->addValidators(array(array('NotEmpty')));
     $funding_currency_id = new Zend_Form_Element_Select('funding_currency_id');
     $funding_currency_id->addMultiOption('', 'Select...');
     $funding_currency_id->setAttrib('class', 'txt_put');
     $funding_currency_id->setRequired(true)->addValidators(array(array('NotEmpty')));
     $fundingamount = new Zend_Form_Element_Text('fundingamount');
     $fundingamount->setAttrib('class', 'txt_put');
     $fundingamount->setRequired(true)->addValidators(array('Float'));
     $exchangerate = new Zend_Form_Element_Text('exchangerate');
     $exchangerate->setAttrib('class', 'txt_put');
     $exchangerate->setRequired(true)->addValidators(array(array('Float')));
     $fund_beginingdate = new ZendX_JQuery_Form_Element_DatePicker('fund_beginingdate');
     $fund_beginingdate->setAttrib('class', 'txt_put');
     $fund_beginingdate->setJQueryParam('dateFormat', 'yy-mm-dd');
     $fund_beginingdate->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true);
     $fund_closingdate = new ZendX_JQuery_Form_Element_DatePicker('fund_closingdate');
     $fund_closingdate->setAttrib('class', 'txt_put');
     $fund_closingdate->setJQueryParam('dateFormat', 'yy-mm-dd');
     $fund_closingdate->setRequired(true)->addValidator(new Zend_Validate_Date('YYYY-MM-DD'), true);
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->removeDecorator('DtDdWrapper');
     $this->addElements(array($fundingupdates_id, $fundingupdates_id, $funder_id, $funding_id, $fundingname, $funding_currency_id, $fundingamount, $exchangerate, $fund_beginingdate, $fund_closingdate, $institutionName, $interest, $submit));
 }
Пример #28
0
 public function init()
 {
     $this->setAction($this->getView()->url())->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED);
     $login = new Zend_Form_Element_Text("usuario");
     $login->setLabel("Email:")->addFilter(new Zend_Filter_StringTrim())->addFilter(new Zend_Filter_StringToLower())->addValidator(new Zend_Validate_EmailAddress())->setAttribs(array("class" => "tx"))->setRequired(true);
     $senha = new Zend_Form_Element_Password("senha");
     $senha->setLabel("Senha:")->addDecorator("HtmlTag", array("tag" => "dd"))->setAttribs(array("class" => "tx"))->setRequired(true);
     $submit = new Zend_Form_Element_Submit("enviar");
     $submit->removeDecorator("DtDdWrapper")->addDecorator("HtmlTag", array("tag" => "dd"))->setAttribs(array("class" => "bt"))->setIgnore(true);
     $elements = array($login, $senha, $submit);
     foreach ($elements as $element) {
         $element->removeDecorator("Label")->removeDecorator("DtDdWrapper")->addDecorator("HtmlTag", array("tag" => "div"));
     }
     $this->addElements($elements);
 }
Пример #29
0
 public function __construct($options = null, $formData)
 {
     parent::__construct($options);
     $translate = Zend_Registry::get('Zend_Translate');
     $this->setDisableLoadDefaultDecorators(true);
     $this->addDecorator('FormElements')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'userlist_filter'))->addDecorator('Form');
     $this->setName('user_list_search');
     $this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator');
     // Username search input
     $username = new Zend_Form_Element_Text('username');
     $username->setLabel($translate->_('userlist-filter-username'))->addFilter('StringtoLower')->setDecorators(array('UserListFilterElementDecorator'))->setValue(isset($formData['username']) ? $formData['username'] : '');
     /*
             // User content amount select
     		$contentSelect = new Zend_Form_Element_Select('counttype');
     		$contentSelect->setLabel($translate->_('userlist-filter-action-label'))
     				      ->addFilter('StringToLower')
     				      ->setDecorators(array('UserListFilterSelectDecorator'))
     				      ->setMultiOptions(array($translate->_('userlist-filter-more-than'), 
                                                   $translate->_('userlist-filter-less-than'), 
                                                   $translate->_('userlist-filter-equal')))
                           ->setValue(isset($formData['counttype']) ? $formData['counttype'] : '');
             
             // User content amount search input 
     		$contentAmount = new Zend_Form_Element_Text('contentlimit');
     		$contentAmount->setLabel($translate->_('userlist-filter-content-count-label'))
                           ->addFilter('StringtoLower')
                           ->setDecorators(array('UserListFilterContentDecorator'))
                           ->setValue(isset($formData['contentlimit']) ? $formData['contentlimit'] : '');
              
             
             // User country select
     		$countrySelect = new Zend_Form_Element_Select('country');
     		$countrySelect->setLabel($translate->_('userlist-filter-country-label'))
     				      ->addFilter('StringToLower')
     				      ->setDecorators(array('UserListFilterElementDecorator'))
     				      ->setMultiOptions($formData['countryList'])
                           ->setValue(isset($formData['country']) ? $formData['country'] : '');
     */
     // User city input
     $city = new Zend_Form_Element_Text('city');
     $city->setLabel($translate->_('userlist-filter-city-label'))->addFilter('StringToLower')->setDecorators(array('UserListFilterElementDecorator'))->setValue(isset($formData['city']) ? $formData['city'] : '');
     // Search submit
     $submit = new Zend_Form_Element_Submit('filter');
     $submit->setLabel($translate->_('userlist-filter-submit'));
     $submit->removeDecorator('DtDdWrapper');
     // Add elements to form
     $this->addElements(array($username, $city, $submit));
 }
Пример #30
0
 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     $this->setName('FormularioStatusProjeto');
     $ID_STATUS_PROJETO = new Zend_Form_Element_Hidden('ID_STATUS_PROJETO');
     $ID_STATUS_PROJETO->addFilter('Int');
     $ID_STATUS_PROJETO->removeDecorator('Label');
     $NM_STATUS_PROJETO = new Zend_Form_Element_Text('NM_STATUS_PROJETO');
     $NM_STATUS_PROJETO->setLabel('STATUS')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label')->setAttrib('class', 'form-control')->setAttrib('placeholder', 'Enter status');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel("Adiconar");
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper')->setAttrib('class', 'btn btn-primary button')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $this->addElements(array($ID_STATUS_PROJETO, $NM_STATUS_PROJETO, $submit));
     $this->setDecorators(array(array('ViewScript', array('viewScript' => '/forms/formularioStatusProjeto.phtml'))));
 }