Ejemplo n.º 1
0
 /**
  * sets transfer data to zend session and shows what was inside this var
  */
 public function setparamAction()
 {
     $form = new Application_Form_Param();
     $this->view->form = $form;
     $sess = Zend_Registry::get('session');
     $this->view->table_display = 'none';
     $sess = Zend_Registry::get('session');
     if (count($sess->transfers) > 0) {
         $this->view->table_display = 'block';
         $this->view->transfers = $sess->transfers;
     }
     if ($this->getRequest()->isPost()) {
         $formData = $this->getRequest()->getPost();
         if ($form->isValid($formData)) {
             $transfers = $sess->transfers;
             $new_transfer = array($formData['host1'], $formData['user1'], $formData['password1'], $formData['host2'], $formData['user2'], $formData['password2']);
             $transfers[] = $new_transfer;
             $sess->transfers = $transfers;
             $form->reset();
             $this->view->transfers = $sess->transfers;
             $this->view->table_display = 'block';
         } else {
             $form->populate($formData);
         }
     }
 }