Esempio n. 1
0
 /**
  * Display a question
  *
  * @return     void
  */
 public function questionTask()
 {
     // Incoming
     $this->view->id = Request::getInt('id', 0);
     $this->view->note = $this->_note(Request::getInt('note', 0));
     $this->view->question = Question::getInstance($this->view->id);
     // Ensure we have an ID to work with
     if (!$this->view->id) {
         throw new Exception(Lang::txt('COM_ANSWERS_ERROR_QUESTION_ID_NOT_FOUND'), 500);
     }
     // Check if person voted
     $this->view->voted = 0;
     if (!User::isGuest()) {
         $this->view->voted = $this->view->question->voted();
     }
     // Set the page title
     $this->_buildTitle($this->view->question);
     // Set the pathway
     $this->_buildPathway($this->view->question);
     // Output HTML
     $this->view->config = $this->config;
     if (!isset($this->view->responding)) {
         $this->view->responding = 0;
     }
     $this->view->notifications = array();
     foreach ($this->getErrors() as $error) {
         $this->view->notifications[] = array('type' => 'error', 'message' => $error);
     }
     $this->view->setLayout('question')->display();
 }