示例#1
0
 public function handleActions()
 {
     $this->thread->handleThreadViewActions($this->scriptProperties);
 }
 /**
  * Handle actions on thread view
  * 
  * @param array $scriptProperties
  * @return boolean
  */
 public function handleThreadViewActions(array $scriptProperties)
 {
     $success = parent::handleThreadViewActions($scriptProperties);
     if (!empty($scriptProperties['answer']) && $this->canMarkAsAnswer()) {
         if ($this->markAsAnswer($scriptProperties['answer'])) {
             $this->xpdo->sendRedirect($this->getUrl());
         }
     }
     if (!empty($scriptProperties['unanswer']) && $this->canMarkAsAnswer()) {
         if ($this->unmarkAsAnswer($scriptProperties['unanswer'])) {
             $this->xpdo->sendRedirect($this->getUrl());
         }
     }
     return $success;
 }