Exemplo n.º 1
0
     break;
 case "update_comment":
     # Initialize comment, without retrieving it from db
     $comment = new WT_Comment($_POST["comment_id"]);
     # Update DB
     $comment->update($_POST);
     $comment->db_response("json");
     break;
 case "approve_comment":
     $comment = new WT_Comment($_POST["comment_id"]);
     $comment->approve($_POST["_nonce"], $_POST["event_id"]);
     $comment->db_response("json");
     break;
 case "unapprove_comment":
     $comment = new WT_Comment($_POST["comment_id"]);
     $comment->unapprove($_POST["_nonce"], $_POST["event_id"]);
     $comment->db_response("json");
     break;
 case "delete_comment":
     $comment = new WT_Comment($_POST["comment_id"]);
     $comment->delete($_POST["_nonce"], $_POST["event_id"]);
     $comment->db_response("json");
     break;
 case "delete_all_comments":
     unset($_POST["action"]);
     if ($_POST["id"]) {
         $comment = new WT_Comment();
         $comment->delete_all(json_decode(stripslashes($_POST["id"])), $_POST["_nonce"]);
         $comment->db_response("json");
     }
     break;