本文整理汇总了PHP中Zend_Form_Element_Submit类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Submit类的具体用法?PHP Zend_Form_Element_Submit怎么用?PHP Zend_Form_Element_Submit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Form_Element_Submit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initializing form
*/
public function init()
{
parent::init();
$element = new Zend_Form_Element_Select('year');
$element->setLabel('Jaar')->addMultiOption('', '...')->setDescription('Percentages zijn van toepassing op dit jaartal')->setRequired(true);
$entries = Model_Hm_Week_Percentage::findAllByHomeId($this->getHomeId())->select('wp.year, wp.id, wp.hm_home_id')->execute(null, Doctrine_Core::HYDRATE_ARRAY);
$availableYears = new Model_Hm_AvailableYears($entries);
foreach ($availableYears->toArray() as $year) {
$element->addMultiOption($year, $year);
}
$this->addElement($element);
$this->addDisplayGroup(array('year'), 'year-group', array('legend' => 'Algemeen', 'class' => 'width100'));
for ($weekNo = 01; $weekNo <= 53; $weekNo++) {
$elementName = 'week_' . $weekNo;
$elements[] = $elementName;
$element = new Zend_Form_Element_Text($elementName);
$element->setLabel('Percentage')->setValidators(array(array('Float')))->setAttribs(array('maxlength' => 6))->setRequired(true);
$this->addElement($element);
$this->addDisplayGroup(array($elementName), $elementName . 'group', array('class' => 'weekpercentage', 'legend' => 'Week ' . $weekNo));
}
$element = new Zend_Form_Element_Submit('submit_percentageweek');
$element->setLabel('Verwerken')->setAttrib('class', 'submit');
$this->addElement($element);
$this->addDisplayGroup(array('submit_percentageweek'), 'submit', array('class' => 'submit'));
$this->bhvkDecorators();
$this->bhvkDecorateSubmitElement($this->getElement('submit_percentageweek'));
}
示例2: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
$finds = new Findspots();
$schema = $finds->info();
$fields = array_flip($schema['cols']);
$remove = array('updated', 'created', 'updatedBy', 'createdBy', 'institution', 'findID', 'address', 'fourFigure', 'gridlen', 'postcode', 'easting', 'northing', 'declong', 'declat', 'fourFigureLat', 'fourFigureLon', 'woeid', 'geonamesID', 'osmNode', 'elevation', 'geohash', 'country', 'map25k', 'map10k', 'soiltype', 'smrref', 'otherref', 'id', 'accuracy', 'secuid', 'old_occupierid', 'occupier', 'old_findspotid', 'date');
foreach ($remove as $rem) {
unset($fields[$rem]);
}
$labels = array('gridrefcert' => 'Grid reference certainty', 'gridref' => 'Grid reference', 'knownas' => 'Known as', 'disccircum' => 'Discovery circumstances', 'gridrefsrc' => 'Grid reference source', 'landusevalue' => 'Land use value', 'landusecode' => 'Land use code', 'depthdiscovery' => 'Depth of discovery', 'Highsensitivity' => 'High sensitivity');
parent::__construct($options);
$this->setName('configureFindSpotCopy');
$elements = array();
foreach (array_keys($fields) as $field) {
$label = $field;
$field = new Zend_Form_Element_Checkbox($field);
if (array_key_exists($label, $labels)) {
$clean = ucfirst($labels[$label]);
} else {
$clean = ucfirst($label);
}
$field->setLabel($clean)->setRequired(false)->addValidator('NotEmpty', 'boolean');
$elements[] = $field;
$this->addElement($field);
}
$this->addDisplayGroup($elements, 'details');
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Submit find spot configuration');
$this->addElement($submit);
$this->details->setLegend('Choose fields: ');
parent::init();
}
示例3: init
public function init()
{
$languageFile = Zend_Registry::get('languageFile');
$translate = new Zend_Translate('array', $languageFile, 'zh_CN');
$this->setTranslator($translate);
$this->setMethod('POST');
$this->setName('contactForm');
$element = new Zend_Form_Element_Text('name');
$element->setLabel('怎么称呼您');
$this->addElement($element);
$element = new Zend_Form_Element_Text('email');
$element->setLabel('您的Email');
//$element->setRequired(true);
$this->addElement($element);
$element = new Elements();
$element->addReCaptcha($this);
$this->addDisplayGroup(array('name', 'email', 'captcha'), 'leftSection');
$this->getDisplayGroup('leftSection')->removeDecorator('DtDdWrapper');
$element = new Zend_Form_Element_Textarea('body');
$element->setLabel('想要开通城市地区和找房贴士,关于您的简单介绍');
$element->addPrefixPath('My_Validator', 'My/Validator/', 'validate');
$element->addValidator('FormValueNotNull', true);
//$element->setRequired(true);
$element->setAttrib('rows', 13);
$this->addElement($element);
$this->addDisplayGroup(array('body'), 'rightSection');
$this->getDisplayGroup('rightSection')->removeDecorator('DtDdWrapper');
$element = new Zend_Form_Element_Submit('post');
$element->removeDecorator('Label');
$this->addElement($element);
}
示例4: __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));
}
示例5: __construct
public function __construct(array $dataBusinessId, $options = null)
{
parent::__construct($options);
$this->setName('frmEmployee');
$this->setMethod('post');
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Employee name');
$name->setAttrib('maxlength', 80);
$name->setRequired(true);
$name->addValidator(new Zend_Validate_NotEmpty());
$this->addElement($name);
$age = new Zend_Form_Element_Text('age');
$age->setLabel('Employee age');
$age->addValidator(new Zend_Validate_Int());
$this->addElement($age);
$businessId = new Zend_Form_Element_Select('business_id');
$businessId->setLabel('Business');
$businessId->setRequired(true);
$businessId->addValidator(new Zend_Validate_NotEmpty());
$businessId->addValidator(new Zend_Validate_Int());
$businessId->addMultiOptions($dataBusinessId);
$this->addElement($businessId);
$submit = new Zend_Form_Element_Submit('bt_submit');
$submit->setLabel('Save');
$this->addElement($submit);
}
示例6: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
$this->addElement('Hidden', 'search', array('value' => 1));
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$noi_dung = new Zend_Form_Element_Textarea('noi_dung');
$noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
$soundcloud_embed = new Zend_Form_Element_Text('soundcloud_embed');
$soundcloud_embed->setLabel('Embed SoundCloud')->setDescription('How to get SoundCloud embed code? <a href="http://help.soundcloud.com/customer/portal/articles/243751-how-can-i-put-my-track-or-playlist-on-my-site-or-blog-" target="_blank">Click here</a>')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'div', 'escape' => false, 'placement' => 'append')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$youtube_embed = new Zend_Form_Element_Text('youtube_embed');
$youtube_embed->setLabel('Embed Youtube')->setDescription('How to get Youtube embed code? <a href="https://support.google.com/youtube/answer/171780?hl=en" target="_blank">Click here</a>')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'div', 'escape' => false, 'placement' => 'append')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$link_nct = new Zend_Form_Element_Text('link_nct');
$link_nct->setLabel('Nhac cua tui')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$link_mp3 = new Zend_Form_Element_Text('link_mp3');
$link_mp3->setLabel('Mp3')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
$trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
$trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$noi_bat = new Zend_Form_Element_Select('noi_bat');
$noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/bai_giang')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $_SERVER['HTTP_REFERER'] . '"'));
$this->addElements(array($tieu_de, $noi_dung, $soundcloud_embed, $youtube_embed, $link_nct, $link_mp3, $trang_thai, $noi_bat, $photo, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}
示例7: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('id', 'pdcategories');
$this->setAttrib('name', 'pdcategories');
$categoryName = new Zend_Form_Element_Text('category');
$categoryName->setAttrib('id', 'category');
$categoryName->setAttrib('name', 'category');
$categoryName->setAttrib('maxlength', '30');
$categoryName->setAttrib('onblur', 'chkCategory()');
$categoryName->setAttrib('onkeypress', 'chkCategory()');
$categoryName->addFilter(new Zend_Filter_StringTrim());
$categoryName->setRequired(true);
$categoryName->addValidator('NotEmpty', false, array("messages" => 'Please enter category'));
$categoryName->addValidator('regex', true, array('pattern' => '/^[a-zA-Z0-9][\\s+[a-zA-Z0-9]+]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid category')));
$categoryName->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_pd_categories', 'field' => 'category', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive = 1')));
$categoryName->getValidator('Db_NoRecordExists')->setMessage('Category already exists');
$categoryDesc = new Zend_Form_Element_Textarea('description');
$categoryDesc->setAttrib('id', 'description');
$categoryDesc->setAttrib('name', 'description');
$categoryDesc->setAttrib('rows', 10);
$categoryDesc->setAttrib('cols', 50);
$categoryDesc->setAttrib('maxlength', 250);
$submitBtn = new Zend_Form_Element_Submit('submit');
$submitBtn->setAttrib('id', 'submitBtn');
$submitBtn->setLabel('Add');
$this->addElements(array($categoryName, $categoryDesc, $submitBtn));
$this->setElementDecorators(array('ViewHelper'));
}
示例8: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
$this->addElement('Hidden', 'search', array('value' => 1));
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$quan_trong = new Zend_Form_Element_Select('quan_trong');
$quan_trong->setLabel('Quan Trọng')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$noi_bat = new Zend_Form_Element_Select('noi_bat');
$noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$image = new Zend_Form_Element_Image('image');
$image->setLabel('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
$trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
$trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$mo_ta_tom_tat = new Zend_Form_Element_Textarea('mo_ta_tom_tat');
$mo_ta_tom_tat->setLabel('Mô tả tóm tắt')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_tom_tat', 'class' => 'textarea', 'rows' => '4'));
$mo_ta_chi_tiet = new Zend_Form_Element_Textarea('mo_ta_chi_tiet');
$mo_ta_chi_tiet->setLabel('Mô tả chi tiết (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_chi_tiet', 'class' => 'text-input textarea'));
$pdf = new Zend_Form_Element_File('pdf');
$pdf->setLabel('Upload PDF')->setDescription('(*.pdf < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'tin-tuc', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($tieu_de, $quan_trong, $noi_bat, $photo, $image, $pdf, $trang_thai, $mo_ta_tom_tat, $mo_ta_chi_tiet, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'tin_tuc')), 'Form'));
}
示例9: init
public function init()
{
$this->setMethod('post');
$this->setAttrib('action', BASE_URL . 'timeformat/edit');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'timeformat');
$id = new Zend_Form_Element_Hidden('id');
$timeformat = new Zend_Form_Element_Text('timeformat');
$timeformat->setAttrib('maxLength', 20);
$timeformat->addFilter(new Zend_Filter_StringTrim());
$timeformat->setRequired(true);
$timeformat->addValidator('NotEmpty', false, array('messages' => 'Please enter time format.'));
$description = new Zend_Form_Element_Textarea('description');
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$url = "'timeformat/saveupdate/format/json'";
$dialogMsg = "''";
$toggleDivId = "''";
$jsFunction = "'redirecttocontroller(\\'timeformat\\');'";
$this->addElements(array($id, $timeformat, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
}
示例10: init
public function init()
{
$country_code = new Zend_Form_Element_Text('country_code');
$country_code->setLabel('Country code');
$country_code->setDescription('List of codes you can see here: http://framework.zend.com/manual/1.12/en/zend.locale.appendix.html');
$country_code->setRequired(true);
$this->addElement($country_code);
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Name');
$name->setRequired(true);
$this->addElement($name);
$is_active = new Zend_Form_Element_Checkbox('is_active');
$is_active->setLabel('Active');
$is_active->setRequired(true);
$this->addElement($is_active);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setLabel('Cancel');
$cancel->setAttrib('class', 'btn btn-gold')->setAttrib('style', 'color:black');
$cancel->setAttrib("onClick", "window.location = window.location.origin+'/locale/languages/'");
$this->addElement($cancel);
$submit = new Zend_Form_Element_Submit('save');
$submit->setAttrib('class', 'btn btn-primary');
$submit->setLabel('Confirm');
$this->setAction('')->setMethod('post')->addElement($submit);
}
示例11: init
public function init()
{
$this->setMethod('post');
//$this->setAttrib('action',DOMAIN.'language/edit');
$this->setAttrib('id', 'formid');
$this->setAttrib('name', 'servicedeskdepartment');
$id = new Zend_Form_Element_Hidden('id');
$servicedeskdepartment = new Zend_Form_Element_Text("service_desk_name");
$servicedeskdepartment->setLabel("Category");
$servicedeskdepartment->setAttrib('maxLength', 30);
$servicedeskdepartment->addFilter(new Zend_Filter_StringTrim());
$servicedeskdepartment->setRequired(true);
$servicedeskdepartment->addValidator('NotEmpty', false, array('messages' => 'Please enter category.'));
$servicedeskdepartment->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9\\- ]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid category.')));
$servicedeskdepartment->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_sd_depts', 'field' => 'service_desk_name', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" AND isactive=1')));
$servicedeskdepartment->getValidator('Db_NoRecordExists')->setMessage('Category name already exists.');
$description = new Zend_Form_Element_Textarea('description');
$description->setLabel("Description");
$description->setAttrib('rows', 10);
$description->setAttrib('cols', 50);
$description->setAttrib('maxlength', '200');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->setLabel('Save');
$this->addElements(array($id, $servicedeskdepartment, $description, $submit));
$this->setElementDecorators(array('ViewHelper'));
}
示例12: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$this->setName('applog');
$id = new Zend_Form_Element_Hidden('id');
$hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$timestamp = new Zend_Form_Element_Text('timestamp');
$timestamp->setLabel('timestamp');
$priorityName = new Zend_Form_Element_Text('priorityName');
$priorityName->setLabel('priorityName');
$priority = new Zend_Form_Element_Text('priority');
$priority->setLabel('priority');
$className = new Zend_Form_Element_Text('className');
$className->setLabel('className');
$message = new Zend_Form_Element_Textarea('message');
$message->setLabel('message');
$identity = new Zend_Form_Element_Text('identity');
$identity->setLabel('identity');
$httpReferer = new Zend_Form_Element_Textarea('HTTP_REFERER');
$httpReferer->setLabel('HTTP_REFERER');
$remoteAddr = new Zend_Form_Element_Text('REMOTE_ADDR');
$remoteAddr->setLabel('REMOTE_ADDR');
$requestMethod = new Zend_Form_Element_Text('REQUEST_METHOD');
$requestMethod->setLabel('REQUEST_METHOD');
$requestTime = new Zend_Form_Element_Text('REQUEST_TIME');
$requestTime->setLabel('REQUEST_TIME');
$mysqltimestamp = new Zend_Form_Element_Text('mysqltimestamp');
$mysqltimestamp->setLabel('mysqltimestamp');
$elements = array($id, $hash, $timestamp, $priorityName, $priority, $className, $message, $identity, $httpReferer, $remoteAddr, $requestMethod, $requestTime, $mysqltimestamp);
$this->addElements($elements);
$this->addElements(array($submit));
}
示例13: editUserPassword
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);
}
示例14: __construct
public function __construct($options = null)
{
parent::__construct();
$this->setName('layout_form');
$this->addElementPrefixPath('Oibs_Decorators', 'Oibs/Decorators/', 'decorator');
$this->removeDecorator('Errors');
$this->removeDecorator('HtmlTag');
$this->removeDecorator('Label');
//$this->setAction($this->_generateActionUrl());
$layout_select = new Zend_Form_Element_Select('layout_select');
$layout_select->setAttrib('onchange', '$("#submitLayoutSelection").click();');
$layout_select->removeDecorator('Errors');
$layout_select->removeDecorator('Label');
$layout_select->removeDecorator('HtmlTag');
/*foreach($options as $language)
$translation_select->addMultiOption($language['iso6391_lng'], $language['name_lng']);
*/
$layout_select->addMultiOption('default', 'Default');
$layout_select->addMultiOption('custom', 'Custom');
//$layout_select->setValue($this->_getCurrentLayoutSelect());
$layout_select->setValue('default');
$submit = new Zend_Form_Element_Submit('submitLayoutSelection');
$submit->removeDecorator('DtDdWrapper');
$submit->setAttrib('style', 'display: none;');
$this->addElements(array($layout_select, $submit));
}
示例15: init
public function init()
{
/*
$captcha = new Zend_Form_Element_Captcha('foo', array(
'label' => "Please verify you're a human",
'captcha' => 'Figlet',
'captchaOptions' => array(
'captcha' => 'Figlet',
'wordLen' => 6,
'timeout' => 300,
),
));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setlabel('submit')
->setIgnore(true);
$this->addElements(
array(
$captcha,$submit));
}*/
$recaptchakeys = Zend_Registry::get('config.recaptcha');
$recaptcha = new Zend_Service_Recaptcha($recaptchakeys['publickeys'], $recaptchakeys['privatekeys'], NULL, array('theme' => 'red'));
$captcha = new Zend_Form_Element_Captcha('captcha', array('label' => 'type the characters', 'captcha' => 'Recaptcha', 'captchaOptions' => array('captcha' => 'Recaptcha', 'service' => $recaptcha)));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setlabel('submit')->setIgnore(true);
$this->addElements(array($captcha, $submit));
}