✏️ 正在编辑: Form.php
路径:
/srv/systems_dir/koruspay/library/Core/Form.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Core_Form extends Zend_Form { public function init() { $this->setAttrib('autocomplete', 'off'); $this->setMethod('post'); } protected function _addFilterButtons() { $submit = new Zend_Form_Element_Submit('btn_filtrar', array( 'label' => 'Buscar', 'class' => 'bt_find' )); $submit->removeDecorator('DtDdWrapper'); $this->addElement($submit); $btNew = new Zend_Form_Element_Button('btn_new', array( 'label' => 'Novo Cadastro', 'class' => 'bt_new', 'onclick' => "window.location='" . $this->getView()->url(array('controller' => $this->getController(), 'action' => 'save'), null, true) . "'" )); $btNew->removeDecorator('DtDdWrapper'); $this->addElement($btNew); $btnReset = new Zend_Form_Element_Button('btn_reset', array( 'label' => 'Limpar campos', 'onclick' => "resetElements(this.form)" )); $btnReset->removeDecorator('DtDdWrapper'); $this->addElement($btnReset); $this->addDisplayGroup(array( $submit, $btNew, $btnReset ), 'buttons', array( 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'dd', 'class' => 'buttons'))) )); // $this->getDisplayGroup('buttons')->removeDecorator('HtmlTag'); } protected function _addSaveButtons() { $btBack = new Zend_Form_Element_Button('btn_back', array( 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => "window.location='" . $this->getView()->url(array('action' => 'index')) . "'" )); $btBack->removeDecorator('DtDdWrapper'); $this->addElement($btBack); $btSave = new Zend_Form_Element_Submit('btn_save', array( 'label' => 'Salvar', 'class' => 'bt_save', )); $btSave->removeDecorator('DtDdWrapper'); $this->addElement($btSave); $btNew = new Zend_Form_Element_Button('btn_new', array( 'label' => 'Novo Cadastro', 'class' => 'bt_new', 'onclick' => "window.location='" . $this->getView()->url(array( 'controller' => $this->getController(), 'action' => 'save'), null, true) . "'" )); $btNew->removeDecorator('DtDdWrapper'); $this->addElement($btNew); $this->addDisplayGroup(array( $btBack, $btSave, $btNew ), 'buttons', array( 'decorators' => array('FormElements', array('HtmlTag', array('tag' => 'dd', 'class' => 'buttons'))) )); $this->getController(); } protected function getController() { $front = Zend_Controller_Front::getInstance(); $request = $front->getRequest(); $params = $request->getParams(); return $params['controller']; } protected function _addSearchButtons() { $this->addElement('submit', 'btn_filtrar', array( 'label' => 'Buscar', 'class' => 'bt_find' )); } protected function _addExportButtons() { $this->addElement('submit', 'btn_exportar', array( 'label' => 'Exportar', 'class' => 'bt_export' )); } protected function _addImportButtons() { $this->addElement('submit', 'btn_importar', array( 'label' => 'Importar', 'class' => 'bt_save' )); } protected function _addSaveButton() { $this->addElement('submit', 'btn_save', array( 'label' => 'Salvar', 'class' => 'bt_save', )); $this->_addElementToDisplay('btn_save', 'buttons'); } protected function _addBackButton() { $this->addElement('button', 'btn_back', array( 'label' => 'Voltar', 'class' => 'bt_back', 'onclick' => "window.location='" . $this->getView()->url(array('action' => 'index')) . "'" )); $this->_addElementToDisplay('btn_back', 'buttons'); } protected function _addElementToDisplay($element, $display) { $btns = $this->getDisplayGroup($display); if( is_object($btns) ){ $btns->addElement($this->getElement($element), $display); $elements = $btns->getElements(); foreach ($elements as $element){ $element->removeDecorator('DtDdWrapper'); } $this->addDisplayGroup($elements, $display, array('decorators' => array('FormElements', array('HtmlTag', array('tag' => 'dd', 'class' => 'buttons'))))); }else{ $this->addDisplayGroup(array($element), $display); } } protected function _addNewButton() { $btNew = new Zend_Form_Element_Button('btn_new', array( 'label' => 'Novo Cadastro', 'class' => 'bt_new', 'onclick' => "window.location='" . $this->getView()->url(array( 'controller' => $this->getController(), 'action' => 'save'), null, true) . "'" )); $btNew->removeDecorator('DtDdWrapper'); $this->addElement($btNew); } protected function _addResetButtons() { $btn = new Zend_Form_Element_Button('btn_reset', array( 'label' => 'Limpar campos', 'onclick' => "resetElements(this.form)" )); $this->addElement($btn); } }
💾 保存文件
← 返回文件管理器