当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element_Radio::setRequired方法代码示例

本文整理汇总了PHP中Zend_Form_Element_Radio::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Radio::setRequired方法的具体用法?PHP Zend_Form_Element_Radio::setRequired怎么用?PHP Zend_Form_Element_Radio::setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element_Radio的用法示例。


在下文中一共展示了Zend_Form_Element_Radio::setRequired方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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');
     $cateOptions = Khcn_Api::_()->getDbTable('loai_audio', 'default')->getListAssoc();
     $loai_audio_id = new Zend_Form_Element_Select('loai_audio_id');
     $loai_audio_id->setLabel('Loại (*)')->addMultiOptions($cateOptions)->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');
     $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');
     $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'))));
     $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, $loai_audio_id, $noi_dung, $soundcloud_embed, $trang_thai, $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,项目名称:sdcd,代码行数:26,代码来源:Audio.php

示例2: setForm

		function setForm()
		{
			$form = new Zend_Form;
			$form->setMethod('post')->setAction('');
			//$this->setAttrib('enctype','multipart/form-data');
			
			$file = new Zend_Form_Element_File('video_file');
			//$file->setAttrib('class','file');
			$file->setLabel('video_file');
           	$file->setRequired(true);
           	
			$video_title = new Zend_Form_Element_Text('video_title');
			$video_title ->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tiêu đề không được để trống'));
			
			$video_thumbnail=new Zend_Form_Element_Textarea('video_thumbnail');
			$video_thumbnail->removeDecorator('HtmlTag')->removeDecorator('Label');
			
			$video_description = new Zend_Form_Element_Textarea('video_description');
			$video_description->setAttrib('rows','7');
			$video_description ->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Mô tả không được để trống'));
			
			$is_active = new Zend_Form_Element_Radio('is_active');
			$is_active->setRequired(true)
					->setLabel('is_active')
					->setMultiOptions(array("1" => "Có","0" => "Không"));
			
			$file->removeDecorator('HtmlTag')->removeDecorator('Label');	
			$video_title->removeDecorator('HtmlTag')->removeDecorator('Label');	
			$video_description->removeDecorator('HtmlTag')->removeDecorator('Label');
			$is_active->removeDecorator('HtmlTag')->removeDecorator('Label');		
			
			$form->addElements(array($file,$video_title,$video_description,$is_active,$video_thumbnail));
			return $form;
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:34,代码来源:VideoController.php

示例3: init

 public function init()
 {
     // profissional_beleza_id
     $profissional_beleza_id = new Zend_Form_Element_Radio("profissional_beleza_id");
     $profissional_beleza_id->setLabel("Selecione o profissional desejado: ");
     $profissional_beleza_id->setRegisterInArrayValidator(false);
     $profissional_beleza_id->setRequired();
     $profissional_beleza_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
     // agenda_data
     $agenda_data = new Zend_Form_Element_Text("agenda_data");
     $agenda_data->setLabel("Selecione a data: ");
     $agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off'));
     $agenda_data->setRequired();
     $agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     // agenda_hora
     $agenda_hora = new Zend_Form_Element_Select("agenda_hora");
     $agenda_hora->setLabel('Selecione a hora: ');
     $agenda_hora->setAttribs(array('class' => 'form-control'));
     $agenda_hora->setMultiOptions(array('' => 'Horários'));
     $agenda_hora->setRequired();
     $agenda_hora->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
     $agenda_hora->setRegisterInArrayValidator(false);
     // agenda_observacao
     $agenda_observacao = new Zend_Form_Element_Textarea("agenda_observacao");
     $agenda_observacao->setLabel("Observações: ");
     $agenda_observacao->setAttribs(array('class' => 'form-control', 'rows' => 7, 'placeholder' => 'Informe alguma observação, por exemplo, alguma preferência de produto, etc.'));
     // salao_id
     $salao_id = new Zend_Form_Element_Hidden('salao_id');
     // especialidade_id
     $especialidade_id = new Zend_Form_Element_Hidden("especialidade_id");
     // usuario_id
     $usuario_id = new Zend_Form_Element_Hidden("usuario_id");
     $this->addElements(array($profissional_beleza_id, $agenda_data, $agenda_hora, $agenda_observacao, $salao_id, $especialidade_id, $usuario_id));
     parent::init();
 }
开发者ID:nandorodpires2,项目名称:homemakes,代码行数:35,代码来源:Agendar.php

示例4: init

 public function init()
 {
     // Set form attributes
     $this->addElement('Text', 'contact', array('label' => 'Contact Form Email', 'description' => 'Enter the email address you want contact form messages to be sent to.', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'contact-element', 'style' => 'width: 75%')), array('Label', array('tag' => 'td', 'id' => 'contact-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'contact-wrapper'))), 'attribs' => array('class' => 'text-input')));
     // Element: mail_name
     $this->addElement('Text', 'name', array('label' => 'From Name', 'description' => 'Enter the name you want the emails from the system to come from in the field below.', 'value' => 'Site Admin', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'name-element')), array('Label', array('tag' => 'td', 'id' => 'name-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'name-wrapper'))), 'attribs' => array('class' => 'text-input')));
     // Element: mail_from
     $this->addElement('Text', 'from', array('label' => 'From Address', 'description' => 'Enter the email address you want the emails from the system to come from in the field below.', 'value' => 'no-reply@' . $_SERVER['HTTP_HOST'], 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'from-element')), array('Label', array('tag' => 'td', 'id' => 'from-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'from-wrapper'))), 'attribs' => array('class' => 'text-input')));
     $mailSmtpOptions = array("multiOptions" => array('0' => 'Use the built-in mail() function', '1' => 'Send emails through an SMTP server'));
     $mail_smtp = new Zend_Form_Element_Radio('mail_smtp', $mailSmtpOptions);
     $mail_smtp->setRequired(true)->setLabel('Send through SMTP')->setDescription('Emails typically get sent through the web server using the PHP mail() function.  Alternatively you can have emails sent out using SMTP, usually requiring a username and password, and optionally using an external mail server.')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp-wrapper', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'mail_smtp'));
     $this->addElement($mail_smtp);
     // Element: mail_smtp_server
     $this->addElement('Text', 'mail_smtp_server', array('label' => 'SMTP Server Address', 'required' => false, 'value' => '127.0.0.1', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_server-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_server-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_server-wrapper'))), 'attribs' => array('class' => 'text-input')));
     // Element: mail_smtp_port
     $this->addElement('Text', 'mail_smtp_port', array('label' => 'SMTP Server Port', 'description' => 'Default: 25. Also commonly on port 465 (SMTP over SSL) or port 587.', 'required' => false, 'value' => '25', 'validators' => array('Int'), 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_port-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_port-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_port-wrapper'))), 'attribs' => array('class' => 'text-input')));
     $authenticationOptions = array("multiOptions" => array(1 => 'Yes', 0 => 'No'));
     $mail_smtp_authentication = new Zend_Form_Element_Radio('mail_smtp_authentication', $authenticationOptions);
     $mail_smtp_authentication->setRequired(false)->setLabel('SMTP Authentication?')->setDescription('Does your SMTP Server require authentication?')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_authentication-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_authentication-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_authentication-wrapper', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'mail_smtp_authentication'));
     $this->addElement($mail_smtp_authentication);
     // Element: mail_smtp_username
     $this->addElement('Text', 'mail_smtp_username', array('label' => 'SMTP Username', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_username-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_username-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_username-wrapper'))), 'attribs' => array('class' => 'text-input')));
     // Element: mail_smtp_password
     $this->addElement('Password', 'mail_smtp_password', array('label' => 'SMTP Password', 'description' => 'Leave blank to use previous.', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_password-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_password-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_password-wrapper'))), 'attribs' => array('class' => 'text-input')));
     $sslOptions = array("multiOptions" => array('' => 'None', 'tls' => 'TLS', 'ssl' => 'SSL'));
     $mail_smtp_ssl = new Zend_Form_Element_Radio('mail_smtp_ssl', $sslOptions);
     $mail_smtp_ssl->setRequired(false)->setLabel('Use SSL or TLS?')->setValue('')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_ssl-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_ssl-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_ssl-wrapper', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'mail_smtp_ssl'));
     $this->addElement($mail_smtp_ssl);
     // Element: submit
     $this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span', 'id' => 'submit-element')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'id' => 'submit-wrapper'))), 'attribs' => array('class' => 'button')));
     $this->addDisplayGroup(array('submit'), 'btnsubmit', 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' => 'mail_settings')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:33,代码来源:Settings.php

示例5: __construct

 public function __construct($forSearch = false)
 {
     parent::__construct();
     if ($forSearch) {
         $radioKind = new Zend_Form_Element_Radio('kind');
         $radioKind->addMultiOptions(array('and' => 'and', 'or' => 'or'));
         $radioKind->setValue('and');
         $radioKind->setLabel('Search field combination:');
         $radioKind->setRequired(true);
         $this->addElement($radioKind);
     }
     $this->addElement('hidden', CalibrationExercise::COL_ID, array('required' => true));
     $this->addElement('hidden', CalibrationExercise::COL_WORKSHOP_ID, array('required' => true));
     $valiAlphaWhiteSpace = new Zend_Validate_Alpha(true);
     $valiAlnumWhiteSpace = new Zend_Validate_Alnum(true);
     $this->addElement('text', CalibrationExercise::COL_NAME, array('label' => 'Calibration exercise name:', 'required' => true, 'validators' => array($valiAlnumWhiteSpace)));
     $this->addElement('text', CalibrationExercise::COL_DESCRIPTION, array('label' => 'Description:', 'required' => true, 'validators' => array($valiAlnumWhiteSpace)));
     $this->addElement(new Default_Form_Element_KeyTableSelect(CalibrationExercise::COL_KEY_TABLE_ID, array('label' => 'Protocol:', 'required' => true, 'validators' => array($valiAlnumWhiteSpace))));
     $this->addElement(new Default_Form_Element_ExpertiseSelect(CalibrationExercise::COL_EXPERTISE_ID, array('label' => 'Expertise:', 'required' => true, 'validators' => array($valiAlnumWhiteSpace))));
     $this->addElement('checkbox', CalibrationExercise::COL_COMPAREABLE, array('label' => 'Show comparable other user/group annotations/references:', 'required' => true));
     $this->addElement('checkbox', CalibrationExercise::COL_RANDOMIZED, array('label' => 'Allow adding images to image set at random:', 'required' => true));
     $this->addElement('submit', 'save', array('label' => 'Save'));
     $this->addElement('hidden', 'Token');
     $this->addElement('hidden', CalibrationExercise::COL_IS_STOPPED);
 }
开发者ID:blackskaarj,项目名称:webgr,代码行数:25,代码来源:EditAllElements.php

示例6: init

 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addFilter('Int');
     $ma = new Zend_Form_Element_Text('ma');
     $ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToUpper')->addValidator(new Zend_Validate_StringLength(0, 10))->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'))))->setAttribs(array('class' => 'text-input'));
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 250))->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');
     $ofSGUOptions = array("multiOptions" => array('1' => 'Thuộc', '0' => 'Không thuộc'));
     $thuoc_sgu = new Zend_Form_Element_Radio('thuoc_sgu', $ofSGUOptions);
     $thuoc_sgu->setRequired(true)->setLabel('Thuộc SGU')->setValue('1')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'thuoc_sgu'));
     $deptOptions = array("multiOptions" => array('1' => 'Khoa - Bộ môn TT', '0' => 'Phòng ban - Trung tâm'));
     $la_khoa = new Zend_Form_Element_Radio('la_khoa', $deptOptions);
     $la_khoa->setRequired(true)->setLabel('Loại đơn vị')->setValue('1')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'la_khoa', 'class' => 'radio_inline'))));
     $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' => 'don-vi', '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($id, $ma, $ten, $thuoc_sgu, $la_khoa, $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')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'don_vi')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:27,代码来源:DonVi.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
     $radioKind = new Zend_Form_Element_Radio('kind');
     $radioKind->addMultiOptions(array('and' => 'and', 'or' => 'or'));
     $radioKind->setValue('and');
     $radioKind->setLabel('Search field combination:');
     $radioKind->setRequired(true);
     $this->addElement($radioKind);
     $fishSampleCode = new Zend_Form_Element_Text(Fish::COL_SAMPLE_CODE);
     $fishSampleCode->setLabel('Fish Sample Code:');
     //---------------------------------------------------------
     //read the available image attributes from attribute descriptor+group image
     $metadata = new Default_MetaData();
     $fishRowSetArray = $metadata->getAttributesComplete('fish');
     //----------------------------------------------------------
     $this->addDynamicElements($fishRowSetArray, true);
     $this->addElement($fishSampleCode);
     $this->addElement('submit', 'submit', array('label' => 'search'));
     $this->addElement('hidden', 'Token');
     $this->setElementFilters(array('StringTrim'));
     //#####################new###################################
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'dynamic_form')), array('Description', array('placement' => 'prepend')), 'Form'));
     $this->setElementDecorators(array('ViewHelper', 'Errors', array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td')), array('Label', array('tag' => 'td')), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))));
     $this->setSubFormDecorators(array('FormElements', array('HtmlTag', array('tag' => 'tr'))));
     foreach ($this->getSubForms() as $index => $subform) {
         $subform->setElementDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'element')), array('Label', array('tag' => 'td'), array(array('row' => 'HtmlTag'), array('tag' => 'tr')))));
     }
     $this->submit->setDecorators(array(array('decorator' => 'ViewHelper', 'options' => array('helper' => 'formSubmit')), array('decorator' => array('td' => 'HtmlTag'), 'options' => array('tag' => 'td', 'colspan' => 2)), array('decorator' => array('tr' => 'HtmlTag'), 'options' => array('tag' => 'tr'))));
     //###########################################################
 }
开发者ID:blackskaarj,项目名称:webgr,代码行数:31,代码来源:Search.php

示例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'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:35,代码来源:TinTuc.php

示例9: init

 public function init()
 {
     $this->setName('f2')->setMethod('post');
     $ten = new Zend_Form_Element_Text('ten');
     $ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->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'))))->setAttribs(array('class' => 'text-input medium-input'));
     $statusOptions = array("multiOptions" => array(1 => 'Thuộc SGU', 0 => 'Liên kết trang mạng'));
     $is_sgu = new Zend_Form_Element_Radio('is_sgu', $statusOptions);
     $is_sgu->setRequired(true)->setLabel('Liên kết')->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'))));
     $url = new Zend_Form_Element_Text('url');
     $url->setLabel('Url (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->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');
     $file = new Zend_Form_Element_File('file');
     $file->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/small/images/lien_ket')->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'))));
     $maxOrder = Khcn_Api::_()->getDbTable('lien_ket', 'default')->getMaxOrderItem();
     $order = new Zend_Form_Element_Text('order');
     $order->setLabel('Thứ tự *')->setValue($maxOrder->order + 1)->addValidator(new Zend_Validate_Int())->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'))))->setAttribs(array('class' => 'text-input tinysmall-input'));
     $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' => 'lien-ket', '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($ten, $is_sgu, $url, $file, $order, $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')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'lien_ket')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:27,代码来源:LienKet.php

示例10: setForm

		function setForm()
		{
			$form=new Zend_Form;
			 
			$form->setMethod('post')->setAction('');
			
			$image_name = new Zend_Form_Element_Text('image_name');
			$image_name->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tên ảnh không được để trống'));
			
			$image_link = new Zend_Form_Element_Textarea('image_link');
			$image_link->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Hình ảnh không được để trống'));
			
			
			$is_active = new Zend_Form_Element_Radio('is_active');
			$is_active->setRequired(true)
					->setLabel('is_active')
					->setMultiOptions(array("1" => "Có","0" => "Không"));
																	  
			$image_name->removeDecorator('HtmlTag')->removeDecorator('Label');
			$image_link->removeDecorator('HtmlTag')->removeDecorator('Label');
			$is_active->removeDecorator('HtmlTag')->removeDecorator('Label');	
			
			$form->addElements(array($image_name,$image_link,$is_active));
			return $form;
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:25,代码来源:ImageController.php

示例11: init

 public function init()
 {
     $this->setMethod("post");
     $title = new Zend_Form_Element_Text("title");
     $title->setAttrib("placeholder", "Title");
     $title->setAttrib("class", "form-control");
     $title->setLabel("Title: ");
     $title->setRequired();
     $body = new Zend_Form_Element_Textarea("body");
     $body->setAttrib("class", "form-control");
     $body->setAttrib("placeholder", "Write body here....");
     $body->setLabel("Body: ");
     $body->setAttrib("rows", "5");
     $body->setAttrib("cols", "55");
     $body->setRequired();
     $picture = new Zend_Form_Element_File('picture');
     $picture->setLabel("Picture:");
     $picture->setRequired();
     $picture->setDestination('/var/www/html/RNR/public/images/thread');
     $stick = new Zend_Form_Element_Radio("stick");
     $stick->setLabel("Sticky:");
     $stick->addMultiOption("on", "on");
     $stick->addMultiOption("off", "off");
     $stick->setRequired();
     $id = new Zend_Form_Element_Hidden("id");
     $submit = new Zend_Form_Element_Submit("Submit");
     $submit->setAttrib("class", "btn btn-primary");
     $submit->setLabel("Save");
     $rest = new Zend_Form_Element_Submit('Rest');
     $rest->setAttrib("class", "btn btn-info");
     $this->addElements(array($id, $title, $body, $picture, $stick, $submit, $rest));
 }
开发者ID:ranahedia,项目名称:RNR,代码行数:32,代码来源:Thread.php

示例12: 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'));
 }
开发者ID:nhochong,项目名称:sdcd,代码行数:33,代码来源:BaiGiang.php

示例13: init

 public function init()
 {
     $this->setName('f3')->setMethod('post');
     $mauOptions = array("multiOptions" => Default_Model_Constraints::report());
     $mau = new Zend_Form_Element_Select('mau', $mauOptions);
     $mau->setRequired(true)->setLabel('Mẫu báo cáo (*)')->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'))))->setAttribs(array('id' => 'mau'));
     $namOptions = array("multiOptions" => Default_Model_Constraints::nam());
     $nam = new Zend_Form_Element_Select('nam', $namOptions);
     $nam->setRequired(true)->setLabel('Năm (*)')->setValue(date('Y'))->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' => 'nam'));
     $quyet_dinh = new Zend_Form_Element_Text('quyet_dinh');
     $quyet_dinh->setLabel('Quyết định')->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');
     $loai_lv = new Default_Model_LoaiLinhVuc();
     $llvOptions = array("multiOptions" => $loai_lv->getMultiOptions());
     $ma_loai = new Zend_Form_Element_Select('ma_loai', $llvOptions);
     $ma_loai->setLabel('Loại')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'ma_loai-wrapper'))));
     $options = array("multiOptions" => array('1' => 'Có', '0' => 'Không'));
     $thong_bao = new Zend_Form_Element_Radio('thong_bao', $options);
     $thong_bao->setRequired(true)->setLabel('Tạo thông báo mới')->setValue('0')->setSeparator('')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'thong_bao')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'thong_bao-wrapper'))))->setAttribs(array('id' => 'thong_bao'));
     $fileTypeOptions = array("multiOptions" => array('excel' => 'Excel', 'pdf' => 'Pdf'));
     $file_type = new Zend_Form_Element_Select('file_type', $fileTypeOptions);
     $file_type->setRequired(true)->setLabel('Xuất Thành File')->setSeparator('')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class' => 'file_type')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'file_type-wrapper'))))->setAttribs(array('id' => 'file_type'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Xuất')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'filter_btn_l'))))->setAttribs(array('class' => 'button', 'id' => 'submit'));
     $this->addElements(array($mau, $nam, $quyet_dinh, $ma_loai, $thong_bao, $file_type, $submit));
     $this->addDisplayGroup(array('submit'), 'report', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'report')))));
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'report_dt')), 'Form'));
 }
开发者ID:nhochong,项目名称:qlkh-sgu,代码行数:27,代码来源:Report.php

示例14: 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');
     $cateOptions = Khcn_Api::_()->getDbTable('loai_thong_tin', 'default')->getListAssoc();
     $loai_thong_tin_id = new Zend_Form_Element_Select('loai_thong_tin_id');
     $loai_thong_tin_id->setLabel('Loại (*)')->addMultiOptions($cateOptions)->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');
     $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_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'));
     $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/thong_tin')->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($loai_thong_tin_id, $tieu_de, $noi_dung, $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'));
 }
开发者ID:nhochong,项目名称:sdcd,代码行数:28,代码来源:ThongTin.php

示例15: _initVOType

 public function _initVOType()
 {
     $element = new Zend_Form_Element_Radio('vo_type');
     $element->addMultiOptions(array('MIXED' => 'Mixed', 'GROUP' => 'Group', 'STEM' => 'Stem', 'IDP' => 'IdP'));
     $element->setRequired(true);
     $element->setAllowEmpty(false);
     $element->setValue('MIXED');
     return $this->addElement($element);
 }
开发者ID:newlongwhitecloudy,项目名称:OpenConext-manage,代码行数:9,代码来源:VirtualOrganisation.php


注:本文中的Zend_Form_Element_Radio::setRequired方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。