Ejemplo n.º 1
0
 function contactAction()
 {
     try {
         // Check if the form is posted.
         if ($this->getRequest()->isPost()) {
             // [Xinghao] Get form data.
             $this->view->formData = $this->getRequest()->getPost();
             //print_r($this->view->formData);
             $this->indexAction();
             //$this->view->tab = $this->view->detailTab->getFormTabName();
             $this->view->detailTab->setTabSequence($this->view->detailTab->formTabSeq);
             $form = $this->view->detailTab->getForm();
             if ($form->isValid($this->view->formData)) {
                 $this->view->detailTab->setDisplayForm(false);
                 //	print_r($this->view->detailTab->getPostingDataForContactForm());
                 EmailManager::sentContactEmail($this->view->formData, $this->view->detailTab->getPostingDataForContactForm());
                 /*
                 					Email::sendMail($this->view->formData["email_from"],
                 									$this->view->formData["fullname"],
                 									"Query form " . $this->view->formData["fullname"],
                 									$this->view->formData["question"]);
                 */
             } else {
                 $this->view->detailTab->setDisplayForm(true);
             }
             $this->renderScript('posting/index.phtml');
         } else {
             //TODO::redirect ot 404 page.
         }
     } catch (Exception $e) {
         logError("contactAction: ", $e);
         echo $e;
     }
 }