Example #1
0
 /**
  * delete topic
  * 
  * @return void
  */
 public function deleteAction($options)
 {
     if (!isset($options['id']) || empty($options['id'])) {
         die("You did not pass in an ID");
     }
     $topic = $this->data->getTopic($options['id']);
     if ($topic === false) {
         die("Topic not found");
     }
     if ($this->data->delete($options['id'])) {
         header("location: /index.php");
     } else {
         echo "An error occured";
     }
     exit;
 }