Esempio n. 1
0
 /**
  * Perform some actions on the form, right before it is displayed but already populated
  *
  * Here we add the table display to the form.
  *
  * @return \Zend_Form
  */
 public function beforeDisplay()
 {
     if ($this->_csrf) {
         $this->_csrf->initCsrfToken();
     }
     if ($this->layoutAutoWidthFactor || $this->layoutFixedWidth) {
         $div = new \MUtil_Html_DivFormElement();
         if ($this->layoutFixedWidth) {
             $div->setAsFormLayout($this->_form, $this->layoutFixedWidth);
         } else {
             $div->setAutoWidthFormLayout($this->_form, $this->layoutAutoWidthFactor);
         }
     }
 }
 /**
  * Creates from the model a \Zend_Form using createForm and adds elements
  * using addFormElements().
  *
  * @param int $step The current step
  * @return \Zend_Form
  */
 protected function getFormFor($step)
 {
     $baseform = $this->createForm();
     if ($this->trackEngine && $step == 4 && \MUtil_Bootstrap::enabled() !== true && $baseform instanceof \MUtil_Form) {
         $model = $this->getModel();
         $table = new \MUtil_Html_DivFormElement();
         $table->setAsFormLayout($baseform);
         $baseform->setAttrib('class', $this->class);
         $bridge = $model->getBridgeFor('form', $baseform);
         $this->_items = null;
         $this->initItems();
         $this->addFormElementsFor($bridge, $model, $step);
         return $baseform;
     } else {
         return parent::getFormFor($step);
     }
 }