Пример #1
0
 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'));
 }
Пример #2
0
 public function init()
 {
     parent::init();
     $this->setAction('/core/feedback/programme');
     $id = new Zend_Form_Element_Hidden('id');
     $id->setRequired(true)->setLabel('id')->addValidators(array('Int'))->setDecorators(array('Composite'));
     $best = new Zend_Form_Element_Textarea('best_stuff');
     $best->setLabel('Which sessions or presentations were the best – and why?')->setAttrib('class', 'medium')->setDescription('Please limit your comments to 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(1, 5000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer comment', Zend_Validate_StringLength::TOO_LONG => 'Your comment is too long')))->setDecorators(array('Composite'));
     $worst = clone $best;
     $worst->setName('worst_stuff')->setLabel('Which sessions or presentations were the worst – and why?');
     $comments = clone $best;
     $comments->setName('comments')->setLabel('Comments on the programme');
     $this->addElements(array($id, $best, $worst));
     $elements = array('exhibition' => 'How useful did you find the exhibitions and demos?', 'meetings' => 'How useful did you find the meetings / workshops around the conference?', 'lightning' => 'How useful did you find the lightning talks?', 'poster' => 'How useful did you find the poster presentations?');
     // add all elements in loop, since they are all the same
     foreach ($elements as $name => $label) {
         $newSelect = new Zend_Form_Element_Radio($name);
         $newSelect->setLabel($label)->setAttrib('class', 'tiny')->setMultiOptions($this->_getFieldValues('rating', 'feedback'))->setDecorators(array('Composite'));
         $newText = new Zend_Form_Element_Text('remarks_' . $name);
         $newText->setDescription('Comments')->setAttrib('class', 'medium')->setDecorators(array('Composite'));
         $this->addElements(array($newSelect, $newText));
     }
     $this->addElement($comments);
     $this->addElement('submit', 'submit', array('decorators' => $this->_buttonElementDecorator));
 }
Пример #3
0
		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;
		}
Пример #4
0
		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;
		}
Пример #5
0
 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();
 }
Пример #6
0
 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'));
 }
Пример #7
0
 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'));
 }
Пример #8
0
 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'));
 }
Пример #9
0
 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));
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('tag' => '', 'placement' => 'append')), array('Errors', array('placement' => 'append', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('comments');
     $comment_author_IP = new Zend_Form_Element_Hidden('comment_author_IP');
     $comment_author_IP->removeDecorator('HtmlTag')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setValue($_SERVER['REMOTE_ADDR'])->addValue('Ip');
     $comment_agent = new Zend_Form_Element_Hidden('comment_agent');
     $comment_agent->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setValue($_SERVER['HTTP_USER_AGENT'])->setRequired(false)->addFilters(array('StripTags', 'StringTrim'));
     $comment_findID = new Zend_Form_Element_Hidden('comment_findID');
     $comment_findID->addFilters(array('StripTags', 'StringTrim'))->setDecorators(array(array('ViewHelper'), array('Description', array('tag' => '')), array('Errors'), array('HtmlTag', array('tag' => 'p')), array('Label', array('tag' => ''))));
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid name!')->setDecorators($decorators);
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setDecorators($decorators)->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_author_url = new Zend_Form_Element_Text('comment_author_url');
     $comment_author_url->setLabel('Enter your web address: ')->setDecorators($decorators)->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->addValidator('Url')->setDescription('* Not compulsory');
     $comment_content = new Pas_Form_Element_RTE('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $approval = new Zend_Form_Element_Radio('comment_approval');
     $approval->setLabel('What would you like to do? ')->addMultiOptions(array('spam' => 'Set as spam', 'ham' => 'Submit ham?', 'approved' => 'Publish it?', 'delete' => 'Delete it?'))->setValue('approved')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     $this->addElements(array($comment_author_IP, $comment_agent, $comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_findID, $approval, $submit));
     $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_approval', 'comment_findID'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('HtmlTag');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Пример #11
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $reeces = new Reeces();
     $reeces_options = $reeces->getRevTypes();
     parent::__construct($options);
     $this->setName('reversetype');
     $type = new Zend_Form_Element_Text('type');
     $type->setLabel('Reverse type inscription: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter an inscription.')->setAttrib('size', 70);
     $translation = new Zend_Form_Element_Text('translation');
     $translation->setLabel('Translation: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setAttrib('size', 70);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Description: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setAttrib('size', 70);
     $gendate = new Zend_Form_Element_Text('gendate');
     $gendate->setLabel('General date for reverse type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a general date for this reverse type.')->setAttrib('size', 30);
     $reeceID = new Zend_Form_Element_Select('reeceID');
     $reeceID->setLabel('Reece period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a Reece period', 'Available Reece period' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)));
     $common = new Zend_Form_Element_Radio('common');
     $common->setLabel('Is this reverse type commonly found: ')->setRequired(false)->addMultiOptions(array('1' => 'Yes', '2' => 'No'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($type, $gendate, $description, $translation, $reeceID, $common, $submit, $hash));
     $this->addDisplayGroup(array('type', 'translation', 'description', 'gendate', 'reeceID', 'common', 'submit'), 'details');
     $this->details->setLegend('Reverse type details: ');
     $this->details->setLegend('Issuer or ruler details: ');
     parent::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');
 }
Пример #13
0
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('accountupgrades');
        $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
        $researchOutline = new Pas_Form_Element_RTE('researchOutline');
        $researchOutline->setLabel('Research outline: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addErrorMessage('Outline must be present.')->setDescription('Use this textarea to tell us whether you want to become a 
		research level user and why. We would also like to know the probable length of time 
		for this project so that we can inform our research board of progress. 
		We need a good idea as we have to respect privacy of findspots and landowner/finder personal data');
        $reference = $this->addElement('Text', 'reference', array('label' => 'Please provide a referee:', 'size' => '40', 'description' => 'We ask you to provide a referee who can substantiate your request for higher level access. 
		Ideally they will be an archaeologist of good standing.'))->reference;
        $reference->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim');
        $reference->setDecorators($decorators);
        $referenceEmail = $this->addElement('Text', 'referenceEmail', array('label' => 'Please provide an email address for your referee:', 'size' => '40'))->referenceEmail;
        $referenceEmail->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('EmailAddress');
        $referenceEmail->setDecorators($decorators);
        $already = new Zend_Form_Element_Radio('already');
        $already->setLabel('Is your topic already listed on our research register?: ')->addMultiOptions(array(1 => 'Yes it is', 0 => 'No it isn\'t'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators);
        //Submit button
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setLabel('Submit request');
        $this->addElements(array($researchOutline, $submit, $already));
        $this->addDisplayGroup(array('researchOutline', 'reference', 'referenceEmail', 'already'), 'details')->removeDecorator('HtmlTag');
        $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
        $this->details->removeDecorator('DtDdWrapper');
        $this->details->removeDecorator('HtmlTag');
        $this->details->setLegend('Details: ');
        $this->addDisplayGroup(array('submit'), 'submit');
    }
Пример #14
0
 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'));
 }
Пример #15
0
 public function init()
 {
     // init the parent
     parent::init();
     // set the form's method
     $this->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->setOptions(array('validators' => array(new Zend_Validate_Regex('/^\\d*$/'))));
     $this->addElement($id);
     $firstname = new Zend_Form_Element_Text('firstname');
     $firstname->setOptions(array('label' => $this->t('First name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($firstname);
     $lastname = new Zend_Form_Element_Text('lastname');
     $lastname->setOptions(array('label' => $this->t('Last name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($lastname);
     $checkEmailNotJunk = new Zend_Validate_Callback(array($this, 'emailNotJetable'));
     $uniqueEmailValidator = new Zend_Validate_Db_NoRecordExists(array('table' => 'backoffice_users', 'field' => 'email'));
     $email = new Zend_Form_Element_Text('email');
     $email->setOptions(array('label' => $this->t('Email'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', $checkEmailNotJunk, $uniqueEmailValidator)));
     $this->addElement($email);
     $raisonsocial = new Zend_Form_Element_Text('raison sociale');
     $raisonsocial->setOptions(array('label' => $this->t('Raison sociale'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
     $this->addElement($raisonsocial);
     //        $groupsInArrayValidator = new Zend_Validate_InArray(array_keys(array(1, 2, 3)));
     //        $groupsInArrayValidator->setMessage('Please select at least one group. If you are not sure about which group is better, select "member".');
     $status = new Zend_Form_Element_Radio('status');
     $status->setOptions(array('label' => $this->t('Status'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty'), 'multiOptions' => array('Gérant' => 'Gérant', 'Associé' => 'Associé', 'Freelance patenté' => 'Freelance patenté')));
     $this->addElement($status);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setOptions(array('label' => $this->t('Save user'), 'required' => true, 'order' => 100));
     $this->addElement($submit);
 }
Пример #16
0
 public function __construct($options = null)
 {
     $reeces = new Reeces();
     $reeces_options = $reeces->getRevTypes();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('reversetype');
     $type = new Zend_Form_Element_Text('type');
     $type->setLabel('Reverse type inscription: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter an inscription.')->setDecorators($decorators)->setAttrib('size', 70);
     $translation = new Zend_Form_Element_Text('translation');
     $translation->setLabel('Translation: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setDecorators($decorators)->setAttrib('size', 70);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Description: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setDecorators($decorators)->setAttrib('size', 70);
     $gendate = new Zend_Form_Element_Text('gendate');
     $gendate->setLabel('General date for reverse type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addErrorMessage('You must enter a general date for this reverse type.')->setDecorators($decorators)->setAttrib('size', 30);
     $reeceID = new Zend_Form_Element_Select('reeceID');
     $reeceID->setLabel('Reece period: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL, 'Choose reason' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)))->setDecorators($decorators);
     $common = new Zend_Form_Element_Radio('common');
     $common->setLabel('Is this reverse type commonly found: ')->setRequired(false)->addMultiOptions(array('1' => 'Yes', '2' => 'No'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElements(array($type, $gendate, $description, $translation, $reeceID, $common, $submit, $hash));
     $this->addDisplayGroup(array('type', 'translation', 'description', 'gendate', 'reeceID', 'common', 'submit'), 'details');
     $this->details->setLegend('Reverse type details: ');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->setLegend('Issuer or ruler details: ');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
 }
Пример #17
0
 public function init()
 {
     $this->setMethod('POST');
     $this->setName("adminForm");
     $element = new Zend_Form_Element_Hidden('id');
     $element->setValue($this->advertisement->id);
     $this->addElement($element);
     $element = new Zend_Form_Element_Hidden('city');
     $element->setValue($this->city);
     $this->addElement($element);
     $element = new Zend_Form_Element_Radio('action');
     $element->setMultiOptions(array('0' => '已解决, 关闭帖子', '1' => '打错了些东东, 修改帖子', '2' => '我是管理员, 删除帖子'));
     $element->setValue(0);
     $this->addElement($element);
     $element = new Zend_Form_Element_Text('password');
     $element->setLabel('密码');
     $element->setDescription('忘记密码?');
     $this->addElement($element);
     $element = new Elements();
     $element->addReCaptcha($this);
     $element = new Zend_Form_Element_Submit('post');
     $element->setLabel('提交')->removeDecorator('Label');
     $this->addElement($element);
     $this->addDisplayGroup(array('password', 'captcha', 'post'), 'leftMargin');
     $this->getDisplayGroup('leftMargin')->removeDecorator('DtDdWrapper');
 }
Пример #18
0
 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'));
 }
Пример #19
0
    public function init()
    {
        $this->setMethod('post');

        $canVote = new Zend_Form_Element_Radio('can_vote');
        $canVote->setLabel('Można głosować: ')
            ->addMultiOptions(
                array('1' => 'Tak', '0' => 'Nie')
            )
            ->setSeparator('');

        $this->addElement($canVote, 'can_vote');

        $canEnter = new Zend_Form_Element_Radio('can_enter');
        $canEnter->setLabel('Można zgłaszać zdjęcia: ')
            ->addMultiOptions(
                array('1' => 'Tak', '0' => 'Nie')
            )
            ->setSeparator('');

        $this->addElement($canEnter, 'can_enter');

        $save = new Zend_Form_Element_Submit('save');
        $save->setLabel('Zapisz');
        $save->setAttrib('class', 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only');

        $this->addElement($save);
    }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('comments');
     $commentType = new Zend_Form_Element_Hidden('comment_type');
     $commentType->addFilters(array('StripTags', 'StringTrim'));
     $comment_findID = new Zend_Form_Element_Hidden('contentID');
     $comment_findID->addFilters(array('StripTags', 'StringTrim'));
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid name!');
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_author_url = new Zend_Form_Element_Text('comment_author_url');
     $comment_author_url->setLabel('Enter your web address: ')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->addValidator('Url')->setDescription('* Not compulsory');
     $comment_content = new Pas_Form_Element_CKEditor('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $status = new Zend_Form_Element_Radio('commentStatus');
     $status->setLabel('Message status:')->addMultiOptions(array('isspam' => 'Set as spam', 'isham' => 'Submit ham?', 'notspam' => 'Spam free'))->setValue('notSpam')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $commentApproval = new Zend_Form_Element_Radio('comment_approved');
     $commentApproval->setLabel('Approval:')->addMultiOptions(array('moderation' => 'Moderation', 'approved' => 'Approved'))->setValue('approved')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $this->addElements(array($comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_findID, $commentApproval, $commentType, $status, $hash, $submit));
     $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'commentStatus', 'comment_approved', 'contentID', 'comment_type'), 'details');
     $this->details->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Пример #21
0
 public function init()
 {
     global $mySession;
     $PathType = '1';
     if (isset($_REQUEST['path_type'])) {
         $PathType = $_REQUEST['path_type'];
     }
     $video_title = new Zend_Form_Element_Text('video_title');
     $video_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Video title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput");
     $pathtypeArr = array();
     $pathtypeArr[0]['key'] = "1";
     $pathtypeArr[0]['value'] = "Computer";
     $pathtypeArr[1]['key'] = "2";
     $pathtypeArr[1]['value'] = "You Tube Url";
     $path_type = new Zend_Form_Element_Radio('path_type');
     $path_type->addMultiOptions($pathtypeArr)->setAttrib("onclick", "setType(this.value);")->setValue(1);
     $video_path = new Zend_Form_Element_File('video_path');
     $video_path->setDestination(SITE_ROOT . 'images/videos/')->addValidator('Extension', false, 'flv');
     $you_tube_url = new Zend_Form_Element_Text('you_tube_url');
     $you_tube_url->setAttrib("class", "textInput");
     if ($PathType == '1') {
         $video_path->setRequired(true)->addDecorator('Errors', array('class' => 'error'));
     } else {
         $you_tube_url->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'You tube url is required.'))->addDecorator('Errors', array('class' => 'error'));
     }
     $this->addElements(array($video_title, $video_path, $you_tube_url, $path_type));
 }
Пример #22
0
 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'));
 }
Пример #23
0
 public function init()
 {
     $this->setAction('/core/submit/new');
     $type = new Zend_Form_Element_MultiCheckbox('submission_type');
     $type->setLabel('')->setRequired(false)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('submission_type'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Title')->setRequired(true)->addValidator('StringLength', true, array(2, 64, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer title', Zend_Validate_StringLength::TOO_LONG => 'Your title is too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 64 characters')->setAttrib('maxLength', 64)->setDecorators(array('Composite'));
     $audience = new Zend_Form_Element_Radio('target_audience');
     $audience->setLabel('Please mark the target audience for your presentation')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('target_audience'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $publish = new Zend_Form_Element_Radio('publish_paper');
     $publish->setLabel('Please indicate whether you wish to prepare a full paper for possible publication')->setRequired(true)->setAttrib('class', 'tiny')->addMultiOptions($this->_getFieldValues('publish_paper', 'submit'))->setSeparator('<br />')->setDecorators(array('Composite'));
     $topicModel = new Core_Model_Topic();
     $topicsForSelect = $topicModel->getTopicsForSelect();
     $topicsel = new Zend_Form_Element_MultiCheckbox('topic');
     $topicsel->setLabel('Topic')->setRequired(false)->setAttrib('class', 'tiny')->setMultiOptions($topicsForSelect)->setSeparator('<br />')->setDecorators(array('Composite'));
     $keywords = new Zend_Form_Element_Text('keywords');
     $keywords->setLabel('Keywords')->setRequired(false)->addValidator('StringLength', true, array(2, 500, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide longer keywords', Zend_Validate_StringLength::TOO_LONG => 'Your keywords are too long')))->setAttrib('class', 'medium')->setDescription('Must be between 2 and 500 characters')->setDecorators(array('Composite'));
     $abstract = new Zend_Form_Element_Textarea('abstract');
     $abstract->setLabel('Submission Summary (If your submission is accepted, this will be publicly visible!)')->setAttrib('class', 'small')->setDescription('Must be between 5 and 2000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 2000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer abstract', Zend_Validate_StringLength::TOO_LONG => 'Your abstract is too long')))->setDecorators(array('Composite'));
     $comment = new Zend_Form_Element_Textarea('comment');
     $comment->setLabel('Information for Reviewers')->setAttrib('class', 'small')->setDescription('Must be between 5 and 1000 characters')->setRequired(false)->addValidator('StringLength', true, array(5, 1000, 'messages' => array(Zend_Validate_StringLength::TOO_SHORT => 'Please provide a longer description', Zend_Validate_StringLength::TOO_LONG => 'Your description is too long')))->setDecorators(array('Composite'));
     $file = new TA_Form_Element_MagicFile('file');
     $file->setLabel('Your submission (File must be pdf and no bigger than 10Mb) *')->setRequired(false)->addDecorators($this->_magicFileElementDecorator)->addValidators(array(array('Count', true, 1), array('Size', true, 10000000), array('Extension', true, array('pdf', 'case' => true)), array('MimeType', false, array('application/pdf'))));
     $file->getValidator('Extension')->setMessage('Only pdf files are allowed!');
     $subform = new Zend_Form_SubForm();
     $subform->setDecorators(array('FormElements'));
     $subform->addElements(array($type, $file, $title, $audience, $topicsel, $keywords, $abstract, $comment));
     $this->addSubForm($subform, 'submission');
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
Пример #24
0
 public function init()
 {
     // Set form options
     $this->setName('productBasicInfo')->setAction(SITE_ROOT . '/productlisting/' . $this->postAction)->setMethod('post');
     //name
     $name = new Zend_Form_Element_Text('name');
     $name->setRequired(true)->addValidator('Alnum')->addvalidator('StringLength', false, array(4, 150));
     //brand
     $brand = new Zend_Form_Element_Select('brand');
     $brand->setRequired(true)->addValidator('Alnum');
     //social_usage
     $socialUsage = new Zend_Form_Element_Checkbox('socialUsage');
     $competativeUsage = new Zend_Form_Element_Checkbox('competativeUsage');
     $price = new Zend_form_Element_Text('price');
     $price->setRequired(true)->addValidator(new Zend_Validate_Float(), true);
     //domestic shipping rate
     $domesticShippingRate = new Zend_Form_Element_Text('domesticShippingRate');
     $domesticShippingRate->setRequired(true)->addValidator(new Zend_Validate_Float(), true);
     //international shipping rate
     $internationalShippingRate = new Zend_Form_Element_Text('internationalShippingRate');
     $internationalShippingRate->setRequired(true)->addValidator(new Custom_Validators_Price(), true);
     //backordertime
     $backorderTime = new Zend_Form_Element_Text('backorderTime');
     //returnable
     $return = new Zend_Form_Element_Radio('return');
     $return->setLabel('Return:')->addMultiOptions(array('returnable' => 'Returnable', 'Unreturnable' => 'Not returnable'))->setSeparator(" ")->setAttrib("checked", "checked");
     //videos
     $video = new Zend_Form_Element_Text('videoYoutube');
     // Add all the elements to the form
     $this->addElement($name)->addElement($brand)->addElement($socialUsage)->addElement($competativeUsage)->addElement($price)->addElement($domesticShippingRate)->addElement($internationalShippingRate)->addElement($backorderTime)->addElement($return)->addElement($video);
 }
Пример #25
0
 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'));
 }
Пример #26
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodPostMed();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsPostMedieval();
     $statuses = new Statuses();
     $status_options = $statuses->getCoinStatus();
     $dies = new Dieaxes();
     $die_options = $dies->getAxes();
     $wears = new WearTypes();
     $wear_options = $wears->getWears();
     $rulers = new Rulers();
     $ro = $rulers->getPostMedievalRulers();
     $mints = new Mints();
     $mo = $mints->getPostMedievalMints();
     parent::__construct($options);
     $this->setName('postmedievalcoin');
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier');
     $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Digits');
     $categoryID = new Zend_Form_Element_Select('categoryID');
     $categoryID->setLabel('Category of coin: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose category', 'Available categories' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $ruler_id = new Zend_Form_Element_Select('ruler_id');
     $ruler_id->setLabel('Ruler: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose ruler', 'Available rulers' => $ro))->addValidator('InArray', false, array(array_keys($ro)))->addValidator('Digits')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addValidator('Digits')->addFilters(array('StripTags', 'StringTrim'));
     $mint_id = new Zend_Form_Element_Select('mint_id');
     $mint_id->setLabel('Issuing mint: ')->addMultiOptions(array(null => 'Choose mint', 'Available mints' => $mo))->addValidator('InArray', false, array(array_keys($mo)))->addValidator('Digits')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->setValue(1)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose coin status', 'Available status options' => $status_options))->addValidator('InArray', false, array(array_keys($status_options)));
     $status_qualifier = new Zend_Form_Element_Radio('status_qualifier');
     $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''));
     $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear');
     $degree_of_wear->setLabel('Degree of wear: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose coin wear', 'Available wear options' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->addFilters(array('StripTags', 'StringTrim', 'EmptyParagraph'))->setAttrib('class', 'span6');
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->addFilters(array('StripTags', 'StringTrim', 'EmptyParagraph'))->setAttribs(array('class' => 'span6'));
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'));
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'));
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose die axis', 'Available dies' => $die_options))->addValidator('InArray', false, array(array_keys($die_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty');
     $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''));
     $typeID = new Zend_Form_Element_Select('typeID');
     $typeID->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'));
     $rev_mm = new Zend_Form_Element_Textarea('reverse_mintmark');
     $rev_mm->setLabel('Reverse mint mark: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'));
     $initial = new Zend_Form_Element_Textarea('initial_mark');
     $initial->setLabel('Initial mark: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $typeID, $status, $categoryID, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $submit, $rev_mm, $initial));
     $this->addDisplayGroup(array('categoryID', 'ruler_id', 'typeID', 'ruler_qualifier', 'denomination', 'denomination_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'initial_mark', 'die_axis_measurement', 'die_axis_certainty', 'submit'), 'details');
     parent::init();
 }
Пример #27
0
 public function FrmReceive($data = null)
 {
     $wherehouse_id = new Zend_Form_Element_Select('wherehouse_id');
     $wherehouse_id->setAttribs(array('class' => 'form-control'));
     $wherehouse_id_opt = array("1" => $this->tr->translate("..."), "2" => $this->tr->translate("..."));
     $wherehouse_id->setMultiOptions($wherehouse_id_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $handow = new Zend_Form_Element_Text('handow');
     $handow->setAttribs(array('class' => 'form-control'));
     $document = new Zend_Form_Element_Button('3');
     $document->setAttribs(array('class' => 'form-control'));
     $session = new Zend_Form_Element_Button('7');
     $session->setAttribs(array('class' => 'form-control'));
     $item_code = new Zend_Form_Element_Select('item_code');
     $item_code->setAttribs(array('class' => 'form-control'));
     $company_opt = array("1" => $this->tr->translate("SELECT_COMPANY"), "2" => $this->tr->translate("SELECT_COMPANY_NAME"));
     $item_code->setMultiOptions($company_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $ptd_usage_value = new Zend_Form_Element_Text('ptd_usage_value');
     $ptd_usage_value->setAttribs(array('class' => 'form-control'));
     $qty_onhand = new Zend_Form_Element_Text('demo3');
     $qty_onhand->setAttribs(array('class' => 'form-control', 'id' => 'demo3'));
     $branch = new Zend_Form_Element_Select('branch');
     $branch->setAttribs(array('class' => 'form-control'));
     $wherehouse_id_opt = array("1" => $this->tr->translate("..."), "2" => $this->tr->translate("..."));
     $branch->setMultiOptions($wherehouse_id_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $blank_smaler = new Zend_Form_Element_Select('blank_smaler');
     $blank_smaler->setAttribs(array('class' => 'form-control'));
     $company_opt = array("1" => $this->tr->translate("SELECT_COMPANY"), "2" => $this->tr->translate("SELECT_COMPANY_NAME"));
     $blank_smaler->setMultiOptions($company_opt);
     $combo = new Zend_Form_Element_Checkbox('combo');
     $combo->setAttribs(array('class' => 'red'));
     $average_cost = new Zend_Form_Element_Text('average_cost');
     $average_cost->setAttribs(array('class' => 'form-control'));
     $ptd_sale_value = new Zend_Form_Element_Text('ptd_sale_value');
     $ptd_sale_value->setAttribs(array('class' => 'form-control'));
     $unit_cost = new Zend_Form_Element_Radio('unit_cost');
     $unit_cost->setAttribs(array('class' => 'red'));
     $total_cost = new Zend_Form_Element_Radio('total_cost');
     $total_cost->setAttribs(array('class' => 'red'));
     $serial = new Zend_Form_Element_Text('serial');
     $serial->setAttribs(array('class' => 'form-control'));
     $lot = new Zend_Form_Element_Text('lot');
     $lot->setAttribs(array('class' => 'form-control'));
     $add_lind = new Zend_Form_Element_Button('add_lind');
     $add_lind->setAttribs(array('class' => 'form-control'));
     $edit_lind = new Zend_Form_Element_Button('edit_lind');
     $edit_lind->setAttribs(array('class' => 'form-control'));
     $delete_lind = new Zend_Form_Element_Button('delete_lind');
     $delete_lind->setAttribs(array('class' => 'form-control'));
     $concel_lind = new Zend_Form_Element_Button('concel_lind');
     $concel_lind->setAttribs(array('class' => 'form-control'));
     $this->addElements(array($combo, $wherehouse_id, $handow, $item_code, $branch, $document, $session, $blank_smaler, $ptd_usage_value, $qty_onhand, $unit_cost, $total_cost, $serial, $lot, $add_lind, $edit_lind, $delete_lind, $concel_lind));
     return $this;
 }
Пример #28
0
 public function __construct($options = null)
 {
     // Construct the select menu data
     $rulers = new Rulers();
     $ruler_options = $rulers->getRulersByzantine();
     $denominations = new Denominations();
     $denomination_options = $denominations->getDenomsByzantine();
     $mints = new Mints();
     $mint_options = $mints->getMintsByzantine();
     $statuses = new Statuses();
     $status_options = $statuses->getCoinStatus();
     $dies = new Dieaxes();
     $die_options = $dies->getAxes();
     $wears = new Weartypes();
     $wear_options = $wears->getWears();
     parent::__construct($options);
     $this->setName('romancoin');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->setRegisterInArrayValidator(false)->addValidator()->setDecorators($decorators);
     $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier');
     $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $ruler_options))->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $mint_ID = new Zend_Form_Element_Select('mint_id');
     $mint_ID->setLabel('Issuing mint: ')->addValidators(array('NotEmpty', 'Integer'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $mint_options))->setRegisterInArrayValidator(false)->setDecorators($decorators);
     $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier');
     $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setValue(1)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $status_options))->setDecorators($decorators);
     $status_qualifier = new Zend_Form_Element_Radio('status_qualifier');
     $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear');
     $degree_of_wear->setLabel('Degree of wear: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators);
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators);
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'expanding');
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'expanding');
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose die axis' => $die_options))->setDecorators($decorators);
     $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty');
     $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Int'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($ruler, $denomination, $mint_ID, $status, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $status_qualifier, $submit));
     $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Пример #29
0
 /** helper method to create privacy related form elements */
 protected function _getPrivacyFormElements()
 {
     $privacy = new Zend_Form_Element_Radio('privacy');
     $privacy->addMultiOptions(array(MIDAS_COMMUNITY_PRIVATE => $this->t('Private, only members can see the community'), MIDAS_COMMUNITY_PUBLIC => $this->t('Public, everyone can see the community')))->setRequired(true)->setValue(MIDAS_COMMUNITY_PUBLIC);
     $canJoin = new Zend_Form_Element_Radio('canJoin');
     $canJoin->addMultiOptions(array(MIDAS_COMMUNITY_CAN_JOIN => $this->t('Everyone can join the community'), MIDAS_COMMUNITY_INVITATION_ONLY => $this->t('Only invited users can join the community')))->setValue(MIDAS_COMMUNITY_CAN_JOIN);
     return array($privacy, $canJoin);
 }
Пример #30
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $rulers = new Rulers();
     $ro = $rulers->getJettonRulers();
     $dies = new Dieaxes();
     $die_options = $dies->getAxes();
     $wears = new WearTypes();
     $wear_options = $wears->getWears();
     $categories = new JettonClasses();
     $cat_options = $categories->getClasses();
     $groups = new JettonGroups();
     $group_options = $groups->getGroups();
     $types = new JettonTypes();
     $type_options = $types->getTypes();
     parent::__construct($options);
     $this->setName('jettontoken');
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose denomination', 'Choose denomination' => array(64 => 'Jetton', 65 => 'Farthing token', 66 => 'Token halfpenny', 67 => 'Token penny')))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(true)->addErrorMessage('You must enter a denomination');
     $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier');
     $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array(1 => 'Certain', 2 => 'Probably', 3 => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Int');
     $ruler = new Zend_Form_Element_Select('ruler_id');
     $ruler->setLabel('Ruler: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose an issuer', 'Available issuers' => $ro))->addValidator('InArray', false, array(array_keys($ro)));
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Ruler qualifier: ')->addMultiOptions(array(1 => 'Certain', 2 => 'Probably', 3 => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''));
     $mint_id = new Zend_Form_Element_Select('mint_id');
     $mint_id->setLabel('Issuing mint: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a mint', 'Available mints' => array(286 => 'Nuremberg', 1530 => 'Paris', 291 => 'Tournai', 1531 => 'Unknown')));
     $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier');
     $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''));
     $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear');
     $degree_of_wear->setLabel('Degree of wear: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose degree of wear', 'Available options' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)));
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim'));
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim'));
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 3, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim'));
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('rows' => 3, 'cols' => 80, 'class' => 'span6'));
     $reverse_mintmark = new Zend_Form_Element_Textarea('reverse_mintmark');
     $reverse_mintmark->setLabel('Reverse mint mark: ')->addValidators(array('NotEmpty'))->setAttribs(array('rows' => 3, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim'));
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose die axis', 'Available dies' => $die_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($die_options)));
     $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty');
     $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array(1 => 'Certain', 2 => 'Probably', 3 => 'Possibly'))->addFilter('StripTags')->addFilter('StringTrim')->setOptions(array('separator' => ''));
     $categoryID = new Zend_Form_Element_Select('jettonClass');
     $categoryID->setLabel('Class of token: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidators(array('NotEmpty', 'Digits'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose class', 'Available classes' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)));
     $jettonGroupID = new Zend_Form_Element_Select('jettonGroup');
     $jettonGroupID->setLabel('Group of token: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidators(array('NotEmpty', 'Digits'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose group', 'Available groups' => $group_options))->addValidator('InArray', false, array(array_keys($group_options)));
     $jettonTypeID = new Zend_Form_Element_Select('jettonType');
     $jettonTypeID->setLabel('Type of token: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidators(array('NotEmpty', 'Digits'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose type', 'Available types' => $type_options))->addValidator('InArray', false, array(array_keys($type_options)));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($ruler, $denomination, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_id, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $categoryID, $jettonGroupID, $jettonTypeID, $submit));
     $this->addDisplayGroup(array('jettonClass', 'jettonGroup', 'jettonType', 'denomination', 'denomination_qualifier', 'ruler_id', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }