Ejemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->addElement(new My_Form_Element_Text_Institucion('institucion'));
     $this->addElement(new My_Form_Element_Text_Tag('tag'));
     $this->addElement(new My_Form_Element_Select_Nivel('nivel'));
 }
Ejemplo n.º 2
0
 public function init()
 {
     parent::init();
     $this->addElement(new My_Form_Element_Text_Empresa('empresa'));
     $this->addElement(new My_Form_Element_Text_Tag('tag'));
     $this->addElement(new My_Form_Element_Select_Nivel('nivel'));
 }
 public function init()
 {
     //make sure we call parent init first
     parent::init();
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_modifyHealthProduct.phtml'))));
     //Make required element changes
     $this->setAttrib('name', 'modifyProductHealthForm');
     // Product Company Name Element
     $this->addElement('text', 'product_company_name', array('label' => 'Company Name:', 'required' => false, 'disabled' => 'disabled'));
     // Product Name Element
     $this->addElement('text', 'product_name', array('filters' => array('StringTrim'), 'label' => 'Product Name:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Product Name...'))), array('StringLength', true, array(1, 250)))));
     // Product type Element
     $this->addElement('select', 'product_type', array('label' => 'Policy type:', 'required' => true, 'multioptions' => array('' => '***Policy Type***', 'HSA' => 'HSA', 'HRA' => 'HRA', 'Other' => 'Other'), 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to select a Policy type...'))))));
     // Insurance Riders Element
     $this->addElement('multicheckbox', 'product_riders', array('label' => 'Insurance Riders:', 'required' => true, 'multioptions' => array('LTC Rider' => 'LTC Rider', 'Other' => 'Other', 'None' => 'None'), 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to select the appropriate Riders or None...'))))));
     // Product Notes Element
     $this->addElement('textarea', 'product_notes', array('filters' => array('StringTrim'), 'Label' => 'Product Notes:', 'cols' => '30', 'rows' => '4', 'validators' => array(array('NotEmpty', true))));
     //Add ProductId Element
     $this->addElement('hidden', 'product_id', array('required' => true));
     // Company Name Id
     $this->addElement('hidden', 'product_company_id', array('required' => true));
     // Category Id
     $this->addElement('hidden', 'product_category_id', array('required' => true));
     // Category Name
     $this->addElement('hidden', 'product_category_name', array('required' => true));
     /**
      * Buttons
      */
     $this->addElement('button', 'saveCloseButton', array('Label' => 'Save & Close', 'class' => 'ui-state-default float-left ui-corner-all ui-button'));
     $this->getElement('saveCloseButton')->removeDecorator('DtDdWrapper');
     $this->addElement('button', 'saveContinueButton', array('Label' => ' Save ', 'class' => 'ui-state-default float-right ui-corner-all ui-button'));
     $this->getElement('saveContinueButton')->removeDecorator('DtDdWrapper');
 }
Ejemplo n.º 4
0
 public function init()
 {
     parent::init();
     $this->getElement('confirmPassword')->addValidator(new Form_Validate_Password());
     $this->getElement('username')->addValidator(new Form_Validate_LoginAvailable(array('ignoreCase' => true)));
     $this->getElement('password')->addErrorMessages(array(Zend_Validate_StringLength::TOO_SHORT => 'admin_account_error_password_tooshort'));
 }
Ejemplo n.º 5
0
 public function init()
 {
     $config = Zend_Registry::get('config');
     $lang = Zend_Registry::get('lang');
     $this->setMethod('post');
     $this->setName('free_user_form');
     $this->setAction('/register/new');
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setAttrib('lang', $lang);
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'register/register.phtml'), 'Form')));
     $name = $this->createElement('text', 'name', array('class' => 'form-control', 'placeholder' => $lang->_('NAME')));
     $name->setRequired(true)->addErrorMessage($lang->_('REGISTER_NAME_ERROR_MSG'));
     $email = $this->createElement('text', 'email', array('data-content' => $lang->_('REGISTER_EMAIL_HINT'), 'class' => 'form-control', 'placeholder' => $lang->_('EMAIL'), 'hint' => $lang->_('EMAIL_HINT')));
     $email->addValidator('EmailAddress')->setRequired(true)->addErrorMessage($lang->_('REGISTER_EMAIL_ERROR_MSG'));
     $password = $this->createElement('password', 'password', array('data-content' => $lang->_('REGISTER_PASSWORD_HINT'), 'class' => 'form-control', 'placeholder' => $lang->_('PASSWORD')));
     $password->addValidator('alnum')->addValidator('stringLength', false, array(6, 20))->setRequired(true)->addErrorMessage($lang->_('REGISTER_PASSWORD_ERROR_MSG'));
     $repassword = $this->createElement('password', 'repassword', array('class' => 'form-control', 'placeholder' => $lang->_('REPASSWORD')));
     $repassword->addValidator(new Zend_Validate_Identical('password'))->setRequired(true)->addErrorMessage($lang->_('REGISTER_REPASSWORD_ERROR_MSG'));
     $terms = $this->createElement('checkbox', 'terms_agree', array('label' => $lang->_('TERMS_AGREE_LABEL')));
     $terms->setUncheckedValue(null);
     $terms->setDecorators(array('Description', 'Errors', array('ViewHelper'), array('Label', array('class' => 'radio-inline', 'placement' => 'APPEND', 'escape' => false))));
     $terms->setRequired(true)->addErrorMessage($lang->_('TERMS_ERROR_MSG'));
     $submit = $this->createElement('submit', 'submit', array('label' => $lang->_('REGISTER'), 'class' => 'btn btn-orange btn-block'));
     $this->addElements(array($name, $email, $password, $repassword, $terms, $submit));
     parent::init();
 }
Ejemplo n.º 6
0
 public function init()
 {
     parent::init();
     $this->setMethod('post')->setAttrib('accept-charset', 'UTF-8')->clearDecorators()->addPrefixPaths(array(array('prefix' => 'Digitalus_Form_Decorator', 'path' => 'Digitalus/Form/Decorator', 'type' => 'decorator'), array('prefix' => 'Digitalus_Form_Element', 'path' => 'Digitalus/Form/Element/', 'type' => 'element')))->addElementPrefixPaths(array(array('prefix' => 'Digitalus_Form_Decorator', 'path' => 'Digitalus/Form/Decorator', 'type' => 'decorator'), array('prefix' => 'Digitalus_Filter', 'path' => 'Digitalus/Filter/', 'type' => 'filter'), array('prefix' => 'Digitalus_Validate', 'path' => 'Digitalus/Validate', 'type' => 'validate')));
     $this->_setStandardDecorators();
     //set instance
     $instance = $this->_addInstance();
     $instanceElement = $this->createElement('hidden', 'form_instance', array('value' => $instance, 'decorators' => array('ViewHelper')));
     $this->addElement($instanceElement);
 }
Ejemplo n.º 7
0
 public function init()
 {
     parent::init();
     $this->setMethod('post');
     $this->addElement('text', 'subject', array('label' => 'Subject:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(0, 50))), 'ng-model' => 'user.subject'));
     $this->addElement('text', 'letter', array('label' => 'Letter:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(0, 50))), 'ng-model' => 'user.letter'));
     $this->addElement('button', 'zrobszkic', array('ignore' => true, 'label' => 'Zrob szkic', 'ng-click' => 'addszkic(user);'));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Save'));
     $this->addElement('hash', 'csrf', array('ignore' => true));
 }
Ejemplo n.º 8
0
 public function init()
 {
     parent::init();
     // add submit
     $submit = new Zend_Form_Element_Submit("submit");
     $submit->setLabel("Enviar");
     $submit->setAttribs(array('class' => 'btn btn-primary form-control'));
     $this->addElement($submit);
     $this->setElementsDefaultAttribs();
 }
Ejemplo n.º 9
0
 public function init()
 {
     parent::init();
     $this->setMethod('post');
     $this->addElement('text', 'email', array('label' => 'Your email address:', 'required' => true, 'filters' => array('StringTrim'), 'validators' => array('EmailAddress'), 'ng-model' => 'user.email', 'validator' => 'required'));
     $this->addElement('text', 'firstname', array('label' => 'Firstname:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(0, 50))), 'ng-model' => 'user.firstname', 'validator' => 'required'));
     $this->addElement('text', 'lastname', array('label' => 'Lastname:', 'required' => true, 'validators' => array(array('validator' => 'StringLength', 'options' => array(0, 50))), 'ng-model' => 'user.lastname', 'validator' => 'required'));
     $this->addElement('button', 'zrobszkic', array('ignore' => true, 'label' => 'Zrob szkic', 'ng-click' => 'addszkic(user)'));
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Save'));
     $this->addElement('hash', 'csrf', array('ignore' => true));
 }
Ejemplo n.º 10
0
 public function init()
 {
     $this->setMethod('post');
     parent::init();
     $this->_setLabels();
     $this->_setAttribs();
     $this->_setOptions();
     $this->_setRequireds();
     $this->_setValue();
     $this->_removeDecorator();
     $this->_addContentElement();
 }
Ejemplo n.º 11
0
 public function init()
 {
     $this->setAttrib('id', 'uploader');
     $this->addElement('file', 'fileupload', array('class' => 'btn btn-success fileinput-button', 'attributes' => 'multiple', 'title' => 'Search for files'));
     $this->addElement('Button', 'start', array('label' => 'Start Upload', 'class' => 'btn btn-primary start', 'escape' => false));
     $this->addElement('Button', 'cancel', array('label' => 'Cancel Upload', 'class' => 'btn btn-warning cancel', 'escape' => false));
     $this->addElement('Button', 'delete', array('label' => 'Delete', 'class' => 'btn btn-danger delete', 'escape' => false));
     $this->fileupload->setDecorators(array('File', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))));
     $this->start->setDecorators(array('ViewHelper'));
     $this->cancel->setDecorators(array('ViewHelper'));
     $this->delete->setDecorators(array('ViewHelper'));
     $this->setAction('/database/ajax/upload');
     parent::init();
 }
Ejemplo n.º 12
0
 public function init()
 {
     $lang = Zend_Registry::get('lang');
     $this->setMethod('post');
     $this->setName('addgame_form');
     $this->setAction($this->_getUrl('planing', 'addgame'));
     $this->setAttrib('lang', $lang);
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'planing/newgame.phtml'), 'Form')));
     $gameName = $this->createElement('text', 'gameName', array('class' => 'form-element', 'placeholder' => $lang->_('GAMENAME')));
     $gameName->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     $submit = $this->createElement('submit', 'submit', array('class' => 'btn btn-finish', 'label' => $lang->_('FINISH')));
     $this->addElements(array($gameName, $submit));
     parent::init();
 }
Ejemplo n.º 13
0
 public function init()
 {
     $lang = Zend_Registry::get('lang');
     $this->setMethod('post');
     $this->setName('addgoal_form');
     if ($this->_goalname != NULL) {
         $this->setAction($this->_getUrl('admin', 'updategoal'));
     } else {
         $this->setAction($this->_getUrl('admin', 'savegoal'));
     }
     $this->setAttrib('lang', $lang);
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'admin/addgoal.phtml'), 'Form')));
     $goalName = $this->createElement('text', 'goalName', array('class' => 'form-element', 'placeholder' => $lang->_('GOAL_NAME')));
     $goalName->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     if ($this->_goalname != NULL) {
         $goalName->setValue($this->_goalname);
     }
     $goalLevel = $this->createElement('text', 'goalLevel', array('class' => 'form-element', 'placeholder' => $lang->_('GOAL_LEVEL')));
     $goalLevel->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     if ($this->_goallevel != NULL) {
         $goalLevel->setValue($this->_goallevel);
     }
     $grade1 = $this->createElement('text', 'grade1', array('class' => 'form-element', 'placeholder' => $lang->_('GRADE1')));
     $grade1->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     if ($this->_grade1 != NULL) {
         $grade1->setValue($this->_grade1);
     }
     $grade2 = $this->createElement('text', 'grade2', array('class' => 'form-element', 'placeholder' => $lang->_('GRADE2')));
     $grade2->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     if ($this->_grade2 != NULL) {
         $grade2->setValue($this->_grade2);
     }
     $grade3 = $this->createElement('text', 'grade3', array('class' => 'form-element', 'placeholder' => $lang->_('GRADE3')));
     $grade3->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     if ($this->_grade3 != NULL) {
         $grade3->setValue($this->_grade3);
     }
     $grade4 = $this->createElement('text', 'grade4', array('class' => 'form-element', 'placeholder' => $lang->_('GRADE4')));
     $grade4->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     if ($this->_grade4 != NULL) {
         $grade4->setValue($this->_grade4);
     }
     $submit = $this->createElement('submit', 'submit', array('class' => 'btn btn-finish', 'label' => $lang->_('FINISH')));
     $this->addElements(array($goalName, $goalLevel, $grade1, $grade2, $grade3, $grade4, $submit));
     parent::init();
 }
 public function init()
 {
     //make sure we call parent init first
     parent::init();
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_modifyAnnuityProduct.phtml'))));
     //Make required element changes
     $this->setAttrib('name', 'modifyProductAnnuityForm');
     // Product Company Name Element
     $this->addElement('text', 'product_company_name', array('label' => 'Company Name:', 'required' => false, 'disabled' => 'disabled'));
     // Product Name Element
     $this->addElement('text', 'product_name', array('filters' => array('StringTrim'), 'label' => 'Product Name:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Product Name...'))), array('StringLength', true, array(1, 100)))));
     // Premium Bonus Element
     $this->addElement('text', 'product_premiumbonus', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Premium Bonus:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Premimum Bonus or 0...'))), new FFR_Form_Validator_ValidFloat(), array('StringLength', true, array(1, 10)))));
     // Minumu Guarantee Element
     $this->addElement('text', 'product_minguarantee', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Minimum Guarantee:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Minimum Guarantee...'))), new FFR_Form_Validator_ValidFloat(), array('StringLength', true, array(1, 50)))));
     // Max Age Element
     $this->addElement('text', 'product_maxage', array('filters' => array('StringTrim', new Zend_Filter_Digits()), 'label' => 'Max Age:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Maximum Age...'))), array('StringLength', true, array(1, 4)))));
     // Minimum Premium Element
     $this->addElement('text', 'product_minpremium', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Minimum Premium:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Minimum Premium...'))), new FFR_Form_Validator_ValidFloat(), array('StringLength', true, array(1, 15)))));
     // Liquidity Element
     $this->addElement('text', 'product_liquidity', array('filters' => array('StringTrim'), 'label' => 'Liquidity:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Product Liquidity...'))), array('StringLength', true, array(1, 100)))));
     // Surrender Charges Element
     $this->addElement('text', 'product_surrendercharges', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Surrender Charges:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter Surrender Charges or 0...'))), new FFR_Form_Validator_ValidFloat(), array('StringLength', true, array(1, 200)))));
     // Product Notes Element
     $this->addElement('textarea', 'product_notes', array('filters' => array('StringTrim'), 'Label' => 'Product Notes:', 'cols' => '30', 'rows' => '4', 'validators' => array(array('NotEmpty', true))));
     // Death Benefit Element
     $this->addElement('text', 'product_deathbenefit', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Death Benefit:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter the Death Benefit...'))), new FFR_Form_Validator_ValidFloat())));
     // Waivers Element
     $this->addElement('text', 'product_waivers', array('filters' => array('StringTrim'), 'label' => 'Waivers:', 'required' => false, 'validators' => array(array('NotEmpty', true))));
     // Charge Backs Element
     $this->addElement('text', 'product_chargebacks', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Charge Backs:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Product Charge backs or 0...'))), new FFR_Form_Validator_ValidFloat())));
     //Add ProductId Element
     $this->addElement('hidden', 'product_id', array('required' => true));
     // Company Name Id
     $this->addElement('hidden', 'product_company_id', array('required' => true));
     // Category Id
     $this->addElement('hidden', 'product_category_id', array('required' => true));
     // Category Name
     $this->addElement('hidden', 'product_category_name', array('required' => true));
     /**
      * Buttons
      */
     $this->addElement('button', 'saveCloseButton', array('Label' => 'Save & Close', 'class' => 'ui-state-default float-left ui-corner-all ui-button'));
     $this->getElement('saveCloseButton')->removeDecorator('DtDdWrapper');
     $this->addElement('button', 'saveContinueButton', array('Label' => ' Save ', 'class' => 'ui-state-default float-right ui-corner-all ui-button'));
     $this->getElement('saveContinueButton')->removeDecorator('DtDdWrapper');
 }
 public function init()
 {
     //make sure we call parent init first
     parent::init();
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'partials/_modifyLifeProduct.phtml'))));
     //Make required element changes
     $this->setAttrib('name', 'modifyProductLifeForm');
     // Product Company Name Element
     $this->addElement('text', 'product_company_name', array('label' => 'Company Name:', 'required' => false, 'disabled' => 'disabled'));
     // Product Name Element
     $this->addElement('text', 'product_name', array('filters' => array('StringTrim'), 'label' => 'Product Name:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Product Name...'))), array('StringLength', true, array(1, 250)))));
     // Premium Bonus Element
     $this->addElement('text', 'product_premiumbonus', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Premium Bonus:', 'required' => true, 'validators' => array(array('NotEmpty', true), array('StringLength', true, array(1, 10)))));
     // Product Type Element
     $this->addElement('select', 'product_type', array('label' => 'Policy Type:', 'required' => true, 'multioptions' => array('' => '***Policy Type***', 'Term Life' => 'Term Life', 'Whole Life' => 'Whole Life'), 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to select the Prduct Type...'))))));
     // Max Age Element
     $this->addElement('text', 'product_maxage', array('filters' => array('StringTrim', new Zend_Filter_Digits()), 'label' => 'Max Age:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Maximum Age...'))), array('StringLength', true, array(1, 4)))));
     // Minimum Premium Element
     $this->addElement('text', 'product_minpremium', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Minimum Premium:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Minimum Premium...'))), new FFR_Form_Validator_ValidFloat())));
     // Maximum Premium Element
     $this->addElement('text', 'product_maxpremium', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Maximum Premium:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Maximum Premium...'))), new FFR_Form_Validator_ValidFloat())));
     // Product Notes Element
     $this->addElement('textarea', 'product_notes', array('filters' => array('StringTrim'), 'Label' => 'Product Notes:', 'cols' => '30', 'rows' => '4', 'validators' => array(array('NotEmpty', true))));
     // Max Death Benefit Element
     $this->addElement('text', 'product_maxdeathbenefit', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Max Death Benefit:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Maximum Death Benefit...'))), new FFR_Form_Validator_ValidFloat())));
     // Min Death Benefit Element
     $this->addElement('text', 'product_mindeathbenefit', array('filters' => array('StringTrim', new Zend_Filter_LocalizedToNormalized(array('precision' => 2))), 'label' => 'Minimum Death Benefit:', 'required' => true, 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to enter a Minimum Death Benefit...'))), new FFR_Form_Validator_ValidFloat())));
     // Insurance Riders Element
     $this->addElement('multicheckbox', 'product_riders', array('label' => 'Insurance Riders:', 'required' => true, 'multioptions' => array('LTC Rider' => 'LTC Rider', '2nd-to-Die' => '2nd-to-Die', 'Other Riders' => 'Other Riders', 'None' => 'None'), 'validators' => array(array('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'You are required to select the appropriate Riders or None...'))))));
     //Add ProductId Element
     $this->addElement('hidden', 'product_id', array('required' => true));
     // Company Name Id
     $this->addElement('hidden', 'product_company_id', array('required' => true));
     // Category Id
     $this->addElement('hidden', 'product_category_id', array('required' => true));
     // Category Name
     $this->addElement('hidden', 'product_category_name', array('required' => true));
     /**
      * Buttons
      */
     $this->addElement('button', 'saveCloseButton', array('Label' => 'Save & Close', 'class' => 'ui-state-default float-left ui-corner-all ui-button'));
     $this->getElement('saveCloseButton')->removeDecorator('DtDdWrapper');
     $this->addElement('button', 'saveContinueButton', array('Label' => ' Save ', 'class' => 'ui-state-default float-right ui-corner-all ui-button'));
     $this->getElement('saveContinueButton')->removeDecorator('DtDdWrapper');
 }
Ejemplo n.º 16
0
 public function init()
 {
     $lang = Zend_Registry::get('lang');
     $this->setMethod('post');
     $this->setName('addgroup_form');
     $this->setAction($this->_getUrl('managegroups', 'save'));
     $this->setAttrib('lang', $lang);
     $this->setAttrib('enctype', 'application/x-www-form-urlencoded');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'managegroups/add.phtml'), 'Form')));
     $groupName = $this->createElement('text', 'groupName', array('class' => 'form-element', 'placeholder' => $lang->_('GROUPNAME')));
     $groupName->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     $color = $this->createElement('select', 'color', array('class' => 'form-element', 'label' => $lang->_('GROUPCOLOR')));
     $color->addMultiOptions(array('yellow' => $lang->_('YELLOW'), 'red' => $lang->_('RED'), 'purple' => $lang->_('PURPLE'), 'green' => $lang->_('GREEN'), 'blue' => $lang->_('BLUE')));
     $color->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     $submit = $this->createElement('submit', 'submit', array('class' => 'btn btn-finish', 'label' => $lang->_('FINISH')));
     $this->addElements(array($groupName, $color, $submit));
     parent::init();
 }
Ejemplo n.º 17
0
    /**
     * Adds the default elements to the form.
     *
     * @return void
     */
    public function init()
    {
        parent::init();

        $this->addElement('Text', 'sample', array(
            'label' => 'Sample',
            'required' => true,
            'validators' => array(
                'alnum'
            ),
            'filters' => array('StringToLower')
        ));

        $this->addElement('Button', 'save', array(
            'label' => 'Save Changes',
            'attribs' => array('type' => 'submit')
        ));
    }
Ejemplo n.º 18
0
 public function init()
 {
     parent::init();
     $this->setName('newBranchForm');
     $this->setMethod('post');
     $this->setAction('ajax/newbranch/');
     $name = new Zend_Form_Element_Text('name_branch');
     $name->setLabel('Enter new branch name');
     $name->addValidator('StringLength', true, array(1, 128));
     $name->addValidator('Regex', true, array('pattern' => self::pattern));
     $cancel = new Zend_Form_Element_Button('cancel_branch');
     $cancel->setLabel('Cancel');
     $cancel->setAttrib('onclick', 'hideNewBranch()');
     $cancel->setAttrib('class', 'button');
     $submit = new Zend_Form_Element_Submit('new_branch');
     $submit->setLabel('New');
     $submit->setAttrib('class', 'button');
     $this->setElements(array($name, $cancel, $submit));
 }
Ejemplo n.º 19
0
 public function init()
 {
     $lang = Zend_Registry::get('lang');
     $this->setMethod('post');
     $this->setName('login_form');
     $this->setAction($this->_getUrl('login', 'check'));
     $this->setAttrib('lang', $lang);
     $this->setAttrib('enctype', 'application/x-www-form-urlencoded');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'index/login.phtml'), 'Form')));
     $username = $this->createElement('text', 'username', array('class' => 'form-control', 'placeholder' => $lang->_('USERNAME')));
     $username->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     $username->addFilters(array('StringTrim', 'StripTags'));
     $username->addValidator('EmailAddress', TRUE)->addErrorMessage($lang->_('INVALID_EMAIL'));
     $password = $this->createElement('password', 'password', array('class' => 'form-control', 'placeholder' => $lang->_('PASSWORD')));
     $password->setRequired(true)->addErrorMessage($lang->_('PASSWORD_ERROR_MSG'));
     $submit = $this->createElement('submit', 'submit', array('class' => 'btn btn-next-action btn-block', 'label' => $lang->_('LOGIN')));
     $this->addElements(array($username, $password, $submit));
     parent::init();
 }
Ejemplo n.º 20
0
 public function init($option = NULL)
 {
     parent::init($option);
     /*$filterPath = $this->getView()->getFilterPaths(); 
       $preFix = 'Zend_View_Filter_'; 
       $this->addElementPrefixPath($preFix, $filterPath[$preFix][1], 'filter');*/
     //var_dump($this->getTranslator());exit;
     //$translate = $this->getTranslator();
     //Zend_Debug::dump($translate->_('alnumInvalid'));exit;
     $this->addElementPrefixPath('Vow_Filter', 'Vow/Filter', 'filter');
     $this->addElement('text', 'username', array('Filters' => array('StringTrim', 'UcFirst'), 'Validators' => array('Alnum', array('StringLength', false, array(2, 5))), 'Label' => '昵称:', 'Description' => '(2 < strlen(this) < 10)', 'AllowEmpty' => false, 'Attribs' => array('class' => 'inp')));
     $this->addElement('text', 'mail1', array('Validators' => array('EmailAddress'), 'Label' => 'Mail:', 'Description' => 'e.g.:msn@msn.com', 'AllowEmpty' => false, 'Attribs' => array('class' => 'inp'), 'ErrorMessages' => array('Email格式错误!')));
     $this->addElement('text', 'mail2', array('prefixPath' => array(array('type' => 'validate', 'prefix' => 'Vow_Form_Validate', 'path' => 'Vow/Form/Validate/')), 'Validators' => array(array('EmailConfirmation', false, array(array('mail1', 'mail2')))), 'ignore' => true, 'Label' => 'ReMail:', 'AllowEmpty' => false, 'Attribs' => array('class' => 'inp')));
     $this->addElement('textarea', 'content', array('Filters' => array('StringTrim'), 'Validators' => array(array('StringLength', false, array(2, 200))), 'AllowEmpty' => false, 'Label' => '内容:', 'Attribs' => array('rows' => '8', 'cols' => '80', 'class' => 'inp', 'style' => 'height: 100px; width: 450px; overflow-y: auto;')));
     $this->addElement('captcha', 'captcha', array('captcha' => array('captcha' => 'Image', 'wordLen' => 5, 'fontsize' => 18, 'width' => 120, 'height' => 40, 'dotNoiseLevel' => 2, 'lineNoiseLevel' => 5, 'timeout' => 10, 'font' => 'fonts/Faktos.ttf', 'imgDir' => './captcha/', 'imgUrl' => '/captcha/', 'gcFreq' => 2, 'expiration' => 10, 'imgAlt' => '验证码'), 'Filters' => array('StringTrim'), 'AllowEmpty' => false, 'Label' => '验证码:', 'Attribs' => array('class' => 'inp captcha')));
     $this->addElement('submit', 'submitbotton', array('ignore' => true, 'Label' => '提交留言', 'Attribs' => array('class' => 'but')));
     $this->addElement('hash', 'csrf', array('ignore' => true, 'salt' => 'unique'));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form')), 'Form'));
 }
Ejemplo n.º 21
0
 public function init()
 {
     $lang = Zend_Registry::get('lang');
     $this->setMethod('post');
     $this->setName('adduser_form');
     $this->setAction($this->_getUrl('admin', 'saveuser'));
     $this->setAttrib('lang', $lang);
     $this->setAttrib('enctype', 'application/x-www-form-urlencoded');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'admin/adduser.phtml'), 'Form')));
     $email = $this->createElement('text', 'email', array('class' => 'form-element', 'placeholder' => $lang->_('EMAIL')));
     $email->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     $password = $this->createElement('password', 'password', array('class' => 'form-element', 'placeholder' => $lang->_('PASSWORD')));
     $password->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     $isAdmin = $this->createElement('checkbox', 'isAdmin', array('label' => $lang->_('IS_ADMIN')));
     $isAdmin->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     $submit = $this->createElement('submit', 'submit', array('class' => 'btn btn-finish', 'label' => $lang->_('FINISH')));
     $this->addElements(array($email, $password, $isAdmin, $submit));
     parent::init();
 }
Ejemplo n.º 22
0
 public function init()
 {
     parent::init();
     // $this->clearDecorators();
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Save')->setOrder(10)->setIgnore(1);
     $this->addElement($submit);
     // $reset = new Zend_Form_Element_Reset('reset');
     // $reset->setOrder(11);
     // $this->addElement($reset);
     // $reset->setLabel('Reset')
     //     ->setDescription('<a href="/">Link</a>')
     // 	->setDecorators(array(
     //         'ViewHelper',
     //         array('Description', array('escape' => false, 'tag' => false)),
     //         array('HtmlTag', array('tag' => 'dd')),
     //         'Errors',
     //       ));
     // $this->addElement($reset);
     // // var_dump($this);
 }
Ejemplo n.º 23
0
 public function init()
 {
     $lang = Zend_Registry::get('lang');
     $this->setMethod('post');
     $this->setName('addgan_form');
     if ($this->_ganname != NULL) {
         $this->setAction($this->_getUrl('admin', 'updateganname'));
     } else {
         $this->setAction($this->_getUrl('admin', 'savegan'));
     }
     $this->setAttrib('lang', $lang);
     $this->setAttrib('enctype', 'application/x-www-form-urlencoded');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'admin/addgan.phtml'), 'Form')));
     $ganName = $this->createElement('text', 'ganName', array('class' => 'form-element', 'placeholder' => $lang->_('GANNAME')));
     $ganName->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     if ($this->_ganname != NULL) {
         $ganName->setValue($this->_ganname);
     }
     $submit = $this->createElement('submit', 'submit', array('class' => 'btn btn-finish', 'label' => $lang->_('FINISH')));
     $this->addElements(array($ganName, $submit));
     parent::init();
 }
Ejemplo n.º 24
0
 public function init()
 {
     $lang = Zend_Registry::get('lang');
     $this->setMethod('post');
     $this->setName('addfield_form');
     if ($this->_fieldname != NULL) {
         $this->setAction($this->_getUrl('admin', 'updatefield'));
     } else {
         $this->setAction($this->_getUrl('admin', 'savefield'));
     }
     $this->setAttrib('lang', $lang);
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'admin/addfield.phtml'), 'Form')));
     $fieldName = $this->createElement('text', 'fieldName', array('class' => 'form-element', 'placeholder' => $lang->_('FIELD_NAME')));
     $fieldName->setRequired(true)->addErrorMessage($lang->_('REQUIRED_FIELD'));
     if ($this->_fieldname != NULL) {
         $fieldName->setValue($this->_fieldname);
     }
     $submit = $this->createElement('submit', 'submit', array('class' => 'btn btn-finish', 'label' => $lang->_('FINISH')));
     $this->addElements(array($fieldName, $submit));
     parent::init();
 }
Ejemplo n.º 25
0
 /**
  * Initialization form
  * 
  * return void
  */
 public function init()
 {
     parent::init();
     // Получим объект переводчика
     $translate = Zend_Registry::get('Zend_Translate');
     // Задаем объект переводчика для формы
     $this->setTranslator($translate);
     /* Specifies the prefix for samopisnyh elements, validators, filters, and decorators.
        This Zend Form will know where to find our custom items */
     $this->addElementPrefixPath('Default_Form_Validate', APPLICATION_PATH . '/forms/validate/', 'validate');
     $this->addElementPrefixPath('Default_Form_Filter', APPLICATION_PATH . '/forms/filter/', 'filter');
     $this->addElementPrefixPath('Default_Form_Decorator', APPLICATION_PATH . '/forms/decorator/', 'decorator');
     $this->addPrefixPath('Default_Form_Element', APPLICATION_PATH . '/forms/element/', 'element');
     // Получим язык сайта
     $this->_language = Default_Plugin_SysBox::getTranslateLocale();
     // Set
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $identity = $auth->getIdentity();
         $this->_user_type = $identity->user_type;
     } else {
         $this->_user_type = 'guest';
     }
 }
Ejemplo n.º 26
0
 public function init()
 {
     parent::init();
     $this->getElement('name')->addValidator(new Form_Validate_RoleAvailable());
 }
Ejemplo n.º 27
0
 public function init()
 {
     parent::init();
     $event = new Bc_Form_Event(Bc_Form_Event::FORM_INIT_EVENT, $this);
     $event->dispatch();
 }
Ejemplo n.º 28
0
 public function init()
 {
     parent::init();
 }
Ejemplo n.º 29
0
 public function init()
 {
     parent::init();
     $this->setAttrib('class', 'zfForm form-stacked');
 }
Ejemplo n.º 30
0
 public function init()
 {
     $this->setMethod('post');
     VAR_fields;
     parent::init();
 }