本文整理汇总了PHP中Zend_Form_Element_Hidden类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Hidden类的具体用法?PHP Zend_Form_Element_Hidden怎么用?PHP Zend_Form_Element_Hidden使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Form_Element_Hidden类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addProviderElements
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: init
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: init
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: init
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: __construct
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: _id_encontro
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;
}
示例7: __construct
/** 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: __construct
/**
* @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: __construct
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: __construct
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: __construct
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'));
}
示例12: __construct
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: init
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: init
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: init
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");
}
}