public function __construct(array $values = array(), $insert = false, $options = array()) { parent::__construct($options); $this->setName($insert ? 'addproject' : 'editproject')->setAction('#')->setMethod('post')->setAttrib('id', $insert ? 'addproject' : 'editproject'); # name $name = $this->createElement('text', 'name')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->addValidator('StringLength', true, array('min' => 3, 'max' => 255, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'default_form_error_length', Zend_Validate_StringLength::TOO_SHORT => 'default_form_error_length')))->setRequired(true)->setValue(isset($values['name']) ? $values['name'] : null)->setLabel('project_admin_field_name'); # name-jp $namejp = $this->createElement('text', 'name_jp')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->addValidator('StringLength', false, array('min' => 3, 'max' => 255, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'default_form_error_length', Zend_Validate_StringLength::TOO_SHORT => 'default_form_error_length')))->setRequired(true)->setValue(isset($values['name_jp']) ? $values['name_jp'] : null)->setLabel('project_admin_field_name_jp'); # episode count $episodes = $this->createElement('text', 'episode_count')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('Int', false, array('meesages' => array(Zend_Validate_Int::NOT_INT => 'default_form_error_int')))->setValue(isset($values['element_count']) ? $values['element_count'] : null)->setLabel('project_admin_field_episode_count'); # status $status = $this->createElement('select', 'status')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->setLabel('project_admin_field_status')->setRequired(true)->setValue(isset($values['status']) ? $values['status'] : 'planned')->setMultiOptions(array('planned' => 'project_status_planned', 'progress' => 'project_status_progress', 'pending' => 'project_status_pending', 'completed' => 'project_status_completed', 'dropped' => 'project_status_dropped', 'licensed' => 'project_status_licensed')); # desctiption $description = $this->createElement('textarea', 'description'); $description->setValue(isset($values['description']) ? $values['description'] : null)->setRequired(true)->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->setAttrib('cols', 40)->setAttrib('rows', 15)->setLabel('description'); $poster = $this->createElement('text', 'poster')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->addValidator('StringLength', false, array('min' => 5, 'max' => 255, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'default_form_error_length', Zend_Validate_StringLength::TOO_SHORT => 'default_form_error_length')))->setRequired(true)->setValue(isset($values['poster']) ? $values['poster'] : null)->setLabel('project_admin_field_poster'); $miniposter = $this->createElement('text', 'mini_poster')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->addValidator('StringLength', false, array('min' => 5, 'max' => 255, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'default_form_error_length', Zend_Validate_StringLength::TOO_SHORT => 'default_form_error_length')))->setRequired(true)->setValue(isset($values['mini_poster']) ? $values['mini_poster'] : null)->setLabel('project_admin_field_mini_poster'); $uTable = Doctrine::getTable('User_Model_User'); $users = $uTable->getMultiOptions(); $leaders = $this->createElement('multiselect', 'leaders'); $leaders->setMultiOptions($users)->setLabel('project_admin_field_leader')->setValue(isset($values['Projects_Model_Leader']) ? $values['Projects_Model_Leader'] : array()); $private = $this->createElement('radio', 'private')->setMultiOptions(array('yes' => 'yes_term', 'no' => 'no_term'))->setLabel('project_admin_field_private')->setValue(isset($values['private']) ? $values['private'] : 'yes'); # add elements to the form $this->addElement($name)->addElement($namejp)->addElement($episodes)->addElement($status)->addElement($description)->addElement($poster)->addElement($miniposter)->addElement($leaders)->addElement($private)->addElement('submit', $insert ? 'add' : 'update', array('label' => $insert ? 'add' : 'update', 'class' => 'button')); }
public function __construct($id) { $options = new Zend_Config_Ini(dirname(__FILE__) . '/EditCP.ini', 'fields'); parent::__construct($options); $this->id->setValue($id); // $this->setAction('/admin/pages'); }
public function __construct(array $dataBusinessId, $options = null) { parent::__construct($options); $this->setName('frmEmployee'); $this->setMethod('post'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Employee name'); $name->setAttrib('maxlength', 80); $name->setRequired(true); $name->addValidator(new Zend_Validate_NotEmpty()); $this->addElement($name); $age = new Zend_Form_Element_Text('age'); $age->setLabel('Employee age'); $age->addValidator(new Zend_Validate_Int()); $this->addElement($age); $businessId = new Zend_Form_Element_Select('business_id'); $businessId->setLabel('Business'); $businessId->setRequired(true); $businessId->addValidator(new Zend_Validate_NotEmpty()); $businessId->addValidator(new Zend_Validate_Int()); $businessId->addMultiOptions($dataBusinessId); $this->addElement($businessId); $submit = new Zend_Form_Element_Submit('bt_submit'); $submit->setLabel('Save'); $this->addElement($submit); }
/** * Constructor. * * Turns off Zend_Form translation before calling the parent constructor. * * @param mixed $options Set of options for configuring the form. */ public function __construct($options = null) { // Turn off the translator as this will be done in PHPTAL. $this->setDisableTranslator(true); // Call the parent constructor to set up everything else. parent::__construct($options); }
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)); }
/** * Override the base form constructor. * * @param null $options */ public function __construct($options = null) { $this->_initializePrefixes(); $this->setDecorators(array('FormElements', 'Form')); parent::__construct($options); $this->_initializeFieldColSize(); }
public function __construct($options = null) { parent::__construct($options); $emailCategoryOptionList = array('Invite non-sparks to join campaign' => $this->getView()->translate('Admin_Non-Sparks_Invitation'), 'Invite sparks to join campaign' => $this->getView()->translate('Admin_Sparks_Invitation'), 'Send mail to sparks' => $this->getView()->translate('Admin_Send_Mail_To_Sparks')); $emailCategory = new Zend_Form_Element_Select('emailCategory'); $emailCategory->setMultiOptions($emailCategoryOptionList); $emailList = new Zend_Form_Element_Textarea('emailList'); $emailList->setAttribs(array('rows' => 5, 'cols' => 150, 'onChange' => 'datetable()'))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535)))); $subject = new Zend_Form_Element_Text('subject'); $subject->setAttribs(array('size' => 150))->addFilter('StringTrim'); $message = new Zend_Form_Element_Textarea('message'); $message->setAttribs(array('rows' => 30, 'cols' => 150))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 65535)))); $optionList = array(); $campaign = new Campaign(); $campaigns = $campaign->fetchAll(null, "id desc", null, null); foreach ($campaigns as $campaign) { $optionList[$campaign->id] = $campaign->name; } $optionList['0'] = $this->getView()->translate('ADMIN_NOT_AUTO_INVITATION'); $campaignId = new Zend_Form_Element_Select('campaignId'); $campaignId->setMultiOptions($optionList); $code_source = new Zend_Form_Element_Text('code_source'); $code_source->addFilter('StringTrim'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($this->getView()->translate('INVITATION_MAIL_SEND')); $this->addElements(array($emailCategory, $emailList, $subject, $message, $campaignId, $code_source, $submit)); }
public function __construct($path) { parent::__construct($path); $formfield = new App_Form_Field(); $accountHeader = $formfield->field('Text', 'accountHeader', '', '', 'txt_put', '', true, '', '', '', '', '', '', ''); $glcodeDescription = new Zend_Form_Element_Textarea('glcodeDescription', array('rows' => 3, 'cols' => 25)); $glcodeDescription->setAttrib('id', 'glcodeDescription'); $glcodeDescription->setRequired(true)->addValidators(array(array('NotEmpty'))); $product = $formfield->field('Select', 'product', '', '', 'txt_put', '', true, '', '', '', '', '', '', ''); $product->setAttrib('onchange', 'getGlcode("' . $path . '",this.value)'); $offerproduct = $formfield->field('Select', 'offerproduct', '', '', 'txt_put', '', '', '', '', '', '', '', '', ''); $officelevel = $formfield->field('Select', 'officelevel', '', '', '', '', '', '', '', '', '', '', 0, 0); $officelevel->setRegisterInArrayValidator(false); $officelevel->setAttrib('onchange', 'getoffice("' . $path . '",this.value)'); $office = $formfield->field('Select', 'office', '', '', '', '', '', '', '', '', '', '', 0, 0); $office->setRegisterInArrayValidator(false); $subheader = $formfield->field('Text', 'subheader', '', '', 'txt_put', '', '', '', '', '', '', '', '', ''); $glsubaccountdescription = new Zend_Form_Element_Textarea('glsubaccountdescription', array('rows' => 3, 'cols' => 25)); $glsubaccountdescription->setAttrib('id', 'glsubaccountdescription'); $submit = $formfield->field('Submit', 'Save', '', '', '', 'holiday1', '', '', '', '', '', '', '', ''); $this->addElements(array($submit, $accountHeader, $glcodeDescription, $subheader, $glsubaccountdescription, $product, $offerproduct, $officelevel, $office)); $glcodeHiddenId = new Zend_Form_Element_Hidden('hidden_glcodeid'); $glsubcodeHiddenId = new Zend_Form_Element_Hidden('hidden_glsubcodeid'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('class', 'holiday'); $this->addElements(array($submit, $glcodeHiddenId, $glsubcodeHiddenId)); }
public function __construct($options = null) { parent::__construct($options); $translate = Zend_Registry::get('Zend_Translate'); $language = $translate->getLocale(); $baseurl = Zend_Controller_Front::getInstance()->getBaseUrl(); $actionUrl = $baseurl . '/' . $language . '/account/fetchpassword'; $this->setName('fetchpassword_form'); $this->setAction($actionUrl); $this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator'); $mailvalid = new Zend_Validate_EmailAddress(); $mailvalid->setMessage('email-invalid', Zend_Validate_EmailAddress::INVALID); $mailvalid->setMessage('email-invalid-hostname', Zend_Validate_EmailAddress::INVALID_HOSTNAME); $mailvalid->setMessage('email-invalid-mx-record', Zend_Validate_EmailAddress::INVALID_MX_RECORD); $mailvalid->setMessage('email-dot-atom', Zend_Validate_EmailAddress::DOT_ATOM); $mailvalid->setMessage('email-quoted-string', Zend_Validate_EmailAddress::QUOTED_STRING); $mailvalid->setMessage('email-invalid-local-part', Zend_Validate_EmailAddress::INVALID_LOCAL_PART); $mailvalid->setMessage('email-length-exceeded', Zend_Validate_EmailAddress::LENGTH_EXCEEDED); $mailvalid->hostnameValidator->setMessage('hostname-invalid-hostname', Zend_Validate_Hostname::INVALID_HOSTNAME); $mailvalid->hostnameValidator->setMessage('hostname-local-name-not-allowed', Zend_Validate_Hostname::LOCAL_NAME_NOT_ALLOWED); $mailvalid->hostnameValidator->setMessage('hostname-unknown-tld', Zend_Validate_Hostname::UNKNOWN_TLD); $mailvalid->hostnameValidator->setMessage('hostname-invalid-local-name', Zend_Validate_Hostname::INVALID_LOCAL_NAME); $mailvalid->hostnameValidator->setMessage('hostname-undecipherable-tld', Zend_Validate_Hostname::UNDECIPHERABLE_TLD); // Username input form element $username = new Zend_Form_Element_Text('email'); $username->setLabel($translate->_("account-fetchpassword-email"))->removeDecorator('DtDdWrapper')->addFilter('StringtoLower')->setRequired(true)->addValidators(array($mailvalid))->setDecorators(array('FetchPasswordDecorator')); $hidden = new Zend_Form_Element_Hidden('submittedform'); $hidden->setValue('fetchpassword'); // Form submit buttom element $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($translate->_("account-fetchpassword-submit"))->removeDecorator('DtDdWrapper')->setAttrib('class', 'fetchpassword-submit left'); // Add elements to form $this->addElements(array($username, $submit, $hidden)); }
public function __construct($options = null) { parent::__construct($options); $resendemail = new Zend_Form_Element_Text('resendemail'); $resendemail->setLabel($this->getView()->translate('To'))->addFilter('StripTags')->addFilter('StringTrim')->addValidator('EmailAddress'); $max_amount = isset($options['max_amount']) ? $options['max_amount'] : 50; for ($i = 1; $i <= $max_amount; $i++) { $varName = 'email' . $i; ${$varName} = new Zend_Form_Element_Text('email' . $i); ${$varName}->addFilter('StripTags')->addFilter('StringTrim')->addValidator('EmailAddress'); if ($i == $max_amount) { ${$varName}->setAttrib("style", "width:75%"); } } $subject = new Zend_Form_Element_Text('subject'); $subject->setAttribs(array("disabled" => 'disabled'))->addFilter('StringTrim'); $subject->setAttrib("style", "width:75%"); $message = new Zend_Form_Element_Textarea('message'); $message->setAttribs(array('rows' => 5, 'cols' => 100))->addFilter('StripTags')->addFilter('StringTrim')->addValidators(array(array('StringLength', false, array(0, 500)))); $message->setAttrib("style", "width:75%"); $sentMailAmount = new Zend_Form_Element_Hidden('sentMailAmount'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($this->getView()->translate('INVITATION_MAIL_SEND')); $this->addElements(array($resendemail, $sentMailAmount, $subject, $message, $submit)); for ($i = 1; $i <= $max_amount; $i++) { $varName = 'email' . $i; $this->addElement(${$varName}); } }
function __construct($user) { parent::__construct(); $this->setName('Registration'); $this->setMethod('POST'); $this->setAction('/user/update'); $gender = new Zend_Form_Element_Select('gender'); $gender->setLabel('Gender'); $gender->setMultiOptions(array('Male' => 'Male', 'Female' => 'Female')); $gender->setValue($user->gender); $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email'); $email->setValue($user->email); $email->setRequired(true); $email->addValidator('NotEmpty', true); $email->addValidator(new User_Models_Forms_Validators_EmailAddress(), true); $paymentEmail = new Zend_Form_Element_Text('paymentEmail'); $paymentEmail->setLabel('Payment Email'); $paymentEmail->setRequired(true); $paymentEmail->addValidator('NotEmpty', true); $paymentEmail->addValidator(new User_Models_Forms_Validators_EmailAddress(), true); $paymentEmail->setValue($user->paymentEmail); $countries = new Zend_Form_Element_Select('country'); $countries->setMultiOptions(self::getCountries()); $countries->setLabel('Country'); $countries->addValidator('NotEmpty'); $countries->setValue($user->country); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Update'); $this->addElements(array($gender, $email, $paymentEmail, $countries, $submit)); }
public function __construct($option = null) { parent::__construct($option); $this->setName('register'); $this->setAttrib('class', 'input-group'); $username = new Zend_Form_Element_Text('username'); $username->setRequired(true)->setAttrib('class', "form-control")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_StringLength(4, 20))->addValidator('regex', true, array('/^[(a-zA-Z0-9)]+$/'))->setAttrib('placeholder', "Хэрэглэгчийн нэр")->addValidator('Db_NoRecordExists', true, array('table' => 'users', 'field' => 'username'))->setLabel("Дүн.мн хэрэглэгчийн бүртгүүлэх хэсэг"); $password = new Zend_Form_Element_Password('password'); $password->setRequired(true)->setAttrib('placeholder', "Нууц үг")->setAttrib('class', "form-control")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_StringLength(8, 20)); $confirmPassword = new Zend_Form_Element_Password('confirm_password'); $confirmPassword->setAttrib('class', "form-control"); $token = Zend_Controller_Front::getInstance()->getRequest()->getPost('password'); $confirmPassword->setRequired(true)->setAttrib('placeholder', "Нууц үгээ давтана уу?")->setAttrib('class', "form-control")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_Identical(trim($token))); $firstname = new Zend_Form_Element_Text('firstname'); $firstname->setAttrib('placeholder', "Таны нэр")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control"); $lastname = new Zend_Form_Element_Text('lastname'); $lastname->setAttrib('placeholder', "Таны овог")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control"); $date = new Zend_Form_Element_Text('date'); $date->setAttrib('placeholder', "Төрсөн он сар өдөр (он-сар-өдөр)")->addFilter(new Zend_Filter_StringTrim())->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control"); $email = new Zend_Form_Element_Text('email'); $email->addFilters(array('StringTrim', 'StripTags'))->setAttrib('placeholder', "Таны цахим хаяг")->addValidator('EmailAddress', TRUE)->addValidator('Db_NoRecordExists', true, array('table' => 'users', 'field' => 'E-mail'))->addValidator(new Zend_Validate_NotEmpty())->setAttrib('class', "form-control"); $submit = new Zend_Form_Element_Submit('register'); $submit->setLabel('Бүртгүүлэх')->setAttrib('class', 'btn'); $this->addElement($username); $this->addElement($password); $this->addElement($confirmPassword); $this->addElement($firstname); $this->addElement($lastname); $this->addElement($date); $this->addElement($email); $this->addElement($submit); $this->setMethod('post'); }
public function __construct($minimumDeposit) { parent::__construct($minimumDeposit); $savings_amount = new Zend_Form_Element_Text('savings_amount'); $savings_amount->addValidators(array(array('Float'), array('GreaterThan', false, array($minimumDeposit - 0.0001, 'messages' => array('notGreaterThan' => 'Minimum Amount To open a savings account =' . $minimumDeposit))))); $savings_amount->setAttrib('class', 'txt_put'); $savings_amount->setAttrib('id', 'amount'); $savings_amount->setRequired(true); $savings_amount->setAttrib('onchange', 'calculateTotalAmount(this.value)'); $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname'); $memberfirstname->setAttrib('class', 'textfield'); $memberfirstname->setAttrib('id', 'selector'); // $memberfirstname->setRequired(true); $date1 = new ZendX_JQuery_Form_Element_DatePicker('date1', array('label' => 'Date:')); $date1->setAttrib('class', 'txt_put'); $date1->setJQueryParam('dateFormat', 'yy-mm-dd'); $date1->setRequired(true); $memberId = new Zend_Form_Element_Hidden('memberId'); $Type = new Zend_Form_Element_Hidden('Type'); $productId = new Zend_Form_Element_Hidden('productId'); $typeId = new Zend_Form_Element_Hidden('typeId'); $memberTypeIdv = new Zend_Form_Element_Hidden('memberTypeIdv'); $submit = new Zend_Form_Element_Submit('Submit'); $Yes = new Zend_Form_Element_Submit('Yes'); $back = new Zend_Form_Element_Submit('Back'); $this->addElements(array($submit, $savings_amount, $memberfirstname, $memberId, $date1, $productId, $typeId, $Type, $memberTypeIdv, $back, $Yes)); }
public function __construct(array $values = array(), $insert = false, $options = array()) { parent::__construct($options); $this->setName($insert ? 'addepisoderelease' : 'editepisoderelease')->setAction('#')->setMethod('post')->setAttrib('id', $insert ? 'addepisoderelease' : 'editepisoderelease'); # acodec $acodec = $this->createElement('text', 'acodec')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->addValidator('StringLength', false, array('min' => 3, 'max' => 10, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'default_form_error_length', Zend_Validate_StringLength::TOO_SHORT => 'default_form_error_length')))->setRequired(true)->setValue(isset($values['acodec']) ? $values['acodec'] : null)->setLabel('project_admin_field_episode_acodec'); # container $container = $this->createElement('text', 'container')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->addValidator('StringLength', false, array('min' => 3, 'max' => 10, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'default_form_error_length', Zend_Validate_StringLength::TOO_SHORT => 'default_form_error_length')))->setRequired(true)->setValue(isset($values['container']) ? $values['container'] : null)->setLabel('project_admin_field_episode_container'); # vcodec $vcodec = $this->createElement('text', 'vcodec')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->addValidator('StringLength', false, array('min' => 4, 'max' => 10, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'default_form_error_length', Zend_Validate_StringLength::TOO_SHORT => 'default_form_error_length')))->setRequired(true)->setValue(isset($values['vcodec']) ? $values['vcodec'] : null)->setLabel('project_admin_field_episode_vcodec'); # crc $crc = $this->createElement('text', 'crc')->addFilter('stringToUpper')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'default_form_error_empty_value')))->addValidator('Hex', false, array('messages' => array(Zend_Validate_Hex::NOT_HEX => 'project_episode_form_error_crc_hex')))->addValidator('StringLength', false, array('min' => 8, 'max' => 8, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'project_episode_form_error_crc_length', Zend_Validate_StringLength::TOO_SHORT => 'project_episode_form_error_crc_length')))->setRequired(true)->setValue(isset($values['crc']) ? $values['crc'] : '00000000')->setLabel('project_admin_field_episode_crc'); # released if (isset($values['released_at'])) { if (empty($values['released_at'])) { $released = 'no'; } else { $released = 'yes'; } } else { $released = 'no'; } $released = $this->createElement('radio', 'released')->setMultiOptions(array('yes' => 'yes_term', 'no' => 'no_term'))->setLabel('project_admin_field_episode_released')->setValue($released); # release date $envConf = Zend_Registry::get('environmentSettings'); $time = empty($values['released_at']) ? time() : strtotime($values['released_at']); $date = new Zend_Date($time, null, $envConf->locale); $releaseDate = $this->createElement('text', 'releasedate')->setValue($date->toString(Zend_Date::DATE_SHORT))->setLabel('project_admin_field_episode_release_date'); $iso = $this->createElement('hidden', 'isoDate')->setValue(isset($values['released_at']) ? $values['released_at'] : null); # add elements to the form $this->addElement($container)->addElement($vcodec)->addElement($acodec)->addElement($crc)->addElement($released)->addElement($releaseDate)->addElement($iso)->addElement('submit', $insert ? 'add' : 'update', array('label' => $insert ? 'add' : 'update', 'class' => 'button')); }
public function __construct($options = null) { parent::__construct($options); $this->setName('WhatIDoForm'); // image, uploader $image = new Zend_Form_Element_File('Image'); $image->setLabel('Image:')->setDestination('img/profile')->addValidator('Count', false, 1)->addValidator('Size', false, 10000000)->addValidator('Extension', false, 'jpg,png,gif')->addFilter('Rename', 'WhatIDo.jpg'); // PictureCaption, string $pictureCaption = new Zend_Form_Element_Textarea('PictureCaption'); $pictureCaption->setLabel('Picture caption:')->setRequired(); // MainText, string $mainText = new Zend_Form_Element_Textarea('MainText'); $mainText->setLabel('Main text:')->setRequired(); // FooterText, string $footerText = new Zend_Form_Element_Textarea('FooterText'); $footerText->setLabel('Footer text:')->setRequired(); // LinkText, string $linkText = new Zend_Form_Element_Text('LinkText'); $linkText->setLabel('Link text:')->setRequired(); // LinkUrl, string $linkUrl = new Zend_Form_Element_Text('LinkUrl'); $linkUrl->setLabel('Link Url:')->setRequired(); // Submit button $submit = new Zend_Form_Element_Submit('Submit'); $submit->setLabel('Submit'); $this->addElements(array($image, $pictureCaption, $mainText, $footerText, $linkText, $linkUrl, $submit)); }
/** * * @param array $options Options to build the form */ public function __construct($options = null) { parent::__construct($options); // Title $title = new Zend_Form_Element_Text('FSI_Title'); $title->setLabel($this->getView()->getCibleText('form_section_title_label') . " <span class='field_required'>*</span>")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'section_title_edit', 'id' => 'title'))))->setAttrib('class', 'stdTextInput'); $this->addElement($title); // Show title $showTitle = new Zend_Form_Element_Checkbox('FS_ShowTitle'); $showTitle->setLabel($this->getView()->getCibleText('form_section_showtitle_label')); $showTitle->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($showTitle); // Repeat section $repeat = new Zend_Form_Element_Checkbox('FS_Repeat'); $repeat->setLabel($this->getView()->getCibleText('form_label_has_profil')); $repeat->setDecorators(array('ViewHelper', array('label', array('placement' => 'append')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'label_after_checkbox')))); $this->addElement($repeat); // Repeat min $repeatMin = new Zend_Form_Element_Text('FS_RepeatMin'); $repeatMin->setLabel($this->getView()->getCibleText('form_section_repeatMin_label') . " <span class='field_required'>*</span>")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'section_RepeatMin'); $this->addElement($repeatMin); // Repeat max $repeatMax = new Zend_Form_Element_Text('FS_RepeatMax'); $repeatMax->setLabel($this->getView()->getCibleText('form_section_repeatMax_label') . " <span class='field_required'>*</span>")->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'section_RepeatMax'); $this->addElement($repeatMax); // Sequence - hidden input $sequence = new Zend_Form_Element_Hidden('FS_Seq'); $this->addElement($sequence); // page break - hiden input $pageBreak = new Zend_Form_Element_Hidden('FS_PageBreak'); $this->addElement($pageBreak); // Set the form id $this->setAttrib('id', 'section'); }
public function __construct($id, $subId) { parent::__construct($id); //record id parent::__construct($subId); //module id //create a contact details form elements $vtype = array('Digits'); $formfield = new App_Form_Field(); $contactPerson = $formfield->field('Text', 'contact_person', '', '', 'mand', 'Contact person', true, '', '', '', '', '', 1, 0); $contactPerson->setAttrib('maxlength', 30); $telephone = $formfield->field('Text', 'telephone', '', '', 'mand', 'Telephone number', true, $vtype, '', '', '', '', 1, 0); $telephone->setAttrib('maxlength', 12); $mobile = $formfield->field('Text', 'mobile', '', '', 'mand', 'mobile', true, $vtype, 1, 15, '', '', 1, 0); $mobile->setAttrib('maxlength', 10); $email = $formfield->field('Text', 'email', '', '', 'mand', 'Email', true, '', '', '', '', '', 1, 0); $email->addValidator('EmailAddress'); $email->addErrorMessage('Enter valid email address'); //hidden feilds $id = $formfield->field('Hidden', 'id', '', '', '', '', false, '', '', '', '', '', 0, $id); $subId = $formfield->field('Hidden', 'submodule_id', '', '', '', '', false, '', '', '', '', '', 0, $subId); $createdBy = $formfield->field('Hidden', 'created_by', '', '', '', '', false, '', '', '', '', '', 0, 1); $createdDate = $formfield->field('Hidden', 'created_date', '', '', '', '', false, '', '', '', '', '', 0, date("y/m/d H:i:s")); $recordstatusId = $formfield->field('Hidden', 'recordstatus_id', '', '', '', '', false, '', '', '', '', '', 0, 3); $this->addElements(array($id, $contactPerson, $telephone, $mobile, $email, $subId, $createdBy, $createdDate)); }
public function __construct($options = null) { parent::__construct($options); $translate = Zend_Registry::get('Zend_Translate'); $this->setName('registercomplete_form'); $this->setAttrib('id', 'registercomplete_form'); $this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator'); $this->addElementPrefixPath('Oibs_Validators', 'OIBS/Validators/', 'validate'); $this->removeDecorator('DtDdWrapper'); $firstname = new Zend_Form_Element_Text('firstname'); $firstname->setLabel($translate->_("account-register-firstname"))->setRequired(false)->removeDecorator('DtDdWrapper')->setAttrib('id', 'registercomplete_firstname')->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'registrationcomplete_firstname'))))->setDecorators(array('RegistercompleteDecorator')); $surname = new Zend_Form_Element_Text('surname'); $surname->setLabel($translate->_("account-register-surname"))->setRequired(false)->removeDecorator('DtDdWrapper')->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'registrationcomplete_surname'))))->setAttrib('id', 'registercomplete_surname')->setDecorators(array('RegistercompleteDecorator')); $image = new Zend_Form_Element_File('image'); $image->setLabel($translate->_("account-registercomplete-add-image"))->setDestination('../www/upload')->addValidator('Count', false, 1)->addValidator('Size', false, 25600)->addValidator('Extension', false, 'jpg,png,gif')->removeDecorator('DtDdWrapper')->setAttrib('id', 'registercomplete_image')->removeDecorator('DefaultDecorator')->addDecorator('HtmlTag', array('tag' => 'div', 'id' => 'form_registercomplete_image', 'style' => 'display:block'))->addDecorator('Label', array('tag' => 'div', 'id' => 'form_registercomplete_image_label', 'style' => 'display:block')); $bio = new Zend_Form_Element_Textarea('bio'); $bio->setLabel($translate->_("account-register-bio"))->setRequired(false)->removeDecorator('DtDdWrapper')->setAttrib('id', 'registercomplete_bio')->setAttribs(array("onkeydown" => "textCounter(this,'progressbar_bio',0,160," . $translate->getLocale() . ");", "onkeyup" => "textCounter(this,'progressbar_bio',0,160," . $translate->getLocale() . ");"))->setDescription($translate->_('account-register-bio-desc'))->setDecorators(array('RegistercompleteDecorator')); // $bio_counter here... $select_str = $translate->_("account-select"); $country = new Zend_Form_Element_Select('country'); $country->setLabel($translate->_("account-register-country"))->setRequired(false)->removeDecorator('DtDdWrapper')->setMultiOptions(array($select_str, 'fi' => 'Finland'))->setAttrib('id', 'registercomplete_country')->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'registrationcomplete_country'))))->setDecorators(array('RegistercompleteDecorator')); $deflang = new Zend_Form_Element_Select('deflang'); $deflang->setLabel($translate->_("account-register-deflang"))->setMultiOptions(array($select_str, 'en' => 'English', 'fi' => 'Finnish'))->addFilter('StringToLower')->setRequired(false)->removeDecorator('DtDdWrapper')->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'registrationcomplete_deflang'))))->setAttrib('id', 'registercomplete_deflang')->setDecorators(array('RegistercompleteDecorator')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($translate->_("account-register-submit"))->removeDecorator('DtDdWrapper')->setAttrib('id', 'registercomplete_submit')->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'registrationcomplete_submit_div'))))->setAttrib('class', 'registrationcomplete_form_submit_' . $translate->getLocale())->setAttrib('disabled', 'true'); $this->addElements(array($firstname, $surname, $image, $bio, $country, $deflang, $submit)); $this->setAttrib('enctype', 'multipart/form-data'); $this->addDisplayGroup(array('firstname', 'surname', 'image', 'bio', 'country', 'deflang', 'submit'), 'allFields'); $this->allFields->removeDecorator('DtDdWrapper'); $this->allFields->setLegend('register-confirmations'); }
/** * Constructor * * Registers form view helper as decorator * * @param mixed $options * @return void */ public function __construct($options = null) { parent::__construct($options); if (!isset($options['disableHash'])) { $this->addElement('hash', 'csrf'); } }
public function __construct($options = null) { parent::__construct(); $this->setMethod('post'); $this->setEnctype('multipart/form-data'); //$this->setAction(''); $this->setName('custom_layout_advanced_form'); $this->addElementPrefixPath('Oibs_Form_Decorator', 'Oibs/Form/Decorator/', 'decorator'); $clearall = new Oibs_Form_Element_Note('clearall'); $clearall->setValue('<div style="clear:both;"></div>'); $csstextarea = new Zend_Form_Element_Textarea('csscontent'); $csstextarea->setLabel('Editable custom layout css for advanced users')->setAttrib('id', 'css_textarea')->setAttrib('style', 'width: 575px; height: 660px; margin-left: -5px; margin-right: 10px; margin-bottom: 10px;')->setValue($options['cssContent'])->addDecorator('Label', array('tag' => 'div', 'style' => '/*font-weight:bold;*/ float:left; margin-top:6px'))->addValidators(array(array('StringLength', false))); $savecssbutton = new Zend_Form_Element_Submit('save_css_button'); $savecssbutton->setLabel('Save')->setAttrib('style', 'width:60px; float:right;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper'); $cancelcssbutton = new Zend_Form_Element_Button('cancel_css_button'); $cancelcssbutton->setLabel('Cancel')->setAttrib('style', 'width:60px; float:right; margin-right:10px')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper'); $defaultcssbutton = new Zend_Form_Element_Button('default_css_button'); $defaultcssbutton->setLabel('Default')->setAttrib('style', 'width:80px; float:left; margin-left: 10px; margin-top:-17px;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper'); $restorecssbutton = new Zend_Form_Element_Button('restore_css_button'); $restorecssbutton->setLabel('Restore')->setAttrib('style', 'width:80px; float:left; margin-left: -5px; margin-top:-17px;')->removeDecorator('DefaultDecorator')->removeDecorator('DtDdWrapper'); $defaultcsshidden = new Zend_Form_Element_Hidden('default_css'); $defaultcsshidden->setAttrib('id', 'default_css')->setValue($options['default_css']); $originalcsshidden = new Zend_Form_Element_Hidden('original_css'); $originalcsshidden->setAttrib('id', 'original_css')->setValue($options['cssContent']); $advancedhelp = new Oibs_Form_Element_Note('help_link_advanced'); $advancedhelp->setValue('<a href="#" onClick="return false;">Help</a>'); $this->addElements(array($csstextarea, $savecssbutton, $cancelcssbutton, $advancedhelp, $restorecssbutton, $defaultcssbutton, $defaultcsshidden, $originalcsshidden)); // Add decorators $this->setDecorators(array('FormElements', 'Form')); }
public function __construct($options = null) { $this->_localeLanguageTable = new Application_Model_DbTable_Locale_Language(); parent::__construct($options); $this->addElements($this->_buildTranslateFields()); $this->addElements($this->_buildElements()); }
public function __construct($options = null) { parent::__construct($options); $translate = Zend_Registry::get('Zend_Translate'); $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); $this->setDisableLoadDefaultDecorators(true); $this->addDecorator('FormElements')->addDecorator('HtmlTag', array('tag' => 'div'))->addDecorator('Form')->removeDecorator('DtDdWrapper'); $this->setName('preview_content_form'); //$this->setAction($baseUrl.'/'.$lang.'/content/add/'.$contentType); $this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator'); $this->setAttrib('enctype', 'multipart/form-data'); // Form buttons $publish = new Zend_Form_Element_Submit('content_publish'); $publish->setLabel($translate->_("content-add-publish"))->removeDecorator('DtDdWrapper'); $save = new Zend_Form_Element_Submit('content_save'); $save->setLabel($translate->_("content-add-save"))->removeDecorator('DtDdWrapper'); $edit = new Zend_Form_Element_Submit('content_edit'); $edit->setLabel($translate->_("content-add-edit"))->setAttrib('style', 'margin-left: 10px;')->setAttrib('onclick', 'generatePreview(); return false;')->removeDecorator('DtDdWrapper'); // Set custom form layout /* $this->setDecorators(array(array('ViewScript', array( 'viewScript' => 'forms/contentAddForm.phtml', 'placement' => false ))));*/ // Add generic elements to form $this->addElements(array($edit)); }
public function __construct($options = null) { parent::__construct($options); $accountId1 = new Zend_Form_Element_Hidden('accountId'); $productId1 = new Zend_Form_Element_Hidden('productId'); $memberId1 = new Zend_Form_Element_Hidden('memberId'); $maturedamount = new Zend_Form_Element_Hidden('maturedinterestamount'); $interestamountto = new Zend_Form_Element_Hidden('interestamountto'); $capitalamount = new Zend_Form_Element_Hidden('capitalamount'); $penalinterest = new Zend_Form_Element_Hidden('penalinterest'); $paymenttype = new Zend_Form_Element_Select('paymenttype'); $paymenttype->addMultiOption('', 'select..'); $paymenttype->setAttrib('class', 'NormalBtn'); $paymenttype->setAttrib('id', 'paymenttype'); $paymenttype->setAttrib('onchange', 'toggleField();'); $paymenttype->setRequired(true); $description = new Zend_Form_Element_Textarea('transactiondescription'); $description->setAttrib('class', 'textfield'); $description->setAttrib('rows', '2'); $description->setAttrib('cols', '20'); $no = new Zend_Form_Element_Textarea('paymenttype_details'); $no->setAttrib('class', 'textfield'); $no->setAttrib('rows', '1'); $no->setAttrib('cols', '20'); $no->setAttrib('id', 'paymenttype_details'); $no->setAttrib('style', 'display:none;'); $no->setRequired(true); $submit = new Zend_Form_Element_Submit('Finalize'); $submit->setLabel('Finalize'); $submit->setAttrib('class', 'recurring'); $this->addElements(array($accountId1, $productId1, $memberId1, $maturedamount, $submit, $capitalamount, $interestamountto, $penalinterest, $paymenttype, $description, $no)); }
public function __construct($id, $subId) { parent::__construct($id, $subId); $formfield = new App_Form_Field(); $cropId = new Zend_Form_Element_Select('crop_id[]'); $cropId->setAttrib('class', 'txt_put'); $cropId->setAttrib('id', 'crop_id[]'); $season = new Zend_Form_Element_Select('season[]'); $season->setAttrib('class', 'txt_put'); $season->setAttrib('id', 'crop_id[]'); // $cropId = $formfield->field('Select','crop_id[]','','','','',true,'','','','','',0,0); $acre = $formfield->field('Text', 'acre[]', '', '', '', '', true, '', '', '', '', '', 0, 0); $acre->setAttrib('size', 8); $quantity = $formfield->field('Text', 'quantity[]', '', '', '', '', true, '', '', '', '', '', 0, 0); $quantity->setAttrib('size', 12); $marketed = $formfield->field('Text', 'marketed[]', '', '', '', '', true, '', '', '', '', '', 0, 0); $marketed->setAttrib('size', 12); $price = $formfield->field('Text', 'price[]', '', '', '', '', true, '', '', '', '', '', 0, 0); //hidden feilds $id = $formfield->field('Hidden', 'id[]', '', '', '', '', false, '', '', '', '', '', 0, $id); $subId = $formfield->field('Hidden', 'submodule_id[]', '', '', '', '', false, '', '', '', '', '', 0, $subId); $createdBy = $formfield->field('Hidden', 'created_by[]', '', '', '', '', false, '', '', '', '', '', 0, 1); $createdDate = $formfield->field('Hidden', 'created_date[]', '', '', '', '', false, '', '', '', '', '', 0, date("y/m/d H:i:s")); $crpid = $formfield->field('Hidden', 'crpid[]', '', '', '', '', '', '', '', '', '', '', 0, 0); $this->addElements(array($id, $cropId, $acre, $quantity, $marketed, $price, $subId, $createdBy, $createdDate, $crpid, $season)); }
public function __construct() { parent::__construct(); $valiAlphaWhiteSpace = new Zend_Validate_Alpha(true); $valiAlnumWhiteSpace = new Zend_Validate_Alnum(true); // $this->addElement('text', Expertise::COL_SPECIES, array('label'=>'Species:', // 'required'=>true, // 'validators'=>array($valiAlphaWhiteSpace))); $speciesSelect = new Default_Form_Element_ValuelistSelect(605, Expertise::COL_SPECIES, array('label' => 'Species:', 'required' => true)); $this->addElement($speciesSelect); $this->addElement('text', Expertise::COL_AREA, array('label' => 'Area:', 'required' => true, 'validators' => array($valiAlnumWhiteSpace))); // $subjectSelect = new Zend_Form_Element_Select(Expertise::COL_SUBJECT); // $subjectSelect->setLabel('Subject:'); // $subjectSelect->setRequired(true); // $subjectSelect->setMultiOptions(array(null=>'Please select', // 'otolith'=>'otolith', // 'gonade'=>'gonade')); // $this->addElement($subjectSelect); $subjectSelect = new Default_Form_Element_ValuelistSelect(606, Expertise::COL_SUBJECT, array('label' => 'Type of structure:', 'required' => true)); $this->addElement($subjectSelect); $this->addElement('submit', 'save', array('label' => 'Save')); $this->addElement('submit', 'cancel', array('label' => 'Cancel')); //#####################new################################### $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'login_form')), array('Description', array('placement' => 'prepend')), 'Form')); $this->setElementDecorators(array('ViewHelper', 'Errors', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr')))); //########################################################### }
public function __construct($options = null) { Zend_Dojo::enableForm($this); parent::__construct($options); $category_id = new Zend_Form_Element_Select('category_id'); $category_id->addMultiOption('', 'Select...'); $category_id->setAttrib('class', 'txt_put')->setLabel('Category Name'); $category_id->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $productname = new Zend_Form_Element_Text('productname'); $productname->addValidator(new Zend_Validate_Db_NoRecordExists('ourbank_productdetails', 'productname')); $productname->setAttrib('class', 'txt_put')->setLabel('Product Name'); $productname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $product_id = new Zend_Form_Element_Hidden('product_id'); $product_id->setAttrib('class', 'txt_put'); $productshortname = new Zend_Form_Element_Text('productshortname'); $productshortname->setAttrib('class', 'txt_put')->setLabel('Product Short Name'); $productshortname->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $product_description = new Zend_Form_Element_Textarea('product_description', array('rows' => 3, 'cols' => 20)); $product_description->setAttrib('class', '')->setLabel('Productdescription'); $product_description->setRequired(true)->addValidators(array(array('NotEmpty')))->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setAttrib('id', 'save')->setDecorators(array('ViewHelper', array('Description', array('tag' => '', 'escape' => false)), 'Errors', array(array('data' => 'HtmlTag'), array('colspan' => '8 ')), array(array('data' => 'HtmlTag'), array('tag' => 'td ', 'colspan' => '8')), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))); $this->addElements(array($category_id, $productname, $productshortname, $product_description, $product_id, $submit)); $this->setDecorators(array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'table', 'id' => 'hor-minimalist-b')), 'Form')); }
public function __construct($parent = null, $options = null) { parent::__construct($options); $parentId = 0; if ($parent != null) { $parentId = $parent; } $translate = Zend_Registry::get('Zend_Translate'); $this->setName('comment_form'); $this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator'); /* $comment_subject = new Zend_Form_Element_Text('comment_subject'); $comment_subject->setLabel($translate->_("content-view-comment-form-subject")) ->setRequired(true) ->setAttribs(array( 'class' => 'comment_subject')) ->addValidators(array( array('NotEmpty', true, array('messages' => array('isEmpty' => 'Tyhjä'))) )); */ $comment_message = new Zend_Form_Element_Textarea('comment_message'); $comment_message->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 58, 'class' => 'comment_textarea'))->addValidators(array(array('NotEmpty', true, array('messages' => array('isEmpty' => 'Tyhjä'))))); $comment_parent = new Zend_Form_Element_Hidden('comment_parent'); $comment_parent->setValue($parentId)->setAttribs(array('class' => 'comment_subject')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($translate->_("submit")); $parent_username = new Zend_Form_Element_Hidden('parent_username'); $this->addElements(array($comment_message, $comment_parent, $submit, $parent_username)); }
public function __construct($options = null) { parent::__construct($options); parent::__construct(); $account_id = new Zend_Form_Element_Hidden('accountId'); $product_id = new Zend_Form_Element_Hidden('productId'); $newStatus = new Zend_Form_Element_Select('newStatus'); $newStatus->setAttrib('class', 'NormalBtn'); $newStatus->setRequired(true); $newStatus->addMultiOption('', 'Select...'); $description = new Zend_Form_Element_Textarea('description'); $description->setAttrib('class', 'textfield'); $description->setAttrib('rows', '2'); $description->setAttrib('cols', '20'); $description->setRequired(true); $newStatus1 = new Zend_Form_Element_Hidden('newStatus1'); $description1 = new Zend_Form_Element_Hidden('description1'); $submit = new Zend_Form_Element_Submit('Submit'); $submit->setLabel('submit'); $submit->setAttrib('class', 'recurring'); $Confirm = new Zend_Form_Element_Submit('Confirm'); $Confirm->setLabel('Confirm'); $Confirm->setAttrib('class', 'recurring'); $this->addElements(array($submit, $description, $newStatus, $account_id, $product_id, $Confirm, $newStatus1, $description1)); }
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)); }
public function __construct($accNum) { parent::__construct($accNum); $date = new ZendX_JQuery_Form_Element_DatePicker('date'); $date->setAttrib('class', 'txt_put'); $date->setJQueryParam('dateFormat', 'yy-mm-dd'); $date->setRequired(true); $date->setAttrib('size', 12); $date1 = new ZendX_JQuery_Form_Element_DatePicker('date1'); $date1->setAttrib('class', 'txt_put'); $date1->setJQueryParam('dateFormat', 'yy-mm-dd'); $date1->setRequired(true); $date1->setAttrib('size', 12); //$fieldtype,$fieldname,$table,$columnname,$cssname,$labelname,$required,$validationtype,$min,$max,$rows,$cols,$decorator,$value $formfield = new App_Form_Field(); $amount = $formfield->field('Text', 'amount', '', '', 'txt_put', '', true, '', '', '', '', '', 0, ''); $graterthan = new Zend_Validate_GreaterThan(0); $amount->setRequired(true)->addValidators(array(array('NotEmpty'), array('Float'), array($graterthan, true))); $amount->setAttrib('size', 12); $description = $formfield->field('Textarea', 'description', '', '', 'txt_put', '', true, '', '', '', 2, 15, '', 0, ''); $transactionMode = $formfield->field('Select', 'transactionMode', '', '', 'txt_put', '', true, '', '', '', '', '', 0, ''); // hidden feilds $accNum = $formfield->field('Hidden', 'accNum', '', '', 'txt_put', '', true, '', '', '', '', '', 0, $accNum); $sms = new Zend_Form_Element_Checkbox('sms'); $back = new Zend_Form_Element_Submit('Back'); $submit = new Zend_Form_Element_Submit('Submit'); $this->addElements(array($date, $amount, $transactionMode, $description, $submit, $accNum, $back, $sms, $date1)); }