當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Form_Element_Button::setLabel方法代碼示例

本文整理匯總了PHP中Zend_Form_Element_Button::setLabel方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Form_Element_Button::setLabel方法的具體用法?PHP Zend_Form_Element_Button::setLabel怎麽用?PHP Zend_Form_Element_Button::setLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Form_Element_Button的用法示例。


在下文中一共展示了Zend_Form_Element_Button::setLabel方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 public function init()
 {
     $media_library_model = new Cms_Model_MediaLibraries();
     $media_library = $media_library_model->getByPath($this->_attribs['media_library_path']);
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title');
     $title->setRequired(true);
     $title->addFilter('StringTrim');
     $title->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $this->addElement($title);
     $description = new Zend_Form_Element_Textarea('description');
     $description->setLabel('Description');
     $description->addFilter('StringTrim');
     $description->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $this->addElement($description);
     $original = new Zend_Form_Element_File('original');
     $original->addValidator('Count', false, 1);
     $original->addValidator('Extension', false, 'jpeg,jpg,png');
     $original->addFilter('Rename', $this->_attribs['file_name']);
     $original->setDestination(My_Utilities::getUploadMediaPathDiffSizes($this->_attribs['file_name'], $this->_attribs['media_library_path'], 'original'));
     $original->setLabel('Image:');
     $this->addElement($original);
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Potvrdi');
     $this->setAction('')->setMethod('post')->addElement($submit);
     $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+'/cms/medias/index/library_id/" . $media_library->id . "'");
     $this->addElement($cancel);
 }
開發者ID:zelimirus,項目名稱:yard,代碼行數:32,代碼來源:Medias.php

示例2: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'empleaves');
     $id = new Zend_Form_Element_Hidden('id');
     $userid = new Zend_Form_Element_Hidden('user_id');
     $emp_leave_limit = new Zend_Form_Element_Text('leave_limit');
     $emp_leave_limit->setAttrib('maxLength', 3);
     $emp_leave_limit->addFilter(new Zend_Filter_StringTrim());
     $emp_leave_limit->setRequired(true);
     $emp_leave_limit->addValidator('NotEmpty', false, array('messages' => 'Please enter leave limit for current year.'));
     $emp_leave_limit->addValidator("regex", true, array('pattern' => '/^(\\-?[1-9]|\\-?[1-9][0-9])$/', 'messages' => array('regexNotMatch' => 'Leave limit must be in the range of 0 to 100.')));
     $used_leaves = new Zend_Form_Element_Text('used_leaves');
     $used_leaves->setAttrib('maxLength', 3);
     $used_leaves->setAttrib('readonly', 'true');
     $used_leaves->setAttrib('onfocus', 'this.blur()');
     $alloted_year = new Zend_Form_Element_Text('alloted_year');
     $alloted_year->setAttrib('maxLength', 4);
     $alloted_year->setAttrib('readonly', 'true');
     $alloted_year->setAttrib('onfocus', 'this.blur()');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $submitbutton = new Zend_Form_Element_Button('submitbutton');
     $submitbutton->setAttrib('id', 'submitbuttons');
     $submitbutton->setLabel('Save');
     $this->addElements(array($id, $userid, $emp_leave_limit, $used_leaves, $alloted_year, $submit, $submitbutton));
     $this->setElementDecorators(array('ViewHelper'));
 }
開發者ID:uskumar33,項目名稱:DeltaONE,代碼行數:30,代碼來源:empleaves.php

示例3: init

 public function init()
 {
     // create elements
     $userId = new Zend_Form_Element_Hidden('id');
     $mail = new Zend_Form_Element_Text('email');
     $name = new Zend_Form_Element_Text('name');
     $radio = new Zend_Form_Element_Radio('radio');
     $file = new Zend_Form_Element_File('file');
     $multi = new Zend_Form_Element_MultiCheckbox('multi');
     $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'Figlet'));
     $submit = new Zend_Form_Element_Button('submit');
     $cancel = new Zend_Form_Element_Button('cancel');
     // config elements
     $mail->setLabel('Mail:')->setAttrib('placeholder', 'data please!')->setRequired(true)->setDescription('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis fringilla purus eget ante ornare vitae iaculis est varius.')->addValidator('emailAddress');
     $name->setLabel('Name:')->setRequired(true);
     $radio->setLabel('Radio:')->setMultiOptions(array('1' => PHP_EOL . 'test1', '2' => PHP_EOL . 'test2'))->setRequired(true);
     $file->setLabel('File:')->setRequired(true)->setDescription('Check file upload');
     $multiOptions = array('view' => PHP_EOL . 'view', 'edit' => PHP_EOL . 'edit', 'comment' => PHP_EOL . 'comment');
     $multi->setLabel('Multi:')->addValidator('Alpha')->setMultiOptions($multiOptions)->setRequired(true);
     $captcha->setLabel('Captcha:')->setRequired(true)->setDescription("This is a test");
     $submit->setLabel('Save')->setAttrib('type', 'submit');
     $cancel->setLabel('Cancel');
     // add elements
     $this->addElements(array($userId, $mail, $name, $radio, $file, $captcha, $multi, $submit, $cancel));
     // add display group
     $this->addDisplayGroup(array('email', 'name', 'radio', 'multi', 'file', 'captcha', 'submit', 'cancel'), 'users');
     // set decorators
     EasyBib_Form_Decorator::setFormDecorator($this, EasyBib_Form_Decorator::BOOTSTRAP_MINIMAL, 'submit', 'cancel');
 }
開發者ID:cliftonscott,項目名稱:EasyBib_Form_Decorator,代碼行數:29,代碼來源:ExampleForm.php

示例4: init

 public function init()
 {
     $menu_items_model = new Admin_Model_MenuItems();
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Usergroup name')->setRequired(true)->setAttrib("class", "form-control")->setAttrib("style", "width:200px");
     $menu_items = new Zend_Form_Element_Multiselect('admin_menu_item_id');
     $menu_items->addValidator(new Zend_Validate_Digits(), true);
     $menu_items->setLabel('Menu Items: ');
     $menu_items->setAttrib("class", "select2");
     $menu_items->setAttrib("data-placeholder", "Choose...");
     $menu_items->setAttrib("style", "width:200px");
     $menu_items->addMultiOptions($menu_items_model->getForDropDown());
     $permit = new Zend_Form_Element_MultiCheckbox('permit');
     $permit->setLabel('Available resources ');
     $resources_table = new Admin_Model_Resources();
     foreach ($resources_table->getAll() as $resource) {
         $permit->addMultiOption((string) $resource->id, ' ' . $resource->name);
     }
     $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+'/admin/admin-usersgroups/'");
     $submit = new Zend_Form_Element_Submit('save');
     $submit->setAttrib('class', 'btn btn-primary');
     $submit->setLabel('Confirm');
     $this->setAction('')->setMethod('post')->addElement($name)->addElement($menu_items)->addElement($permit)->addElement($cancel)->addElement($submit);
 }
開發者ID:zelimirus,項目名稱:yard,代碼行數:27,代碼來源:AdminUsersgroups.php

示例5: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'frm_interview_rpt');
     $interview_date = new Zend_Form_Element_Text("interview_date");
     $interview_date->setLabel("Interview Date");
     $interview_date->setAttrib('readonly', 'readonly');
     $req_id = new Zend_Form_Element_Select("req_id");
     $req_id->setRegisterInArrayValidator(false);
     $req_id->setLabel("Requisition Code")->addMultiOptions(array('' => 'Select Requisition Code'));
     $department_id = new Zend_Form_Element_Select("department_id");
     $department_id->setLabel("Department");
     $department_id->setRegisterInArrayValidator(false);
     $department_id->addMultiOptions(array('' => 'Select Department'));
     $interviewer_id = new Zend_Form_Element_Text("interviewer_id");
     $interviewer_id->setLabel("Interviewer");
     $interviewer_id->setAttrib('name', '');
     $interviewer_id->setAttrib('id', 'idinterviewer_id');
     $createdby = new Zend_Form_Element_Text("createdby");
     $createdby->setLabel("Interview Planned By");
     $createdby->setAttrib('name', '');
     $createdby->setAttrib('id', 'idcreatedby');
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setAttrib('id', 'idsubmitbutton');
     $submit->setLabel('Report');
     $this->addElements(array($submit, $interview_date, $req_id, $department_id, $interviewer_id, $createdby));
     $this->setElementDecorators(array('ViewHelper'));
 }
開發者ID:lukkyrich,項目名稱:sentrifugo,代碼行數:29,代碼來源:Interviewroundrpt.php

示例6: init

 public function init()
 {
     $this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setAttrib('class', 'form_create_tai_lieu');
     $this->addElement('Hidden', 'search', array('value' => 1));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Chuyên đề (*)')->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');
     $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'));
     $thoi_gian = new Zend_Form_Element_Text('thoi_gian');
     $thoi_gian->setLabel('Ngày tổ chức')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'thoi_gian'));
     $dia_diem = new Zend_Form_Element_Text('dia_diem');
     $dia_diem->setLabel('Địa điểm')->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 medium-input');
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Upload file')->setDescription('(*.doc, *.docx, *.pdf , < 10MB )')->setDestination(BASE_PATH . '/upload/files/sinh_hoat_chuyen_de')->addValidator(new Zend_Validate_File_Extension(array('doc,docx,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->setLabel('Lưu và tiếp tục')->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->setLabel('Lưu và thoát')->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' => 'sinh-hoat-chuyen-de', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Không lưu')->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($ten, $noi_dung, $thoi_gian, $dia_diem, $file, $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'));
 }
開發者ID:nhochong,項目名稱:qlkh-sgu,代碼行數:26,代碼來源:SHCD.php

示例7: init

 public function init()
 {
     $this->setName('dept_report')->setMethod('post');
     $nams = array();
     for ($i = 2005; $i < 2030; $i++) {
         $nams[$i] = $i;
     }
     $namOption = array("multiOptions" => $nams);
     $from = new Zend_Form_Element_Select('dept_from', $namOption);
     $from->setLabel('Từ : ')->setValue(date('Y'))->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'from', 'style' => 'margin-left : 23px'))))->setAttribs(array('style' => 'width:10%'));
     $to = new Zend_Form_Element_Select('dept_to', $namOption);
     $to->setLabel('Đến : ')->setValue(date('Y') + 1)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'to'))))->setAttribs(array('style' => 'width:10%'));
     $don_vi = new Default_Model_DonVi();
     $dv = $don_vi->getDSDVSGU();
     unset($dv['1']);
     $dvOptions = array("multiOptions" => $dv);
     $ma_don_vi = new Zend_Form_Element_Select('dept_don_vi', $dvOptions);
     $ma_don_vi->setRequired(true)->setLabel('Đơn vị : ')->setValue('0')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'style' => 'margin-bottom: 10px;'))))->setAttribs(array('id' => 'dept_don_vi', 'style' => 'width : 50%'));
     $amounts = array();
     for ($i = 1; $i <= 10; $i++) {
         $amounts[$i * 10] = $i * 10;
     }
     $amountOptions = array("multiOptions" => $amounts);
     $amount = new Zend_Form_Element_Select('dept_amount', $amountOptions);
     $amount->setLabel('Số lượng GV : ')->setValue(10)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'amount'))));
     $submit = new Zend_Form_Element_Button('dept_submit');
     $submit->setLabel('Xem');
     $submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span', 'align' => 'left')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'style' => 'margin-left : 10px'))));
     $this->addElements(array($ma_don_vi, $from, $to, $amount, $submit));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'dept_report')), 'Form'));
 }
開發者ID:nhochong,項目名稱:qlkh-sgu,代碼行數:31,代碼來源:ReportDept.php

示例8: init

 public function init()
 {
     $this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setAttrib('class', 'form_create_bai_bao');
     $this->addElement('Hidden', 'search', array('value' => 1));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên sản phẩm (*)')->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');
     $so_luong_thanh_vien = new Zend_Form_Element_Text('so_luong_thanh_vien');
     $so_luong_thanh_vien->setRequired(true)->setLabel('Số lượng thành viên')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'so_luong_thanh_vien'))->setAttrib('class', 'text-input small-input');
     $mo_ta = new Zend_Form_Element_Textarea('mo_ta');
     $mo_ta->setLabel('Nội dung')->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', 'class' => 'text-input textarea'));
     $thong_tin = new Zend_Form_Element_Text('thong_tin');
     $thong_tin->setRequired(true)->setLabel('Thông tin')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'thong_tin'))->setAttrib('class', 'text-input large-input');
     $thangOptions = Default_Model_Constraints::lichct_thang();
     $thang = new Zend_Form_Element_Select('thang');
     $thang->setLabel('Tháng')->addMultiOptions($thangOptions)->setValue(date('m'))->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'))));
     $namOptions = Default_Model_Constraints::years();
     $nam = new Zend_Form_Element_Select('nam');
     $nam->setLabel('Năm')->addMultiOptions($namOptions)->setValue(date('Y'))->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'))));
     $dot = new Zend_Form_Element_Text('dot');
     $dot->setRequired(true)->setLabel('Đợt')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'dot'));
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Upload file')->setDescription('(*.doc, *.docx, *.pdf , < 10MB )')->setDestination(BASE_PATH . '/upload/files/bai_bao')->addValidator(new Zend_Validate_File_Extension(array('doc,docx,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->setLabel('Lưu và tiếp tục')->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->setLabel('Lưu và thoát')->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' => 'bai-bao', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Không lưu')->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($ten, $thong_tin, $mo_ta, $so_luong_thanh_vien, $thang, $nam, $dot, $file, $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'));
 }
開發者ID:nhochong,項目名稱:qlkh-sgu,代碼行數:34,代碼來源:Create_BK.php

示例9: init

 public function init()
 {
     $settings = Engine_Api::_()->getApi('settings', 'core');
     // Init form
     $this->setDescription('Modify your invite settings for your members.');
     // Init subject
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Subject')->setDescription("This is the subject line of emails sent to invited people.  Use %siteName% to include your site's name.")->setValue($settings->getSetting('invite.subject', ''))->setRequired(true)->setAttrib('size', '90%');
     // Init from fields
     $fromName = new Zend_Form_Element_Text('fromName');
     $fromName->setLabel('From (name)')->setDescription('Whom the invite email is shown as being from (usually your website name)')->setValue($settings->getSetting('invite.fromName', ''))->setRequired(true)->setAttrib('size', '90%');
     $fromEmail = new Zend_Form_Element_Text('fromEmail');
     $fromEmail->setLabel('From (email)')->setDescription('The "Reply-To" address for emails')->setValue($settings->getSetting('invite.fromEmail', 'noreply@' . $_SERVER['HTTP_HOST']))->addValidator('emailAddress', true)->setRequired(true)->setAttrib('size', '90%');
     // Init allow custom invite message
     $allowCustomMessage = new Zend_Form_Element_Checkbox('allowCustomMessage');
     $allowCustomMessage->setLabel('Allow custom invite message?')->setDescription('If disabled, the invite email will use the message below.')->setValue($settings->getSetting('invite.allowCustomMessage', true))->setAttrib('style', 'width: auto;')->setCheckedValue('1');
     // Init default invite message
     $message = new Zend_Form_Element_Textarea('message');
     $message->setLabel('Default Invite Message')->setDescription('Use %invite_url% to include the invite URL')->setValue($settings->getSetting('invite.message', '%invite_url%'))->setAttrib('rows', 6)->setAttrib('cols', 75);
     //
     // Init submit
     $submit = new Zend_Form_Element_Button('submit');
     $submit->setLabel('Save Settings')->setAttrib('type', 'submit')->removeDecorator('Errors');
     // Add elements
     $this->addElements(array($subject, $fromName, $fromEmail, $allowCustomMessage, $message, $submit));
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:26,代碼來源:AdminSettings.php

示例10: init

 public function init()
 {
     $model_countries = new Locale_Model_Languages();
     $model_t_keys = new Locale_Model_TranslateKeys();
     $key_id = new Zend_Form_Element_Select('key_id');
     $key_id->addValidator(new Zend_Validate_Digits(), true);
     $key_id->setLabel('Key');
     $key_id->setRequired(true);
     $key_id->setMultiOptions($model_t_keys->getIdAndKeyArray(true));
     $this->addElement($key_id);
     $country_id = new Zend_Form_Element_Select('language_id');
     $country_id->addValidator(new Zend_Validate_Digits(), true);
     $country_id->setLabel('Language');
     $country_id->setRequired(true);
     $country_id->setMultiOptions($model_countries->getIdAndNameArray());
     $this->addElement($country_id);
     $value = new My_Form_Element_CKEditor('value');
     $value->setLabel('Translation');
     $value->setDescription('Tags for dynamic values: {1}, {2}, {3}...Double quotes (")are not allowed');
     $this->addElement($value);
     $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/translate-messages/'");
     $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);
 }
開發者ID:zelimirus,項目名稱:yard,代碼行數:30,代碼來源:TranslateMessages.php

示例11: init

 public function init()
 {
     $this->setName('popup_gv')->setMethod('post');
     $ma_gv = new Zend_Form_Element_Text('popup_gv_ma');
     $ma_gv->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_StringLength(0, 10))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 80%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'onblur' => 'kiem_tra_gv(this)'));
     $ho_ten = new Zend_Form_Element_Text('popup_gv_ho_ten');
     $ho_ten->setLabel('Họ tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 120))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
     $chuc_vu = new Zend_Form_Element_Text('popup_gv_chuc_vu');
     $chuc_vu->setLabel('Chức vụ')->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'))))->setAttrib('class', 'text-input medium-input');
     $don_vi = new Default_Model_DonVi();
     $dvOptions = array("multiOptions" => $don_vi->getDSDV());
     $ma_don_vi = new Zend_Form_Element_Select('popup_gv_ma_don_vi', $dvOptions);
     $ma_don_vi->setRequired(true)->setLabel('Đơn vị (*)')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $hoc_vi = new Default_Model_HocVi();
     $hvOptions = array("multiOptions" => $hoc_vi->getDSHV());
     $ma_hoc_vi = new Zend_Form_Element_Select('popup_gv_ma_hoc_vi', $hvOptions);
     $ma_hoc_vi->setRequired(true)->setLabel('Học vị (*)')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
     $email = new Zend_Form_Element_Text('popup_gv_email');
     $email->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_EmailAddress())->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('class' => 'text-input', 'id' => 'email'));
     $so_dien_thoai = new Zend_Form_Element_Text('popup_gv_so_dien_thoai');
     $so_dien_thoai->setLabel('Số điện thoại')->addFilter('StringTrim')->addValidator(new Zend_Validate_Int())->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('class' => 'text-input', 'onkeypress' => 'return inputNumber(event)'));
     $submit = new Zend_Form_Element_Button('popup_gv_submit');
     $submit->setLabel('Lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'add_gv(this.form)'));
     $this->addElements(array($ma_gv, $ho_ten, $ma_don_vi, $ma_hoc_vi, $chuc_vu, $email, $so_dien_thoai, $submit));
     $this->addDisplayGroup(array('popup_gv_submit'), 'btn_submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'popup_gv')), 'Form'));
 }
開發者ID:nhochong,項目名稱:qlkh-sgu,代碼行數:27,代碼來源:PopupGV.php

示例12: init

 public function init()
 {
     $this->clearDecorators()->addDecorator('FormElements')->addDecorator('Form')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'search'))->addDecorator('HtmlTag2', array('tag' => 'div', 'class' => 'clear'));
     $this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'));
     $provider = new Zend_Form_Element_Text('name');
     $provider->setLabel('Provider Name')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title Name')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
     $levelMultiOptions = array(0 => ' ');
     /*      $table = $this->_helper->api()->getItemTable('user');
           $select = $viewer->membership()->getMembersSelect('user_id');
           $friends = $table->fetchAll($select);*/
     $MultiOptions = array('' => 'All', 'email' => 'email', 'social' => 'social');
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Provider Type')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions($MultiOptions);
     $enabled = new Zend_Form_Element_Select('enable');
     $enabled->setLabel('Enabled/Disabled')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions(array('-1' => 'All', '0' => 'Disabled', '1' => 'Enabled'))->setValue('-1');
     $submit = new Zend_Form_Element_Button('search', array('type' => 'submit'));
     $submit->setLabel('Search')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'buttons'))->addDecorator('HtmlTag2', array('tag' => 'div'));
     $this->addElement('Hidden', 'order', array('order' => 10001));
     $this->addElement('Hidden', 'order_direction', array('order' => 10002));
     $this->addElements(array($provider, $title, $type, $enabled, $submit));
     // Set default action
     $this->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:25,代碼來源:Filter.php

示例13: init

 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $thangOptions = Default_Model_Constraints::lichct_thang();
     $thang = new Zend_Form_Element_Select('thang');
     $thang->setLabel('Tháng (*)')->setValue(date('m'))->setRequired(true)->addMultiOptions($thangOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
     $this->addElement($thang);
     $tuanOptions = Default_Model_Constraints::lichct_tuan();
     $tuan = new Zend_Form_Element_Select('tuan');
     $tuan->setLabel('Tuần (*)')->setRequired(true)->addMultiOptions($tuanOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
     $this->addElement($tuan);
     $ngay_bat_dau = new Zend_Form_Element_Text('ngay_bat_dau');
     $ngay_bat_dau->setLabel('Ngày bắt đầu (*)')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'ngay_bat_dau'));
     $this->addElement($ngay_bat_dau);
     $ngay_ket_thuc = new Zend_Form_Element_Text('ngay_ket_thuc');
     $ngay_ket_thuc->setLabel('Ngày kết thúc (*)')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'ngay_ket_thuc'));
     $this->addElement($ngay_ket_thuc);
     $ghi_chu = new Zend_Form_Element_Textarea('ghi_chu');
     $ghi_chu->setLabel('Ghi chú')->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' => 'ghi_chu', 'class' => 'text-input textarea', 'rows' => 4));
     $this->addElement($ghi_chu);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Lưu')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
     $this->addElement($submit);
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'lich-cong-tac', 'action' => 'index'), null, true);
     $cancel = new Zend_Form_Element_Button('cancel');
     $cancel->setLabel('Không lưu')->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->addElement($cancel);
     $this->addDisplayGroup(array('submit', 'cancel'), 'submitbtn', 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'));
 }
開發者ID:nhochong,項目名稱:qlkh-sgu,代碼行數:31,代碼來源:Create.php

示例14: init

 public function init()
 {
     $this->setName('year_report')->setMethod('post');
     $nams = array();
     for ($i = 2005; $i < 2030; $i++) {
         $nams[$i] = $i;
     }
     $namOption = array("multiOptions" => $nams);
     $from = new Zend_Form_Element_Select('year_from', $namOption);
     $from->setLabel('Từ : ')->setValue(date('Y'))->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'from'))))->setAttribs(array('style' => 'width:10%'));
     $to = new Zend_Form_Element_Select('year_to', $namOption);
     $to->setLabel('Đến : ')->setValue(date('Y') + 1)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'to'))))->setAttribs(array('style' => 'width:10%'));
     $amounts = array();
     for ($i = 1; $i <= 10; $i++) {
         $amounts[$i * 10] = $i * 10;
     }
     $amountOptions = array("multiOptions" => $amounts);
     $amount = new Zend_Form_Element_Select('year_amount', $amountOptions);
     $amount->setLabel('Số lượng GV : ')->setValue(10)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'amount'))));
     $submit = new Zend_Form_Element_Button('year_submit');
     $submit->setLabel('Xem');
     $submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span', 'align' => 'left')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'style' => 'margin-left : 10px'))));
     $this->addElements(array($from, $to, $amount, $submit));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'year_report')), 'Form'));
 }
開發者ID:nhochong,項目名稱:qlkh-sgu,代碼行數:25,代碼來源:ReportYear.php

示例15: init

 public function init()
 {
     $this->setName('f3')->setMethod('get');
     $linh_vuc = new Default_Model_LinhVuc();
     $lv = $linh_vuc->getDSLV();
     $lv = array('0' => '========= Tất cả =========') + $lv;
     $lvOptions = array("multiOptions" => $lv);
     $ma_linh_vuc = new Zend_Form_Element_Select('ma_linh_vuc', $lvOptions);
     $ma_linh_vuc->setRequired(true)->setLabel('Lĩnh vực')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'ma_linh_vuc'));
     $nams = Default_Model_Constraints::nam();
     $nams = array('0' => '== Tất cả ==') + $nams;
     ksort($nams);
     $namOption = array("multiOptions" => $nams);
     $nam = new Zend_Form_Element_Select('nam', $namOption);
     $nam->setLabel('Năm')->setValue(date('Y'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td'))))->setAttribs(array('id' => 'nam'));
     $submit = new Zend_Form_Element_Submit('loc');
     $submit->setLabel('Lọc')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button'));
     $url = new Zend_View_Helper_Url();
     $link = $url->url(array('module' => 'admin', 'controller' => 'hoi-dong', 'action' => 'danh-sach-hdd'), null, true);
     $reset = new Zend_Form_Element_Button('reset');
     $reset->setLabel('Làm mới')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'td', 'class' => 'filter_btn_r'))))->setAttribs(array('class' => 'button', 'id' => 'reset', 'onclick' => 'window.location.href="' . $link . '"'));
     $this->addElements(array($ma_linh_vuc, $nam, $submit, $reset));
     // Element: order
     $this->addElement('Hidden', 'order', array('order' => 10004));
     // Element: direction
     $this->addElement('Hidden', 'direction', array('order' => 10005));
     $this->addDisplayGroup(array('ma_linh_vuc', 'nam', 'loc', 'reset'), 'group1', array('order' => 1, 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'tr', 'align' => 'left', 'class' => 'text')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'filter_hdd', 'style' => 'width : 65%')), 'Form'));
 }
開發者ID:nhochong,項目名稱:qlkh-sgu,代碼行數:29,代碼來源:FilterHDD.php


注:本文中的Zend_Form_Element_Button::setLabel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。