protected function addProviderElements()
 {
     $this->setDescription('Unicorn Distribution Profile');
     $element = new Zend_Form_Element_Hidden('providerElements');
     $element->setLabel('Unicorn Specific Configuration');
     $element->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
     $this->addElements(array($element));
     $this->addElement('text', 'api_host_url', array('label' => 'API host URL:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'username', array('label' => 'Username:'******'filters' => array('StringTrim')));
     $this->addElement('text', 'password', array('label' => 'Password:'******'filters' => array('StringTrim')));
     $this->addElement('text', 'domain_name', array('label' => 'Domain name:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'domain_guid', array('label' => 'Domain GUID:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'channel_guid', array('label' => 'Channel GUID:', 'filters' => array('StringTrim')));
     $this->addElement('text', 'ad_free_application_guid', array('label' => 'Ad free application GUID:', 'filters' => array('StringTrim')));
     $this->addElement('select', 'remote_asset_params_id', array('label' => 'Remote asset params ID:', 'registerInArrayValidator' => false));
     $storageProfiles = array();
     try {
         $client = Infra_ClientHelper::getClient();
         Infra_ClientHelper::impersonate($this->partnerId);
         $storageProfileList = $client->storageProfile->listAction();
         Infra_ClientHelper::unimpersonate();
         foreach ($storageProfileList->objects as $storageProfile) {
             /* @var $storageProfile Kaltura_Client_Type_StorageProfile */
             $storageProfiles[$storageProfile->id] = $storageProfile->name;
         }
     } catch (Kaltura_Client_Exception $e) {
     }
     $this->addElement('select', 'storage_profile_id', array('label' => 'Storage profile ID:', 'multiOptions' => $storageProfiles));
 }
예제 #2
0
 public function init()
 {
     $this->setName('shipping_address');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $customerid = new Zend_Form_Element_Hidden('customerid');
     $customerid->addFilter('Int');
     $address1 = new Zend_Form_Element_Text('shipping_address1');
     $address1->setLabel('Street Address')->setAttrib('id', 'address1')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $address2 = new Zend_Form_Element_Text('shipping_address2');
     $address2->setLabel('')->setAttrib('id', 'address2')->addFilter('StripTags')->addFilter('StringTrim');
     $address3 = new Zend_Form_Element_Text('shipping_address3');
     $address3->setLabel('')->setAttrib('id', 'address3')->addFilter('StripTags')->addFilter('StringTrim');
     $postcode = new Zend_Form_Element_Text('shipping_postcode');
     $postcode->setLabel('Postcode')->setAttrib('id', 'postcode')->addFilter('StripTags')->addFilter('StringTrim');
     $country = new Zend_Form_Element_Text('shipping_country');
     $country->setLabel('Country')->setAttrib('id', 'country')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $city = new Zend_Form_Element_Text('shipping_city');
     $city->setLabel('City')->setAttrib('id', 'city')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $phone = new Zend_Form_Element_Text('shipping_phone');
     $phone->setLabel('Phone')->setAttrib('id', 'phone')->addFilter('StripTags')->addFilter('StringTrim');
     $fax = new Zend_Form_Element_Text('shipping_fax');
     $fax->setLabel('Fax')->setAttrib('id', 'fax')->addFilter('StripTags')->addFilter('StringTrim');
     $email = new Zend_Form_Element_Text('shipping_email');
     $email->setLabel('E-Mail')->setAttrib('id', 'email')->addFilter('StripTags')->addFilter('StringTrim');
     $internet = new Zend_Form_Element_Text('shipping_internet');
     $internet->setLabel('Internet')->setAttrib('id', 'internet')->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Button('shipping_submit');
     $submit->setAttrib('onclick', 'addAddress()');
     $this->addElements(array($id, $customerid, $address1, $address2, $address3, $postcode, $city, $country, $phone, $fax, $email, $internet, $submit));
 }
예제 #3
0
 public function init()
 {
     // init the parent
     parent::init();
     // set the form's method
     $this->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->setOptions(array('validators' => array(new Zend_Validate_Regex('/^\\d*$/'))));
     $this->addElement($id);
     $firstname = new Zend_Form_Element_Text('firstname');
     $firstname->setOptions(array('label' => $this->t('First name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($firstname);
     $lastname = new Zend_Form_Element_Text('lastname');
     $lastname->setOptions(array('label' => $this->t('Last name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($lastname);
     $checkEmailNotJunk = new Zend_Validate_Callback(array($this, 'emailNotJetable'));
     $uniqueEmailValidator = new Zend_Validate_Db_NoRecordExists(array('table' => 'backoffice_users', 'field' => 'email'));
     $email = new Zend_Form_Element_Text('email');
     $email->setOptions(array('label' => $this->t('Email'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', $checkEmailNotJunk, $uniqueEmailValidator)));
     $this->addElement($email);
     $raisonsocial = new Zend_Form_Element_Text('raison sociale');
     $raisonsocial->setOptions(array('label' => $this->t('Raison sociale'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($raisonsocial);
     //        $groupsInArrayValidator = new Zend_Validate_InArray(array_keys(array(1, 2, 3)));
     //        $groupsInArrayValidator->setMessage('Please select at least one group. If you are not sure about which group is better, select "member".');
     $status = new Zend_Form_Element_Radio('status');
     $status->setOptions(array('label' => $this->t('Status'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty'), 'multiOptions' => array('Gérant' => 'Gérant', 'Associé' => 'Associé', 'Freelance patenté' => 'Freelance patenté')));
     $this->addElement($status);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOptions(array('label' => $this->t('Save user'), 'required' => true, 'order' => 100));
     $this->addElement($submit);
 }
예제 #4
0
 public function init()
 {
     $this->setAttrib('id', 'frmDrmProfileConfigure');
     $this->setMethod('post');
     $titleElement = new Zend_Form_Element_Hidden('generalTitle');
     $titleElement->setLabel('General');
     $titleElement->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
     $this->addElement($titleElement);
     $this->addElement('text', 'id', array('label' => 'ID:', 'filters' => array('StringTrim'), 'readonly' => true, 'disabled' => 'disabled'));
     $this->addElement('text', 'partnerId', array('label' => 'Related Publisher ID:', 'required' => true, 'filters' => array('StringTrim'), 'placement' => 'prepend', 'readonly' => true));
     $this->addElement('text', 'name', array('label' => 'Drm Profile Name:', 'required' => true, 'filters' => array('StringTrim'), 'placement' => 'prepend'));
     $this->addElement('text', 'description', array('label' => 'Description:', 'required' => false, 'filters' => array('StringTrim')));
     $providerForView = new Kaltura_Form_Element_EnumSelect('typeForView', array('enum' => 'Kaltura_Client_Drm_Enum_DrmProviderType'));
     $providerForView->setLabel('Provider:');
     $providerForView->setAttrib('readonly', true);
     $providerForView->setAttrib('disabled', 'disabled');
     $providerForView->setValue($this->drmProfileProvider);
     $this->addElement($providerForView);
     $this->addElement('hidden', 'provider', array('filters' => array('StringTrim'), 'decorators' => array('ViewHelper'), 'value' => $this->drmProfileProvider));
     $this->addElement('hidden', 'crossLine1', array('decorators' => array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'hr', 'class' => 'crossLine')))));
     $titleElement = new Zend_Form_Element_Hidden('detailsTitle');
     $titleElement->setLabel('Details');
     $titleElement->setDecorators(array('ViewHelper', array('Label', array('placement' => 'append')), array('HtmlTag', array('tag' => 'b'))));
     $this->addElement($titleElement);
     $this->addElement('text', 'licenseServerUrl', array('label' => 'License Server Url', 'required' => false, 'filters' => array('StringTrim')));
     // --------------------------------
     $extendTypeSubForm = KalturaPluginManager::loadObject('Form_DrmProfileConfigureExtend_SubForm', $this->drmProfileProvider);
     if ($extendTypeSubForm) {
         $extendTypeSubForm->setDecorators(array('FormElements'));
         $this->addSubForm($extendTypeSubForm, self::EXTENSION_SUBFORM_NAME);
     }
     //------------------------------------
 }
예제 #5
0
파일: CommentForm.php 프로젝트: jannev/site
 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));
 }
예제 #6
0
 protected function _id_encontro()
 {
     $e = new Zend_Form_Element_Hidden('id_encontro');
     $e->addFilter('Int');
     $e->setDecorators(array('ViewHelper', 'Description', 'Errors', array('HtmlTag', ''), array('Label', '')));
     return $e;
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('comments');
     $commentType = new Zend_Form_Element_Hidden('comment_type');
     $commentType->addFilters(array('StripTags', 'StringTrim'));
     $comment_findID = new Zend_Form_Element_Hidden('contentID');
     $comment_findID->addFilters(array('StripTags', 'StringTrim'));
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid name!');
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_author_url = new Zend_Form_Element_Text('comment_author_url');
     $comment_author_url->setLabel('Enter your web address: ')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->addValidator('Url')->setDescription('* Not compulsory');
     $comment_content = new Pas_Form_Element_CKEditor('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $status = new Zend_Form_Element_Radio('commentStatus');
     $status->setLabel('Message status:')->addMultiOptions(array('isspam' => 'Set as spam', 'isham' => 'Submit ham?', 'notspam' => 'Spam free'))->setValue('notSpam')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $commentApproval = new Zend_Form_Element_Radio('comment_approved');
     $commentApproval->setLabel('Approval:')->addMultiOptions(array('moderation' => 'Moderation', 'approved' => 'Approved'))->setValue('approved')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $this->addElements(array($comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_findID, $commentApproval, $commentType, $status, $hash, $submit));
     $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'commentStatus', 'comment_approved', 'contentID', 'comment_type'), 'details');
     $this->details->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
예제 #8
0
 /**
  * @author code generate
  * @return mixed
  */
 public function __construct($option = array())
 {
     $classId = new Zend_Form_Element_Hidden('UserId');
     $classId->setDecorators(array('ViewHelper'));
     $this->addElement($classId);
     $email = new Zend_Form_Element_Text('Email');
     $email->setLabel('Email *');
     $email->addFilter('StringTrim');
     $email->setRequired(true);
     $email->setDecorators(array('ViewHelper', array(array('control' => 'HtmlTag'), array('tag' => 'div', 'class' => 'element-control')), array('Label', array('class' => 'col-lg-2 control-label')), array(array('controls' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $email->addValidator(new Zend_Validate_Db_NoRecordExists("Users", "Email"));
     $email->addValidator('EmailAddress', true);
     $email->setRequired(true)->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => "Email không phù hợp")));
     $this->addElement($email);
     $save = new Zend_Form_Element_Submit('Save');
     $save->setLabel('Đăng ký');
     $save->setAttrib('class', 'btn btn-primary');
     $save->setDecorators(array('ViewHelper'));
     $this->addElement($save);
     $reset = new Zend_Form_Element_Reset('Reset');
     $reset->setLabel('Làm lại');
     $reset->setAttrib('class', 'btn btn-primary');
     $reset->setDecorators(array('ViewHelper'));
     $this->addElement($reset);
 }
예제 #9
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setAttrib('enctype', 'multipart/form-data');
     $this->setName('AddRulerImage');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $image = new Zend_Form_Element_File('image');
     $image->setLabel('Upload an image: ')->setRequired(true)->setDestination('./images/rulers/')->addValidator('Size', false, 2097152)->addValidator('Extension', false, 'jpeg,tif,jpg,png,gif,JPG,TIFF')->setMaxFileSize(1024000)->setAttribs(array('class' => 'textInput'))->addValidator('Count', false, array('min' => 1, 'max' => 1))->addDecorator('File');
     $caption = new Zend_Form_Element_Text('caption');
     $caption->setLabel('Image caption')->setRequired(true)->setAttrib('size', 60)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a label');
     $rulerID = new Zend_Form_Element_Hidden('rulerID');
     $rulerID->removeDecorator('label')->removeDecorator('HtmlTag')->addValidator('Int')->setRequired(true);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Upload an image of a ruler')->setAttribs(array('class' => 'large'));
     $this->addElements(array($image, $rulerID, $caption, $submit))->setLegend('Add an image to a ruler profile');
     $this->addDisplayGroup(array('image', 'caption'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
예제 #10
0
 public function __construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app)
 {
     parent::__construct($recurringBeginDate, $recurringClosedDate, $recurringMinAmount, $recurringMaxAmount, $app);
     $startdate = new ZendX_JQuery_Form_Element_DatePicker('startdate');
     $startdate->setAttrib('id', 'startdate');
     $startdate->setAttrib('size', '8');
     $startdate->setAttrib('class', '');
     $startdate->setRequired(true)->addValidators(array(array('Date', true), array('Between', false, array($recurringBeginDate, $recurringClosedDate, 'messages' => array('notBetween' => 'date should be between ' . $recurringBeginDate . ' to (Closed date) ' . $recurringClosedDate)))));
     $recurringamount = new Zend_Form_Element_Text('recurringamount');
     $recurringamount->setRequired(true)->addValidators(array(array('Digits'), array('GreaterThan', false, array($recurringMinAmount)), array('LessThan', false, array($recurringMaxAmount)), array('NotEmpty')));
     $recurringamount->setAttrib('size', '8');
     $recurringperiod = new Zend_Form_Element_Text('recurringperiod');
     $recurringperiod->setAttrib('id', 'recurringperiod');
     $recurringperiod->setAttrib('class', 'NormalBtn');
     $memberfirstname = new Zend_Form_Element_MultiCheckbox('memberfirstname');
     $memberfirstname->setAttrib('class', 'textfield');
     $freequencyofdeposit = new Zend_Form_Element_Select('frequencyofdeposit');
     $freequencyofdeposit->addMultiOption('', 'Select...');
     $freequencyofdeposit->setAttrib('class', 'NormalBtn');
     $freequencyofdeposit->setAttrib('id', 'freequencyofdeposit');
     $perioddescription = new Zend_Form_Element_Select('perioddescription');
     $perioddescription->addMultiOption('', 'Select..');
     $perioddescription->setAttrib('class', 'NormalBtn');
     $perioddescription->setAttrib('id', 'perioddescription');
     $perioddescription->setRequired(true);
     $perioddescription->setAttrib('onchange', 'getInterests(this.value,"' . $app . '")');
     $periodinterest = new Zend_Form_Element_Select('periodinterest');
     $periodinterest->addMultiOption('', 'Select...');
     $periodinterest->setAttrib('class', 'NormalBtn');
     $periodinterest->setAttrib('id', 'periodinterest');
     $periodinterest->setAttrib('size', '5');
     $accountId = new Zend_Form_Element_Hidden('accountId');
     $productIdss = new Zend_Form_Element_Hidden('productId');
     $recurringindex = new Zend_Form_Element_Text('recurringinterest');
     $recurringindex->setAttrib('id', 'recurringinterest');
     $recurringindex->setAttrib('size', '8');
     $recurringindex->setAttrib('class', 'NormalBtn');
     $recurringindex->setAttrib('readonly', 'true');
     $recurringindex->setAttrib('class', 'NormalBtn');
     $recurringindex->setAttrib('readonly', 'true');
     $memberTypeId = new Zend_Form_Element_Hidden('memberTypeId');
     $memberId = new Zend_Form_Element_Hidden('member_id');
     $productId = new Zend_Form_Element_Hidden('product_id');
     $offerproductId = new Zend_Form_Element_Hidden('offerproduct_id');
     $groupId = new Zend_Form_Element_Hidden('groupId');
     $this->addElements(array($memberfirstname, $recurringindex, $freequencyofdeposit, $recurringperiod, $recurringamount, $startdate, $perioddescription, $periodinterest, $memberId, $productId, $offerproductId, $groupId, $memberTypeId, $accountId, $productIdss));
     $period_id = new Zend_Form_Element_Hidden('period_id');
     $period_id->setAttrib('id', 'period_id');
     $startdate1 = new Zend_Form_Element_Hidden('startdate1');
     $recurringamount1 = new Zend_Form_Element_Hidden('recurringamount1');
     $perioddescription1 = new Zend_Form_Element_Hidden('perioddescription1');
     $interest1 = new Zend_Form_Element_Hidden('interest1');
     $Confirm = new Zend_Form_Element_Submit('Confirm');
     $Confirm->setLabel('Confirm');
     $Confirm->setAttrib('class', 'recurring');
     $submit = new Zend_Form_Element_Submit('Submit');
     $submit->setLabel('submit');
     $submit->setAttrib('class', 'recurring');
     $this->addElements(array($submit, $period_id, $Confirm, $startdate1, $recurringamount1, $perioddescription1, $interest1));
 }
예제 #11
0
 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($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'));
 }
예제 #13
0
 public function init()
 {
     $this->setName('resource');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $id->removeDecorator('label');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $suppliers_id = new Zend_Form_Element_Select('suppliers_id');
     $suppliers_id->setLabel('suppliers')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsSuppliers())->setOptions(array('onChange' => 'javascript:getAjaxResponse("http://globalpms.es/production/resource/getdataresource/id/"+this.value,"resource_id");javascript:getAjaxResponse("http://globalpms.es/production/resource/getdata/id/"+this.value,"contacts_id");'))->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $contacts_id = new Zend_Form_Element_Select('contacts_id');
     $contacts_id->setLabel('supplier contact ')->setmultiOptions($this->_selectOptionsContactSuppliers())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $resource_id = new Zend_Form_Element_Select('resource_id');
     $resource_id->setLabel('resource')->setmultiOptions($this->_selectOptionsResources())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $unbilled_hours = new Zend_Form_Element_Text('unbilled_hours');
     $unbilled_hours->setLabel('Unbilled hours')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $facturation_types_id = new Zend_Form_Element_Select('facturation_types_id');
     $facturation_types_id->setLabel('Facturation type')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsFacturation_types())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $price = new Zend_Form_Element_Text('price');
     $price->setLabel('Price')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $observation = new Zend_Form_Element_Text('observation');
     $observation->setLabel('observation')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label');
     $this->addElements(array($id, $name, $suppliers_id, $resource_id, $contacts_id, $unbilled_hours, $facturation_types_id, $price, $observation, $submit));
 }
예제 #14
0
 public function init()
 {
     $this->setName('client');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $id->removeDecorator('label');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $fiscal_name = new Zend_Form_Element_Text('fiscal_name');
     $fiscal_name->setLabel('Fiscal name')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $company_types_id = new Zend_Form_Element_Select('company_types_id');
     $company_types_id->setLabel('Type')->setRequired(true)->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsCompanyTypes())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('emailAddress', TRUE)->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $telephone = new Zend_Form_Element_Text('telephone');
     $telephone->setLabel('Telephone')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $fax = new Zend_Form_Element_Text('fax');
     $fax->setLabel('fax')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $direction = new Zend_Form_Element_Text('direction');
     $direction->setLabel('Direction')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $city = new Zend_Form_Element_Text('city');
     $city->setLabel('City')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $country = new Zend_Form_Element_Text('country');
     $country->setLabel('Country')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $postal_code = new Zend_Form_Element_Text('postal_code');
     $postal_code->setLabel('Postal code')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $observation = new Zend_Form_Element_Text('observation');
     $observation->setLabel('Observation')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label');
     $this->addElements(array($id, $name, $fiscal_name, $company_types_id, $email, $telephone, $fax, $direction, $city, $country, $postal_code, $observation, $submit));
 }
예제 #15
0
 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oFormSliderEditId = new Zend_Form_Element_Hidden("slider_edit_id");
     $oFormSliderEditId->setValue(0);
     $oFormSliderEditId->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormSliderEditId);
     $oSliderName = new Zend_Form_Element_Text("name");
     $oSliderName->setLabel("Nazwa slidera:");
     $oSliderName->addValidator(new Zend_Validate_StringLength(array("min" => 3, "max" => 45)));
     $oSliderName->setRequired(TRUE);
     $oSliderName->setAttrib("class", "valid");
     $this->addElement($oSliderName);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "submit");
     $oSubmit->setLabel("Zapisz");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/_defaultform.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
예제 #16
0
 public function myInit($Id)
 {
     global $mySession;
     $db = new Db();
     if ($Id != "") {
         $adminData = $db->runQuery("select * from " . TSHIRT_ICONS . " where id='" . $Id . "'");
         $title_value = $adminData[0]['title'];
         $oldicon_value = $adminData[0]['icon'];
         $colorcode_value = $adminData[0]['colorcode'];
     } else {
         $title_value = '';
         $oldicon_value = '';
         $colorcode_value = '';
     }
     $title = new Zend_Form_Element_Text('title');
     $title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'First Name is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "mws-textinput required")->setValue($title_value);
     $colorcode = new Zend_Form_Element_Text('colorcode');
     $colorcode->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please enter color code.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "Expandable mws-textinput required")->setAttrib("onkeypress", "return checknummspK(event)")->setValue($colorcode_value);
     $this->addElement($colorcode);
     $this->addElement($title);
     if ($Id == "") {
         $image = new Zend_Form_Element_File('image');
         $image->setDestination(SITE_ROOT . 'images/tshirt-icons/')->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Please select an icon.'))->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox")->addDecorator('Errors', array('class' => 'error'));
     } else {
         $image = new Zend_Form_Element_File('image');
         $image->setDestination(SITE_ROOT . 'images/tshirt-icons/')->addValidator('Extension', false, 'jpg,jpeg,png,gif')->setAttrib("class", "textbox");
     }
     $this->addElement($image);
     if ($Id != "") {
         $oldicon = new Zend_Form_Element_Hidden('oldicon');
         $oldicon->setValue($oldicon_value);
         $this->addElement($oldicon);
         $this->addElement("hidden", "foo", array("decorators" => array(array(array("img" => "HtmlTag"), array("tag" => "img", "openOnly" => true, "src" => IMAGES_URL . 'tshirt-icons/' . $oldicon_value, "align" => "middle", "class" => "myClass", "style" => "max-width:200px;max-height:200px;")), array("ViewHelper"), array(array("span" => "HtmlTag"), array("tag" => "span", "class" => "myElement", "style" => "text-align:center;display:block;")))));
     }
 }
예제 #17
0
파일: EditPassword.php 프로젝트: valizr/MMA
 function editUserPassword()
 {
     $this->setMethod('post');
     $this->addAttribs(array('id' => 'formAccountEditPassword', 'class' => ''));
     $filters = array(new Zend_Filter_StringTrim(), new Zend_Filter_StripTags());
     $control = new Zend_Form_Element_Hidden('control');
     $control->setValue('editPassword');
     $this->addElement($control);
     $oldPassword = new Zend_Form_Element_Password('oldPassword');
     $oldPassword->setLabel('Old password');
     $oldPassword->addValidator(new Zend_Validate_StringLength(6, 32));
     $oldPassword->setAttribs(array('class' => 'text validate[required,minSize[6],maxSize[32]] rightAdd', 'minlenght' => '6', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'data-prompt-position' => 'topLeft:0'));
     $oldPassword->setRequired(true);
     $this->addElement($oldPassword);
     $password = new Zend_Form_Element_Password('password');
     $password->setLabel(Zend_Registry::get('translate')->_('admin_administrators_new_password'));
     $password->addValidator(new Zend_Validate_StringLength(6, 32));
     $password->setAttribs(array('class' => 'text validate[required] rightAdd', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'ondrop' => 'return false', 'onpaste' => 'return false'));
     $password->setRequired(true);
     $this->addElement($password);
     $retypePassword = new Zend_Form_Element_Password('retypePassword');
     $retypePassword->setLabel(Zend_Registry::get('translate')->_('admin_administrators_retype_new_password'));
     $retypePassword->addValidator(new Zend_Validate_Identical('password'));
     $retypePassword->addValidator(new Zend_Validate_StringLength(6, 32));
     $retypePassword->setAttribs(array('class' => 'text validate[required] rightAdd', 'maxlenght' => '32', 'autocomplete' => 'off', 'oncontextmenu' => 'return false', 'ondrop' => 'return false', 'onpaste' => 'return false'));
     $retypePassword->setRequired(true);
     $retypePassword->setIgnore(true);
     $this->addElement($retypePassword);
     $submit = new Zend_Form_Element_Submit('savePassword');
     $submit->setValue(Zend_Registry::get('translate')->_('apply_password'));
     $submit->setAttribs(array('class' => 'submit tsSubmitLogin fL'));
     $submit->setIgnore(true);
     $this->addElement($submit);
     $this->setElementFilters($filters);
 }
예제 #18
0
 public function init()
 {
     $this->setName('destinatario')->setAttrib('class', 'form-horizontal');
     $des_id_destinatario = new Zend_Form_Element_Hidden('des_id_destinatario');
     $des_id_destinatario->addFilter('Int');
     $des_nombre = new Zend_Form_Element_Text('des_nombre');
     $des_nombre->setAttrib('placeholder', 'Nombre')->setLabel('Nombre:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $des_rut = new Zend_Form_Element_Text('des_rut');
     $des_rut->setAttrib('placeholder', 'RUT')->setLabel('RUT:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $des_direccion = new Zend_Form_Element_Text('des_direccion');
     $des_direccion->setAttrib('placeholder', 'Dirección')->setLabel('Dirección:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $des_ciudad = new Zend_Form_Element_Text('des_ciudad');
     $des_ciudad->setAttrib('placeholder', 'Ciudad')->setLabel('Ciudad:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $des_telefono = new Zend_Form_Element_Text('des_telefono');
     $des_telefono->setAttrib('placeholder', 'Teléfono')->setLabel('Teléfono:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $des_tipo = new Zend_Form_Element_Select('des_tipo');
     $des_tipo->setAttrib('placeholder', 'Tipo')->setLabel('Tipo:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $des_tipo->addMultiOption("CLIENTE", "Cliente");
     $des_tipo->addMultiOption("PROVEEDOR", "Proveedor");
     $des_tipo->addMultiOption("INTERNO", "Tienda SMO (Interno)");
     $des_comuna = new Zend_Form_Element_Text('des_comuna');
     $des_comuna->setAttrib('placeholder', 'Comuna')->setLabel('Comuna:')->addFilter('StripTags')->addFilter('StringTrim');
     $des_region = new Zend_Form_Element_Text('des_region');
     $des_region->setAttrib('placeholder', 'Región')->setLabel('Región:')->addFilter('StripTags')->addFilter('StringTrim');
     $des_contacto = new Zend_Form_Element_Text('des_contacto');
     $des_contacto->setAttrib('placeholder', 'Contacto')->setLabel('Contacto:')->addFilter('StripTags')->addFilter('StringTrim');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $this->addElements(array($des_id_destinatario, $des_nombre, $des_rut, $des_direccion, $des_ciudad, $des_telefono, $des_tipo, $des_comuna, $des_region, $des_contacto, $submit));
 }
 public function init()
 {
     $this->setName('resource_activity_has_receipt');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $id->removeDecorator('label');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     //
     //        $resource_activity_has_receipt_types_id = new Zend_Form_Element_Select('resource_activity_has_receipt_types_id');
     //        $resource_activity_has_receipt_types_id->setLabel('resource_activity_has_receipt types')
     //                ->addValidator('NotEmpty', true)
     //                ->setmultiOptions($this->_selectOptions_types())
     //                ->setAttrib('maxlength', 200)
     //                ->setAttrib('size', 1)
     //                ->setAttrib("class", "toolboxdrop")
     //                ->setDecorators(array(array('ViewScript', array(
     //                            'viewScript' => 'forms/_element_select.phtml'))))
     //        ;
     //
     //        $resource_activity_has_receipt_types_id = new Zend_Form_Element_Multiselect('$resource_activity_has_receipt_types_id');
     //        $resource_activity_has_receipt_types_id->setLabel('resource_activity_has_receipt types')
     //                ->setmultiOptions($this->_selectOptions_types())
     //                ->setAttrib('maxlength', 200)
     //                ->setAttrib('size', 5)
     //                ->setDecorators(array(array('ViewScript', array(
     //                            'viewScript' => 'forms/_element_select.phtml'))))
     //                ->setAttrib("class","toolboxdrop")
     //        ;
     //
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label');
     $this->addElements(array($id, $name, $submit));
 }
예제 #20
0
 /**
  *
  * Edit Group form
  *
  */
 public function init()
 {
     $cname = explode('_', get_class());
     $this->preInit(end($cname));
     // use template file
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/EditGroup.phtml'))));
     // get group from database
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $group = $request->getParam('name');
     $Profiles = new Application_Model_Profiles();
     $ProfilesMeta = new Application_Model_ProfilesMeta();
     $profile = $Profiles->getProfile($group, false, true);
     $owners_profile = $Profiles->getProfileByField('id', $profile->owner);
     $username_minchars = Zend_Registry::get('config')->get('username_minchars');
     $username_maxchars = Zend_Registry::get('config')->get('username_maxchars');
     // fields
     $id = new Zend_Form_Element_Hidden('id');
     $id->setValue($profile->id);
     $name = new Zend_Form_Element_Text('name');
     $name->setDecorators(array('ViewHelper', 'Errors'))->setLabel($this->translator->translate('Group Name'))->setValue($profile->name)->setIgnore(true)->setAttrib('readonly', true)->setAttrib('class', 'form-control');
     $screenname = new Zend_Form_Element_Text('screen_name');
     $screenname->setDecorators(array('ViewHelper', 'Errors'))->addFilter('StringTrim')->setValue($profile->screen_name)->addValidator('alnum', false, array('allowWhiteSpace' => true))->addValidator('stringLength', false, array($username_minchars, $username_maxchars))->setErrorMessages(array(sprintf($this->translator->translate('Please choose a valid name between %d and %d characters'), $username_minchars, $username_maxchars)))->setLabel($this->translator->translate('Screen Name'))->setRequired(true)->setAttrib('class', 'form-control');
     $description = new Zend_Form_Element_Textarea('description');
     $description->setDecorators(array('ViewHelper', 'Errors'))->setAttrib('COLS', '')->setAttrib('ROWS', '4')->addFilter('StripTags')->setValue($ProfilesMeta->getMetaValue('description', $profile->id))->setLabel($this->translator->translate('About this group'))->setAttrib('class', 'form-control');
     $profile_privacy = new Zend_Form_Element_Select('profile_privacy');
     $profile_privacy->setDecorators(array('ViewHelper', 'Errors'))->setMultiOptions(Zend_Registry::get('group_privacy_array'))->setErrorMessages(array($this->translator->translate('Select group visibility')))->setLabel($this->translator->translate('Select group visibility'))->setRequired(true)->setValue($profile->profile_privacy)->setAttrib('class', 'form-control');
     $is_hidden = new Zend_Form_Element_Checkbox('is_hidden');
     $is_hidden->setDecorators(array('ViewHelper', 'Errors'))->setValue(isset($profile->is_hidden) && $profile->is_hidden == 1 ? 1 : 0)->setLabel($this->translator->translate('Remove?'))->setCheckedValue("1")->setUncheckedValue("0");
     $submit = new Zend_Form_Element_Submit('formsubmit');
     $submit->setDecorators(array('ViewHelper'))->setLabel($this->translator->translate('Save'))->setAttrib('class', 'submit btn btn-default');
     $this->addElements(array($id, $name, $screenname, $profile_privacy, $description, $is_hidden, $submit));
     $this->postInit();
 }
예제 #21
0
 public function init()
 {
     //        if (!$this->hasTranslator()) {
     //            $this->setTranslator(Zend_Registry::get('Zend_Translate'));
     //        }
     $itemid = new Zend_Form_Element_Hidden('ItemID');
     $itemid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
     $maTS = new Zend_Form_Element_Text('MaTS');
     $maTS->setOptions(array('label' => 'Mã TS', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $tenTS = new Zend_Form_Element_Text('TenTS');
     $tenTS->setOptions(array('label' => 'Tên tài sản', 'required' => TRUE, 'filters' => array('StringTrim')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $descr = new Zend_Form_Element_Textarea('Description');
     $descr->setOptions(array('label' => 'Mô tả', 'style' => "width: 200px; height: 50px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $type = new Zend_Form_Element_Select('Type');
     $type->setOptions(array('label' => 'Loại bảo mật', 'required' => TRUE, 'MultiOptions' => array(1 => 'Bảo mật thấp', 0 => 'Bảo mật cao')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
     $startDate = new Zend_Form_Element_Text('StartDate');
     $startDate->setOptions(array('label' => 'Bắt đầu SD', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $price = new Zend_Form_Element_Text('Price');
     $price->setOptions(array('label' => 'Giá', 'required' => TRUE, 'filters' => array('Int')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $warrantyTime = new Zend_Form_Element_Text('WarrantyTime');
     $warrantyTime->setOptions(array('label' => 'Bảo hành', 'required' => TRUE, 'filters' => array('Int')))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $status = new Zend_Form_Element_Select('Status');
     $status->setOptions(array('label' => 'Tình trạng', 'required' => TRUE, 'MultiOptions' => array(0 => 'Có thể mượn', 1 => 'Đang cho mượn', 2 => 'Hỏng')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
     $place = new Zend_Form_Element_Textarea('Place');
     $place->setOptions(array('label' => 'Địa điểm hiện tại', 'style' => "width: 200px; height: 50px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $this->setName('item-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($itemid, $maTS, $tenTS, $descr, $type, $startDate, $price, $warrantyTime, $status, $place))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
 }
예제 #22
0
 public function __construct($options = null)
 {
     $this->_disabledDefaultActions = true;
     $readOnly = $options['readOnlyForm'];
     $payement = $options['payMean'];
     $config = Zend_Registry::get('config');
     unset($options['readOnlyForm']);
     unset($options['payMean']);
     parent::__construct($options);
     $this->setAttrib('id', 'accountManagement');
     $buttonLabel = $this->getView()->getClientText('form_label_confirm_order_btn');
     if (in_array($payement, array('visa', 'mastercard'))) {
         $this->setAction($config->payment->url);
         $buttonLabel = $this->getView()->getClientText('form_label_confirm_payment_btn');
     }
     $baseDir = $this->getView()->baseUrl();
     // Account data summary
     $summary = new Cible_Form_Element_Html('summary', array('value' => $readOnly));
     $summary->setDecorators(array('ViewHelper', array('label', array('placement' => 'prepend')), array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'form_title_inline left'))));
     $this->addElement($summary);
     $storeId = new Zend_Form_Element_Hidden('ps_store_id', array('value' => $config->payment->storeId));
     $storeId->removeDecorator('label');
     $this->addElement($storeId);
     $hppKey = new Zend_Form_Element_Hidden('hpp_key', array('value' => $config->payment->hppkey));
     $hppKey->removeDecorator('label');
     $this->addElement($hppKey);
     $total = new Zend_Form_Element_Hidden('charge_total');
     $total->removeDecorator('label');
     $this->addElement($total);
     // Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel($buttonLabel)->setAttrib('class', 'nextStepButton')->setDecorators(array('ViewHelper', array(array('row' => 'HtmlTag'), array('tag' => 'dd', 'class' => 'stepBottomNext'))));
     $this->addElement($submit);
 }
예제 #23
0
 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oMessage = new Zend_Form_Element_Textarea("message");
     $oMessage->setFilters($this->_aFilters);
     $oMessage->setRequired(FALSE);
     $oMessage->removeDecorator("label");
     $this->addElement($oMessage);
     $oIsDing = new Zend_Form_Element_Checkbox("is_ding");
     $oIsDing->setLabel("Włącz dźwięk");
     $oIsDing->setValue(1);
     $this->addElement($oIsDing);
     $oSubmit = new Zend_Form_Element_Submit("send_message");
     $oSubmit->setLabel("Wyślij wiadomość");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/chat.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
예제 #24
0
 public function init()
 {
     $this->setName('activity');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $id->removeDecorator('label');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name')->setRequired(true)->addFilter('StripTags')->addfilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $activity_types_id = new Zend_Form_Element_Select('activity_types_id');
     $activity_types_id->setLabel('activity type')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsActivity_types())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $contact_own_company_id = new Zend_Form_Element_Select('contact_own_company_id');
     $contact_own_company_id->setLabel('contact own company')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsContactOwnCompanies())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     //
     $contact_client_company_id = new Zend_Form_Element_Select('contact_client_company_id');
     $contact_client_company_id->setLabel('contact client company')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsContactClientCompanies())->setAttrib('maxlength', 200)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $status_id = new Zend_Form_Element_Select('status_id');
     $status_id->setLabel('Status')->addValidator('NotEmpty', true)->setmultiOptions($this->_selectOptionsStatus())->setAttrib('maxlength', 300)->setAttrib('size', 1)->setAttrib("class", "toolboxdrop")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_select.phtml'))));
     $date_start = new Zend_Form_Element_Text('date_start');
     $date_start->setLabel('date start')->setRequired(true)->addFilter('StripTags')->addfilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))))->setAttrib('id', 'f_date_start');
     $date_end = new Zend_Form_Element_Text('date_end');
     $date_end->setLabel('date end')->setRequired(true)->addFilter('StripTags')->addfilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))))->setAttrib('id', 'f_date_end');
     $observation = new Zend_Form_Element_Text('observation');
     $observation->setLabel('Observation')->setRequired(true)->addfilter('StripTags')->addfilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label');
     $this->addElements(array($id, $name, $activity_types_id, $contact_own_company_id, $contact_client_company_id, $status_id, $date_start, $date_end, $observation, $submit));
 }
예제 #25
0
 public function init()
 {
     $this->setName('contact');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $id->removeDecorator('label');
     //
     //        $company_id = new Zend_Form_Element_Hidden('company_id');
     //        $company_id->addFilter('Int');
     //        $company_id->removeDecorator('label');
     //
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('name')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $email = new Zend_Form_Element_Text('email');
     $email->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('emailAddress', TRUE)->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $telephone = new Zend_Form_Element_Text('telephone');
     $telephone->setLabel('Telephone')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $status = new Zend_Form_Element_Text('status');
     $status->setLabel('Status')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $direction = new Zend_Form_Element_Text('direction');
     $direction->setLabel('Direction')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setAttrib('size', 30)->setAttrib('maxlength', 80)->setAttrib("class", "inputbox")->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_text.phtml'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setValue('Guardar')->setAttrib('id', 'submitbutton')->setDecorators(array(array('ViewScript', array('viewScript' => 'forms/_element_submit.phtml'))))->setAttrib('class', 'btn')->removeDecorator('label');
     $this->addElements(array($id, $name, $email, $telephone, $direction, $status, $submit));
 }
예제 #26
0
파일: Login.php 프로젝트: nuxwin/i-PMS
 /**
  * Form initialization
  *
  * @return void
  */
 public function init()
 {
     $this->setName('loginForm');
     $this->setElementsBelongTo('loginForm');
     $element = new Zend_Form_Element_Text('username');
     $element->setLabel('Username')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim');
     $this->addElement($element);
     $element = new Zend_Form_Element_Password('password');
     $element->setLabel('Password')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim');
     $this->addElement($element);
     $element = new Zend_Form_Element_Checkbox('rememberMe');
     $element->setLabel('Remember me');
     $this->addElement($element);
     /**
      * @var $request Zend_Controller_Request_Http
      */
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $element = new Zend_Form_Element_Hidden('redirect');
     $element->setValue($request->getParam('from', '/'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim');
     $element->getDecorator('HtmlTag')->setOption('class', 'hidden');
     $element->getDecorator('Label')->setOption('tagClass', 'hidden');
     $this->addElement($element);
     $element = new Zend_Form_Element_Submit('submit');
     $element->setLabel('Connection');
     $this->addElement($element);
 }
예제 #27
0
 public function init()
 {
     //        if (!$this->hasTranslator()) {
     //            $this->setTranslator(Zend_Registry::get('Zend_Translate'));
     //        }
     $userid = new Zend_Form_Element_Hidden('UserID');
     $userid->setDecorators(array(array('ViewHelper', array('helper' => 'formHidden'))));
     $username = new Zend_Form_Element_Text('Username');
     $username->setOptions(array('label' => 'Username', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $birthday = new Zend_Form_Element_Text('Birthday');
     $birthday->setOptions(array('label' => 'Birthday', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $role = new Zend_Form_Element_Select('Role');
     $role->setOptions(array('label' => 'User Type', 'MultiOptions' => array(3 => 'User', 2 => 'IT', 1 => 'Admin', 0 => 'SuperAdmin')))->setDecorators(array(array('ViewHelper', array('helper' => 'formSelect')), array('Label', array('class' => 'label'))));
     $fullname = new Zend_Form_Element_Text('FullName');
     $fullname->setOptions(array('label' => 'FullName'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $email = new Zend_Form_Element_Text('Email');
     $email->setOptions(array('label' => 'Email', 'required' => TRUE))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $group = new Zend_Form_Element_Text('Group');
     $group->setOptions(array('label' => 'Group'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $phone = new Zend_Form_Element_Text('Phone');
     $phone->setOptions(array('label' => 'Phone'))->setDecorators(array(array('ViewHelper', array('helper' => 'formText')), array('Label', array('class' => 'label'))));
     $address = new Zend_Form_Element_Textarea('Address');
     $address->setOptions(array('label' => 'Address', 'style' => "width: 200px; height: 150px"))->setDecorators(array(array('ViewHelper', array('helper' => 'formTextarea')), array('Label', array('class' => 'label'))));
     $this->setName('user-form')->setMethod(Zend_Form::METHOD_POST)->setEnctype(Zend_Form::ENCTYPE_URLENCODED)->addElements(array($userid, $username, $role, $fullname, $email, $birthday, $group, $phone, $address))->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'fieldset', 'style' => "padding: 0; border: 0; margin-top: 25px;")), 'Form'));
 }
예제 #28
0
 public function init()
 {
     $this->setName('transfer_target');
     $this->setAttrib('class', 'form-inline');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $host2 = new Zend_Form_Element_Text('host2');
     $host2->setAttrib('class', 'form-control')->setLabel('host2');
     $host2->setDecorators(array('ViewHelper', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $user2 = new Zend_Form_Element_Text('user2');
     $user2->setLabel('user2');
     $user2->setAttrib('class', 'form-control');
     $user2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $password2 = new Zend_Form_Element_Text('password2');
     $password2->setLabel('pass2');
     $password2->setAttrib('class', 'form-control');
     $password2->setDecorators(array('ViewHelper', 'Description', 'Errors', 'Label', array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group col-md-3'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit');
     $submit->setAttrib('class', 'btn btn-default');
     $submit->setValue('transfer_target');
     $submit->setDecorators(array('ViewHelper', 'Description', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'colspan' => 2, 'align' => 'center')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'class' => 'form-group'))));
     $this->addElements(array($host2, $user2, $password2, $submit));
     $this->setDecorators(array('FormElements', 'Form'));
 }
예제 #29
0
 public function __construct($options = null)
 {
     // variable
     parent::__construct($options);
     $baseDir = $options['baseDir'];
     // name
     $name = new Zend_Form_Element_Text('EGI_Name');
     $name->setLabel($this->getView()->getCibleText('form_label_name'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextInput');
     $this->addElement($name);
     // description
     $description = new Zend_Form_Element_Textarea('EGI_Description');
     $description->setLabel($this->getView()->getCibleText('form_label_description'))->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->getView()->getCibleText('validation_message_empty_field'))))->setAttrib('class', 'stdTextareaEdit');
     $this->addElement($description);
     //status
     $status = new Zend_Form_Element_Select('EG_Status');
     $status->setLabel($this->getView()->getCibleText('form_label_status'))->setAttrib('class', 'stdSelect');
     $status = Cible_FunctionsGeneral::fillStatusSelectBox($status, 'Extranet_Groups', 'EG_Status');
     $this->addElement($status);
     // Hidden GroupID
     $groupID = new Zend_Form_Element_Hidden('groupID');
     $groupID->removeDecorator('label');
     $groupID->removeDecorator('DtDdWrapper');
     if (isset($options['groupID'])) {
         $groupID->setValue($options['groupID']);
     }
     $this->addElement($groupID);
 }
예제 #30
0
 /**
  * Form initialization
  *
  * @return void
  */
 public function init()
 {
     $url = Zend_Controller_Front::getInstance()->getRouter()->assemble(array('module' => "flex", 'controller' => 'panel', 'action' => 'form'), 'default');
     $this->setAction($url)->setMethod('post');
     $this->setLegend(sprintf(Zoo::_('Edit %s'), $this->target->name));
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Name')->setRequired(true);
     $name->setDescription('Administration-side identifier');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title');
     $title->setDescription('User-visible title of panel');
     $layout = new Zend_Form_Element_Select('layout');
     $layout->setLabel('Layout');
     $layout->setMultiOptions($this->getLayouts());
     $category = new Zend_Form_Element_Text('category');
     $category->setLabel('Category');
     $category->setDescription('Administration-side grouping');
     $category->setRequired(true);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setLabel('save')->setOrder(100);
     $this->addElements(array($name, $title, $layout, $category));
     $legend = Zoo::_("Basic options");
     $this->addDisplayGroup(array('name', 'title', 'layout', 'category'), 'block_form', array('legend' => $legend));
     $this->addElement($submit);
     if ($this->target->id > 0) {
         $id_ele = new Zend_Form_Element_Hidden('id');
         $id_ele->setValue(intval($this->target->id));
         $this->addElement($id_ele);
     }
     $this->populate($this->target->toArray());
 }