Ejemplo n.º 1
0
 public function detailsAction()
 {
     if ($datas = $this->getRequest()->getParams()) {
         try {
             if (empty($datas['comment_id']) or empty($datas['option_value_id'])) {
                 throw new Exception($this->_('An error occurred during process. Please try again later.'));
             }
             $comment_id = $datas['comment_id'];
             $comment = new Comment_Model_Comment();
             if ($comment_id != 'new') {
                 $comment->find($comment_id);
                 if (!$comment->getId() or $comment->getValueId() != $this->getCurrentOptionValue()->getId()) {
                     throw new Exception($this->_('An error occurred during process. Please try again later.'));
                 }
             } else {
                 $comment->setId($comment_id);
             }
             $html = $this->getLayout()->addPartial('view_details', 'core_view_mobile_default', "comment/l{$this->_layout_id}/view/details.phtml")->setCurrentComment($comment)->toHtml();
             $html = array('html' => $html, 'title' => $this->getApplication()->getName());
         } catch (Exception $e) {
             $html = array('error' => 1, 'message' => $e->getMessage());
         }
         $this->_sendHtml($html);
     }
 }