示例#1
0
 /**
  *
  */
 private function editThread()
 {
     $threads = new Threads();
     if (isset($_POST['important']) && UserHelper::isAdmin()) {
         $res = $threads->update(["title" => $_POST['title'], "category" => $_POST['category'], "important" => $_POST['important']], $threads->getAdapter()->quoteInto("id=?", $_POST['thread_id']));
     } else {
         $res = $threads->update(["title" => $_POST['title'], "category" => $_POST['category'], "important" => 0], $threads->getAdapter()->quoteInto("id=?", $_POST['thread_id']));
     }
     $view = new View($res !== false);
     $view->sendResponse();
 }