本文整理汇总了PHP中Zend_Form_Element_Radio类的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Radio类的具体用法?PHP Zend_Form_Element_Radio怎么用?PHP Zend_Form_Element_Radio使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Zend_Form_Element_Radio类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
// Set form attributes
$this->addElement('Text', 'contact', array('label' => 'Contact Form Email', 'description' => 'Enter the email address you want contact form messages to be sent to.', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'contact-element', 'style' => 'width: 75%')), array('Label', array('tag' => 'td', 'id' => 'contact-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'contact-wrapper'))), 'attribs' => array('class' => 'text-input')));
// Element: mail_name
$this->addElement('Text', 'name', array('label' => 'From Name', 'description' => 'Enter the name you want the emails from the system to come from in the field below.', 'value' => 'Site Admin', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'name-element')), array('Label', array('tag' => 'td', 'id' => 'name-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'name-wrapper'))), 'attribs' => array('class' => 'text-input')));
// Element: mail_from
$this->addElement('Text', 'from', array('label' => 'From Address', 'description' => 'Enter the email address you want the emails from the system to come from in the field below.', 'value' => 'no-reply@' . $_SERVER['HTTP_HOST'], 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'from-element')), array('Label', array('tag' => 'td', 'id' => 'from-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'from-wrapper'))), 'attribs' => array('class' => 'text-input')));
$mailSmtpOptions = array("multiOptions" => array('0' => 'Use the built-in mail() function', '1' => 'Send emails through an SMTP server'));
$mail_smtp = new Zend_Form_Element_Radio('mail_smtp', $mailSmtpOptions);
$mail_smtp->setRequired(true)->setLabel('Send through SMTP')->setDescription('Emails typically get sent through the web server using the PHP mail() function. Alternatively you can have emails sent out using SMTP, usually requiring a username and password, and optionally using an external mail server.')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp-wrapper', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'mail_smtp'));
$this->addElement($mail_smtp);
// Element: mail_smtp_server
$this->addElement('Text', 'mail_smtp_server', array('label' => 'SMTP Server Address', 'required' => false, 'value' => '127.0.0.1', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_server-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_server-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_server-wrapper'))), 'attribs' => array('class' => 'text-input')));
// Element: mail_smtp_port
$this->addElement('Text', 'mail_smtp_port', array('label' => 'SMTP Server Port', 'description' => 'Default: 25. Also commonly on port 465 (SMTP over SSL) or port 587.', 'required' => false, 'value' => '25', 'validators' => array('Int'), 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_port-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_port-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_port-wrapper'))), 'attribs' => array('class' => 'text-input')));
$authenticationOptions = array("multiOptions" => array(1 => 'Yes', 0 => 'No'));
$mail_smtp_authentication = new Zend_Form_Element_Radio('mail_smtp_authentication', $authenticationOptions);
$mail_smtp_authentication->setRequired(false)->setLabel('SMTP Authentication?')->setDescription('Does your SMTP Server require authentication?')->setValue('0')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_authentication-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_authentication-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_authentication-wrapper', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'mail_smtp_authentication'));
$this->addElement($mail_smtp_authentication);
// Element: mail_smtp_username
$this->addElement('Text', 'mail_smtp_username', array('label' => 'SMTP Username', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_username-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_username-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_username-wrapper'))), 'attribs' => array('class' => 'text-input')));
// Element: mail_smtp_password
$this->addElement('Password', 'mail_smtp_password', array('label' => 'SMTP Password', 'description' => 'Leave blank to use previous.', 'decorators' => array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_password-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_password-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_password-wrapper'))), 'attribs' => array('class' => 'text-input')));
$sslOptions = array("multiOptions" => array('' => 'None', 'tls' => 'TLS', 'ssl' => 'SSL'));
$mail_smtp_ssl = new Zend_Form_Element_Radio('mail_smtp_ssl', $sslOptions);
$mail_smtp_ssl->setRequired(false)->setLabel('Use SSL or TLS?')->setValue('')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'small', 'class' => 'description', 'style' => 'display : block')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'id' => 'mail_smtp_ssl-element')), array('Label', array('tag' => 'td', 'id' => 'mail_smtp_ssl-label')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'mail_smtp_ssl-wrapper', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'mail_smtp_ssl'));
$this->addElement($mail_smtp_ssl);
// Element: submit
$this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span', 'id' => 'submit-element')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'id' => 'submit-wrapper'))), 'attribs' => array('class' => 'button')));
$this->addDisplayGroup(array('submit'), 'btnsubmit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'mail_settings')), 'Form'));
}
示例2: init
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: setForm
function setForm()
{
$form=new Zend_Form;
$form->setMethod('post')->setAction('');
$image_name = new Zend_Form_Element_Text('image_name');
$image_name->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tên ảnh không được để trống'));
$image_link = new Zend_Form_Element_Textarea('image_link');
$image_link->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Hình ảnh không được để trống'));
$is_active = new Zend_Form_Element_Radio('is_active');
$is_active->setRequired(true)
->setLabel('is_active')
->setMultiOptions(array("1" => "Có","0" => "Không"));
$image_name->removeDecorator('HtmlTag')->removeDecorator('Label');
$image_link->removeDecorator('HtmlTag')->removeDecorator('Label');
$is_active->removeDecorator('HtmlTag')->removeDecorator('Label');
$form->addElements(array($image_name,$image_link,$is_active));
return $form;
}
示例4: setForm
function setForm()
{
$form = new Zend_Form;
$form->setMethod('post')->setAction('');
//$this->setAttrib('enctype','multipart/form-data');
$file = new Zend_Form_Element_File('video_file');
//$file->setAttrib('class','file');
$file->setLabel('video_file');
$file->setRequired(true);
$video_title = new Zend_Form_Element_Text('video_title');
$video_title ->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Tiêu đề không được để trống'));
$video_thumbnail=new Zend_Form_Element_Textarea('video_thumbnail');
$video_thumbnail->removeDecorator('HtmlTag')->removeDecorator('Label');
$video_description = new Zend_Form_Element_Textarea('video_description');
$video_description->setAttrib('rows','7');
$video_description ->setRequired(true)->addValidator('NotEmpty',true,array('messages'=>'Mô tả không được để trống'));
$is_active = new Zend_Form_Element_Radio('is_active');
$is_active->setRequired(true)
->setLabel('is_active')
->setMultiOptions(array("1" => "Có","0" => "Không"));
$file->removeDecorator('HtmlTag')->removeDecorator('Label');
$video_title->removeDecorator('HtmlTag')->removeDecorator('Label');
$video_description->removeDecorator('HtmlTag')->removeDecorator('Label');
$is_active->removeDecorator('HtmlTag')->removeDecorator('Label');
$form->addElements(array($file,$video_title,$video_description,$is_active,$video_thumbnail));
return $form;
}
示例5: init
public function init()
{
// profissional_beleza_id
$profissional_beleza_id = new Zend_Form_Element_Radio("profissional_beleza_id");
$profissional_beleza_id->setLabel("Selecione o profissional desejado: ");
$profissional_beleza_id->setRegisterInArrayValidator(false);
$profissional_beleza_id->setRequired();
$profissional_beleza_id->setDecorators(App_Forms_Decorators::$checkboxElementDecorators);
// agenda_data
$agenda_data = new Zend_Form_Element_Text("agenda_data");
$agenda_data->setLabel("Selecione a data: ");
$agenda_data->setAttribs(array('class' => 'form-control', 'autocomplete' => 'off'));
$agenda_data->setRequired();
$agenda_data->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
// agenda_hora
$agenda_hora = new Zend_Form_Element_Select("agenda_hora");
$agenda_hora->setLabel('Selecione a hora: ');
$agenda_hora->setAttribs(array('class' => 'form-control'));
$agenda_hora->setMultiOptions(array('' => 'Horários'));
$agenda_hora->setRequired();
$agenda_hora->setDecorators(App_Forms_Decorators::$simpleElementDecorators);
$agenda_hora->setRegisterInArrayValidator(false);
// agenda_observacao
$agenda_observacao = new Zend_Form_Element_Textarea("agenda_observacao");
$agenda_observacao->setLabel("Observações: ");
$agenda_observacao->setAttribs(array('class' => 'form-control', 'rows' => 7, 'placeholder' => 'Informe alguma observação, por exemplo, alguma preferência de produto, etc.'));
// salao_id
$salao_id = new Zend_Form_Element_Hidden('salao_id');
// especialidade_id
$especialidade_id = new Zend_Form_Element_Hidden("especialidade_id");
// usuario_id
$usuario_id = new Zend_Form_Element_Hidden("usuario_id");
$this->addElements(array($profissional_beleza_id, $agenda_data, $agenda_hora, $agenda_observacao, $salao_id, $especialidade_id, $usuario_id));
parent::init();
}
示例6: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
$this->addElement('Hidden', 'search', array('value' => 1));
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$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: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
$this->addElement('Hidden', 'search', array('value' => 1));
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$noi_dung = new Zend_Form_Element_Textarea('noi_dung');
$noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
$soundcloud_embed = new Zend_Form_Element_Text('soundcloud_embed');
$soundcloud_embed->setLabel('Embed SoundCloud')->setDescription('How to get SoundCloud embed code? <a href="http://help.soundcloud.com/customer/portal/articles/243751-how-can-i-put-my-track-or-playlist-on-my-site-or-blog-" target="_blank">Click here</a>')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'div', 'escape' => false, 'placement' => 'append')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$youtube_embed = new Zend_Form_Element_Text('youtube_embed');
$youtube_embed->setLabel('Embed Youtube')->setDescription('How to get Youtube embed code? <a href="https://support.google.com/youtube/answer/171780?hl=en" target="_blank">Click here</a>')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'div', 'escape' => false, 'placement' => 'append')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$link_nct = new Zend_Form_Element_Text('link_nct');
$link_nct->setLabel('Nhac cua tui')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$link_mp3 = new Zend_Form_Element_Text('link_mp3');
$link_mp3->setLabel('Mp3')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
$trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
$trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$noi_bat = new Zend_Form_Element_Select('noi_bat');
$noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/bai_giang')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $_SERVER['HTTP_REFERER'] . '"'));
$this->addElements(array($tieu_de, $noi_dung, $soundcloud_embed, $youtube_embed, $link_nct, $link_mp3, $trang_thai, $noi_bat, $photo, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}
示例8: init
public function init()
{
$this->setName('f2')->setMethod('post');
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input medium-input'));
$statusOptions = array("multiOptions" => array(1 => 'Thuộc SGU', 0 => 'Liên kết trang mạng'));
$is_sgu = new Zend_Form_Element_Radio('is_sgu', $statusOptions);
$is_sgu->setRequired(true)->setLabel('Liên kết')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$url = new Zend_Form_Element_Text('url');
$url->setLabel('Url (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 255))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
$file = new Zend_Form_Element_File('file');
$file->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/small/images/lien_ket')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$maxOrder = Khcn_Api::_()->getDbTable('lien_ket', 'default')->getMaxOrderItem();
$order = new Zend_Form_Element_Text('order');
$order->setLabel('Thứ tự *')->setValue($maxOrder->order + 1)->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input tinysmall-input'));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$Url = new Zend_View_Helper_Url();
$link = $Url->url(array('module' => 'admin', 'controller' => 'lien-ket', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($ten, $is_sgu, $url, $file, $order, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'lien_ket')), 'Form'));
}
示例9: init
public function init()
{
$this->setMethod("post");
$title = new Zend_Form_Element_Text("title");
$title->setAttrib("placeholder", "Title");
$title->setAttrib("class", "form-control");
$title->setLabel("Title: ");
$title->setRequired();
$body = new Zend_Form_Element_Textarea("body");
$body->setAttrib("class", "form-control");
$body->setAttrib("placeholder", "Write body here....");
$body->setLabel("Body: ");
$body->setAttrib("rows", "5");
$body->setAttrib("cols", "55");
$body->setRequired();
$picture = new Zend_Form_Element_File('picture');
$picture->setLabel("Picture:");
$picture->setRequired();
$picture->setDestination('/var/www/html/RNR/public/images/thread');
$stick = new Zend_Form_Element_Radio("stick");
$stick->setLabel("Sticky:");
$stick->addMultiOption("on", "on");
$stick->addMultiOption("off", "off");
$stick->setRequired();
$id = new Zend_Form_Element_Hidden("id");
$submit = new Zend_Form_Element_Submit("Submit");
$submit->setAttrib("class", "btn btn-primary");
$submit->setLabel("Save");
$rest = new Zend_Form_Element_Submit('Rest');
$rest->setAttrib("class", "btn btn-info");
$this->addElements(array($id, $title, $body, $picture, $stick, $submit, $rest));
}
示例10: __construct
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: __construct
/** 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();
}
示例12: 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: __construct
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: init
public function init()
{
$this->setName('f2')->setMethod('post');
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int');
$ma = new Zend_Form_Element_Text('ma');
$ma->setLabel('Mã')->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToUpper')->addValidator(new Zend_Validate_StringLength(0, 10))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input'));
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 250))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
$ofSGUOptions = array("multiOptions" => array('1' => 'Thuộc', '0' => 'Không thuộc'));
$thuoc_sgu = new Zend_Form_Element_Radio('thuoc_sgu', $ofSGUOptions);
$thuoc_sgu->setRequired(true)->setLabel('Thuộc SGU')->setValue('1')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'class' => 'radio_inline'))))->setAttribs(array('id' => 'thuoc_sgu'));
$deptOptions = array("multiOptions" => array('1' => 'Khoa - Bộ môn TT', '0' => 'Phòng ban - Trung tâm'));
$la_khoa = new Zend_Form_Element_Radio('la_khoa', $deptOptions);
$la_khoa->setRequired(true)->setLabel('Loại đơn vị')->setValue('1')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr', 'id' => 'la_khoa', 'class' => 'radio_inline'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'don-vi', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($id, $ma, $ten, $thuoc_sgu, $la_khoa, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')), array('HtmlTag', array('tag' => 'tr', 'id' => 'btn')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'don_vi')), 'Form'));
}
示例15: init
public function init()
{
// init the parent
parent::init();
// set the form's method
$this->setMethod('post');
$id = new Zend_Form_Element_Hidden('id');
$id->setOptions(array('validators' => array(new Zend_Validate_Regex('/^\\d*$/'))));
$this->addElement($id);
$firstname = new Zend_Form_Element_Text('firstname');
$firstname->setOptions(array('label' => $this->t('First name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($firstname);
$lastname = new Zend_Form_Element_Text('lastname');
$lastname->setOptions(array('label' => $this->t('Last name'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($lastname);
$checkEmailNotJunk = new Zend_Validate_Callback(array($this, 'emailNotJetable'));
$uniqueEmailValidator = new Zend_Validate_Db_NoRecordExists(array('table' => 'backoffice_users', 'field' => 'email'));
$email = new Zend_Form_Element_Text('email');
$email->setOptions(array('label' => $this->t('Email'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty', $checkEmailNotJunk, $uniqueEmailValidator)));
$this->addElement($email);
$raisonsocial = new Zend_Form_Element_Text('raison sociale');
$raisonsocial->setOptions(array('label' => $this->t('Raison sociale'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty')));
$this->addElement($raisonsocial);
// $groupsInArrayValidator = new Zend_Validate_InArray(array_keys(array(1, 2, 3)));
// $groupsInArrayValidator->setMessage('Please select at least one group. If you are not sure about which group is better, select "member".');
$status = new Zend_Form_Element_Radio('status');
$status->setOptions(array('label' => $this->t('Status'), 'required' => true, 'filters' => array('StringTrim', 'StripTags'), 'validators' => array('NotEmpty'), 'multiOptions' => array('Gérant' => 'Gérant', 'Associé' => 'Associé', 'Freelance patenté' => 'Freelance patenté')));
$this->addElement($status);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setOptions(array('label' => $this->t('Save user'), 'required' => true, 'order' => 100));
$this->addElement($submit);
}