本文整理汇总了PHP中Zend_Form_Element_Button::setDecorators方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Button::setDecorators方法的具体用法?PHP Zend_Form_Element_Button::setDecorators怎么用?PHP Zend_Form_Element_Button::setDecorators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Button
的用法示例。
在下文中一共展示了Zend_Form_Element_Button::setDecorators方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->setName('year_report')->setMethod('post');
$nams = array();
for ($i = 2005; $i < 2030; $i++) {
$nams[$i] = $i;
}
$namOption = array("multiOptions" => $nams);
$from = new Zend_Form_Element_Select('year_from', $namOption);
$from->setLabel('Từ : ')->setValue(date('Y'))->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'from'))))->setAttribs(array('style' => 'width:10%'));
$to = new Zend_Form_Element_Select('year_to', $namOption);
$to->setLabel('Đến : ')->setValue(date('Y') + 1)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'to'))))->setAttribs(array('style' => 'width:10%'));
$amounts = array();
for ($i = 1; $i <= 10; $i++) {
$amounts[$i * 10] = $i * 10;
}
$amountOptions = array("multiOptions" => $amounts);
$amount = new Zend_Form_Element_Select('year_amount', $amountOptions);
$amount->setLabel('Số lượng GV : ')->setValue(10)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'amount'))));
$submit = new Zend_Form_Element_Button('year_submit');
$submit->setLabel('Xem');
$submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span', 'align' => 'left')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'style' => 'margin-left : 10px'))));
$this->addElements(array($from, $to, $amount, $submit));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'year_report')), 'Form'));
}
示例2: 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ã (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->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'))))->setAttrib('class', 'text-input');
$ten = new Zend_Form_Element_Text('ten');
$ten->setLabel('Tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->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'))))->setAttrib('class', 'text-input medium-input');
$mo_ta = new Zend_Form_Element_Textarea('mo_ta');
$mo_ta->setLabel('Mô 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', 'class' => 'textarea', 'rows' => '4'));
$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 lĩnh vực')->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'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'linh-vuc', '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, $mo_ta, $ma_loai, $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' => 'linh_vuc')), 'Form'));
}
示例3: 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'));
}
示例4: init
public function init()
{
$this->setMethod('post');
// $this->setAction('/index/login');
$this->setAttrib('id', 'msform');
$email = new Zend_Form_Element_Text('email');
$email->setAttrib('placeholder', 'E-mail');
$email->setAttrib('autocomplete', 'off');
$email->addFilter('StripTags');
$email->addFilter('HtmlEntities');
$email->addFilter('StringTrim');
$email->setRequired(true)->addErrorMessage('Username Required');
$email->addValidator('EmailAddress')->addErrorMessage('Invalid Email used');
$email->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
$password = new Zend_Form_Element_Password('password');
$password->setAttrib('placeholder', 'Password');
$password->setAttrib('autocomplete', 'off');
$password->addFilter('StripTags');
$password->addFilter('HtmlEntities');
$password->addFilter('StringTrim');
$password->setRequired(true)->addErrorMessage('Password Required');
$password->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
$link = new Zend_Form_Element_Note('forgot_password', array('value' => '<a href="#" id="link">Forgot your password ?</a>'));
$submit = new Zend_Form_Element_Submit('SignIn');
$submit->setLabel('Sign In');
$submit->setAttrib('class', 'btn btn-info');
$register = new Zend_Form_Element_Button('register');
$register->setLabel('Register');
$register->setAttrib('class', 'btn btn-warning');
$this->addElements(array($email, $password, $submit, $register, $link));
$this->setElementDecorators(array('ViewHelper'));
$submit->setDecorators(array('ViewHelper'));
$register->setDecorators(array('ViewHelper'));
$this->setDecorators(array('FormElements', 'Form'));
}
示例5: 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'));
}
示例6: init
public function init()
{
$this->setName('f2')->setMethod('post');
$ma_cong_tac = new Zend_Form_Element_Hidden('ma_cong_tac');
$this->addElement($ma_cong_tac);
$ngay = new Zend_Form_Element_Text('ngay');
$ngay->setLabel('Ngày (*)')->setDescription('(dd-mm-YYYY)')->setRequired(true)->addFilter('StripTags')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'ngay'));
$this->addElement($ngay);
$buoiOptions = Default_Model_Constraints::lichct_buoi();
$buoi = new Zend_Form_Element_Select('buoi');
$buoi->setLabel('Buổi (*)')->setRequired(true)->addMultiOptions($buoiOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
$this->addElement($buoi);
$noi_dung = new Zend_Form_Element_Textarea('noi_dung');
$noi_dung->setLabel('Nội dung')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ghi_chu', 'class' => 'text-input textarea', 'rows' => 4));
$this->addElement($noi_dung);
$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'))));
$this->addElement($quan_trong);
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setLabel('Lưu và tiếp tục')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$this->addElement($submitCon);
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setLabel('Lưu và thoát')->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$this->addElement($submitExit);
$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' => 'history.go(-1); return false;'));
$this->addElement($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')->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'));
}
示例8: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
$this->addElement('Hidden', 'search', array('value' => 1));
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 85%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$quan_trong = new Zend_Form_Element_Select('quan_trong');
$quan_trong->setLabel('Quan Trọng')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$noi_bat = new Zend_Form_Element_Select('noi_bat');
$noi_bat->setLabel('Nổi Bật')->setRequired(true)->setValue(0)->addMultiOptions(array(0 => 'Không', 1 => 'Có'))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel('Upload hình')->setDescription('(*.jgp, *.gif, *.png , < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('jpg,gif,png')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$image = new Zend_Form_Element_Image('image');
$image->setLabel('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
$trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
$trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$mo_ta_tom_tat = new Zend_Form_Element_Textarea('mo_ta_tom_tat');
$mo_ta_tom_tat->setLabel('Mô tả tóm tắt')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_tom_tat', 'class' => 'textarea', 'rows' => '4'));
$mo_ta_chi_tiet = new Zend_Form_Element_Textarea('mo_ta_chi_tiet');
$mo_ta_chi_tiet->setLabel('Mô tả chi tiết (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'mo_ta_chi_tiet', 'class' => 'text-input textarea'));
$pdf = new Zend_Form_Element_File('pdf');
$pdf->setLabel('Upload PDF')->setDescription('(*.pdf < 10MB )')->setDestination(BASE_PATH . '/upload/files/tin_tuc')->addValidator(new Zend_Validate_File_Extension(array('pdf')))->addValidator(new Zend_Validate_File_FilesSize(array('min' => 1, 'max' => 10485760, 'bytestring' => true)))->setDecorators(array('File', 'Errors', array('Description', array('escape' => false, 'tag' => 'div', 'placement' => 'append')), array('HtmlTag', array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$url = new Zend_View_Helper_Url();
$link = $url->url(array('module' => 'admin', 'controller' => 'tin-tuc', 'action' => 'index'), null, true);
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $link . '"'));
$this->addElements(array($tieu_de, $quan_trong, $noi_bat, $photo, $image, $pdf, $trang_thai, $mo_ta_tom_tat, $mo_ta_chi_tiet, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table', 'class' => 'tin_tuc')), 'Form'));
}
示例9: init
public function init()
{
$this->setName('dept_report')->setMethod('post');
$nams = array();
for ($i = 2005; $i < 2030; $i++) {
$nams[$i] = $i;
}
$namOption = array("multiOptions" => $nams);
$from = new Zend_Form_Element_Select('dept_from', $namOption);
$from->setLabel('Từ : ')->setValue(date('Y'))->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'from', 'style' => 'margin-left : 23px'))))->setAttribs(array('style' => 'width:10%'));
$to = new Zend_Form_Element_Select('dept_to', $namOption);
$to->setLabel('Đến : ')->setValue(date('Y') + 1)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'to'))))->setAttribs(array('style' => 'width:10%'));
$don_vi = new Default_Model_DonVi();
$dv = $don_vi->getDSDVSGU();
unset($dv['1']);
$dvOptions = array("multiOptions" => $dv);
$ma_don_vi = new Zend_Form_Element_Select('dept_don_vi', $dvOptions);
$ma_don_vi->setRequired(true)->setLabel('Đơn vị : ')->setValue('0')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'div', 'style' => 'margin-bottom: 10px;'))))->setAttribs(array('id' => 'dept_don_vi', 'style' => 'width : 50%'));
$amounts = array();
for ($i = 1; $i <= 10; $i++) {
$amounts[$i * 10] = $i * 10;
}
$amountOptions = array("multiOptions" => $amounts);
$amount = new Zend_Form_Element_Select('dept_amount', $amountOptions);
$amount->setLabel('Số lượng GV : ')->setValue(10)->setRequired(true)->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array('Label', array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'class' => 'amount'))));
$submit = new Zend_Form_Element_Button('dept_submit');
$submit->setLabel('Xem');
$submit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span', 'align' => 'left')), array(array('row' => 'HtmlTag'), array('tag' => 'span', 'style' => 'margin-left : 10px'))));
$this->addElements(array($ma_don_vi, $from, $to, $amount, $submit));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'dept_report')), 'Form'));
}
示例10: 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')->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'));
$ho_ten = new Zend_Form_Element_Text('ho_ten');
$ho_ten->setLabel('Họ tên (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 120))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
$chuc_vu = new Zend_Form_Element_Text('chuc_vu');
$chuc_vu->setLabel('Chức vụ')->addFilter('StripTags')->addFilter('StringTrim')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input medium-input');
$don_vi = new Default_Model_DonVi();
$dvOptions = array("multiOptions" => $don_vi->getDSDV());
$ma_don_vi = new Zend_Form_Element_Select('ma_don_vi', $dvOptions);
$ma_don_vi->setRequired(true)->setLabel('Đơn vị (*)')->setValue(Default_Model_Constraints::ID_DHSG)->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$hoc_vi = new Default_Model_HocVi();
$hvOptions = array("multiOptions" => $hoc_vi->getDSHV());
$ma_hoc_vi = new Zend_Form_Element_Select('ma_hoc_vi', $hvOptions);
$ma_hoc_vi->setRequired(true)->setLabel('Học vị (*)')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$email = new Zend_Form_Element_Text('email');
$email->setLabel('Email')->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_EmailAddress())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'id' => 'email'));
$so_dien_thoai = new Zend_Form_Element_Text('so_dien_thoai');
$so_dien_thoai->setLabel('Số điện thoại')->addFilter('StringTrim')->addValidator(new Zend_Validate_Int())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('class' => 'text-input', 'onkeypress' => 'return inputNumber(event)'));
$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'));
$link = Zend_Controller_Front::getInstance()->getRouter()->assemble(array('module' => 'admin', 'controller' => 'giang-vien', '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, $ho_ten, $ma_don_vi, $ma_hoc_vi, $chuc_vu, $email, $so_dien_thoai, $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' => 'giang_vien')), 'Form'));
}
示例11: init
public function init()
{
$this->setName('f2')->setAttrib('enctype', 'multipart/form-data')->setMethod('post');
$this->addElement('Hidden', 'search', array('value' => 1));
$tieu_de = new Zend_Form_Element_Text('tieu_de');
$tieu_de->setLabel('Tiêu đề (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$cateOptions = Khcn_Api::_()->getDbTable('loai_audio', 'default')->getListAssoc();
$loai_audio_id = new Zend_Form_Element_Select('loai_audio_id');
$loai_audio_id->setLabel('Loại (*)')->addMultiOptions($cateOptions)->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input');
$noi_dung = new Zend_Form_Element_Textarea('noi_dung');
$noi_dung->setLabel('Nội dung (*)')->setRequired(true)->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'noi_dung', 'class' => 'text-input textarea'));
$soundcloud_embed = new Zend_Form_Element_Text('soundcloud_embed');
$soundcloud_embed->setLabel('Embed SoundCloud')->setDescription('How to get SoundCloud embed code? <a href="http://help.soundcloud.com/customer/portal/articles/243751-how-can-i-put-my-track-or-playlist-on-my-site-or-blog-" target="_blank">Click here</a>')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'div', 'escape' => false, 'placement' => 'append')), array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 90%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttrib('class', 'text-input large-input');
$statusOptions = array("multiOptions" => Default_Model_Constraints::trang_thai());
$trang_thai = new Zend_Form_Element_Radio('trang_thai', $statusOptions);
$trang_thai->setRequired(true)->setLabel('Trạng thái')->setValue('1')->setSeparator('')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))));
$submitCon = new Zend_Form_Element_Submit('submitCon');
$submitCon->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$submitExit = new Zend_Form_Element_Submit('submitExit');
$submitExit->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button'));
$cancel = new Zend_Form_Element_Button('cancel');
$cancel->setDecorators(array('ViewHelper', array(array('data' => 'HtmlTag'), array('tag' => 'span')), array(array('row' => 'HtmlTag'), array('tag' => 'span'))))->setAttribs(array('class' => 'button', 'onclick' => 'window.location.href="' . $_SERVER['HTTP_REFERER'] . '"'));
$this->addElements(array($tieu_de, $loai_audio_id, $noi_dung, $soundcloud_embed, $trang_thai, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submit', array('decorators' => array('FormElements', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)), array(array('row' => 'HtmlTag'), array('tag' => 'td')))));
$this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'table')), 'Form'));
}
示例12: init
public function init()
{
$this->setName('f2')->setMethod('post');
$nams = Default_Model_Constraints::nam();
$namOption = array("multiOptions" => $nams);
$nam = new Zend_Form_Element_Select('nam', $namOption);
$nam->setValue(date('Y'))->setLabel('Năm (*)')->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'))))->setAttribs(array('id' => 'nam'));
$bizHDD = new Default_Model_Hdd();
$hdds = $bizHDD->getDSHDByNam(date('Y'));
if ($hdds == null) {
$hdsOptions = array("multiOptions" => array('-1' => '== Chưa thành lập =='));
} else {
$hdds = array('0' => '== Tất cả ==') + $hdds;
$hddsOptions = array("multiOptions" => $hdds);
}
$noi_nhan = new Zend_Form_Element_Select('noi_nhan', $hddsOptions);
$noi_nhan->setRequired(true)->setLabel('Hội đồng')->setValue('0')->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_nhan'))->setRegisterInArrayValidator(false);
$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')), 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'));
$submit = new Zend_Form_Element_Submit('submit');
$submit->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' => 'hoi-dong', 'action' => 'ds-mail-tb'), 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($nam, $noi_nhan, $tieu_de, $noi_dung, $submit, $cancel));
$this->addDisplayGroup(array('submit', 'cancel'), 'btn_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'));
}
示例13: 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'));
}
示例14: init
public function init()
{
$this->setName('f2')->setMethod('post')->setAttribs(array('id' => 'user'));
$id = new Zend_Form_Element_Hidden('id');
$id->addFilter('Int')->removeDecorator('label');
$username = new Zend_Form_Element_Text('ten_dang_nhap');
$username->setLabel('Tên đăng nhập (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addFilter('StringToLower')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 32))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 83%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ten_dang_nhap', 'class' => 'text-input'));
$password = new Zend_Form_Element_Password('mat_khau');
$password->setLabel('Mật khẩu (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->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' => 'mat_khau', 'class' => 'text-input'));
$repassword = new Zend_Form_Element_Password('mat_khau_2');
$repassword->setLabel('Nhập lại mật khẩu (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator(new Zend_Validate_Identical('mat_khau'))->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' => 'mat_khau_2', 'class' => 'text-input'));
$ho = new Zend_Form_Element_Text('ho');
$ho->setLabel('Họ (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_StringLength(0, 100))->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td', 'style' => 'width: 83%')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ho', '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, 20))->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' => 'ten', 'class' => 'text-input'));
$ngay_sinh = new Zend_Form_Element_Text('ngay_sinh');
$ngay_sinh->setLabel('Ngày sinh (*)')->setDescription('(dd-mm-YYYY)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDecorators(array('ViewHelper', 'Errors', array('Description', array('tag' => 'span')), array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'ngay_sinh', 'class' => 'text-input'));
$email = new Zend_Form_Element_Text('email');
$email->setLabel('Email (*)')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addValidator(new Zend_Validate_EmailAddress())->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'td')), array('Label', array('tag' => 'td')), array(array('row' => 'HtmlTag'), array('tag' => 'tr'))))->setAttribs(array('id' => 'email', 'class' => 'text-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' => 'index', 'action' => 'index'));
$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, $username, $password, $repassword, $ho, $ten, $ngay_sinh, $email, $submitCon, $submitExit, $cancel));
$this->addDisplayGroup(array('submitCon', 'submitExit', 'cancel'), 'submitbtn', 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')), 'Form'));
}
示例15: createMigrateForm
/** Main form */
public function createMigrateForm($assetstores)
{
// Setup the form
$form = new Zend_Form();
$form->setAction('migratemidas2');
$form->setName('migrateForm');
$form->setMethod('post');
$form->setAttrib('class', 'migrateForm');
// Input directory
$midas2_hostname = new Zend_Form_Element_Text('midas2_hostname', array('label' => $this->t('MIDAS2 Hostname'), 'size' => 60, 'value' => 'localhost'));
$midas2_hostname->setRequired(true);
$form->addElement($midas2_hostname);
$midas2_port = new Zend_Form_Element_Text('midas2_port', array('label' => $this->t('MIDAS2 Port'), 'size' => 4, 'value' => '5432'));
$midas2_port->setRequired(true);
$midas2_port->setValidators(array(new Zend_Validate_Digits()));
$form->addElement($midas2_port);
$midas2_user = new Zend_Form_Element_Text('midas2_user', array('label' => $this->t('MIDAS2 User'), 'size' => 60, 'value' => 'midas'));
$midas2_user->setRequired(true);
$form->addElement($midas2_user);
$midas2_password = new Zend_Form_Element_Password('midas2_password', array('label' => $this->t('MIDAS2 Password'), 'size' => 60, 'value' => 'midas'));
$midas2_password->setRequired(true);
$form->addElement($midas2_password);
$midas2_database = new Zend_Form_Element_Text('midas2_database', array('label' => $this->t('MIDAS2 Database'), ' size' => 60, 'value' => 'midas'));
$midas2_database->setRequired(true);
$form->addElement($midas2_database);
$midas2_assetstore = new Zend_Form_Element_Text('midas2_assetstore', array('label' => $this->t('MIDAS2 Assetstore Path'), 'size' => 60, 'value' => 'C:/xampp/midas/assetstore'));
$midas2_assetstore->setRequired(true);
$form->addElement($midas2_assetstore);
// Button to select the directory on the server
$midas2_assetstore_button = new Zend_Form_Element_Button('midas2_assetstore_button', $this->t('Choose'));
$midas2_assetstore_button->setDecorators(array('ViewHelper', array('HtmlTag', array('tag' => 'div', 'class' => 'browse-button')), array('Label', array('tag' => 'div', 'style' => 'display:none'))));
$form->addElement($midas2_assetstore_button);
// Assetstore
$assetstoredisplay = array();
$assetstoredisplay[0] = $this->t('Choose one...');
// Initialize with the first type (MIDAS)
foreach ($assetstores as $assetstore) {
if ($assetstore->getType() == 0) {
$assetstoredisplay[$assetstore->getAssetstoreId()] = $assetstore->getName();
}
}
$assetstore = new Zend_Form_Element_Select('assetstore');
$assetstore->setLabel($this->t('MIDAS3 Assetstore'));
$assetstore->setMultiOptions($assetstoredisplay);
$assetstore->setDescription(' <a class="load-newassetstore" href="#newassetstore-form" rel="#newassetstore-form" title="' . $this->t('Add a new assetstore') . '"> ' . $this->t('Add a new assetstore') . '</a>')->setDecorators(array('ViewHelper', array('Description', array('escape' => false, 'tag' => false)), array('HtmlTag', array('tag' => 'dd')), array('Label', array('tag' => 'dt')), 'Errors'));
$assetstore->setRequired(true);
$assetstore->setValidators(array(new Zend_Validate_GreaterThan(array('min' => 0))));
$assetstore->setRegisterInArrayValidator(false);
// This array is dynamic so we disable the validator
$form->addElement($assetstore);
// Submit
$submit = new Zend_Form_Element_Button('migratesubmit', $this->t('Migrate'));
$form->addElement($submit);
return $form;
}