Beispiel #1
0
            break;
        case ACTION_POST_COMMENT:
            $content = isset($_POST["content"]) ? $_POST["content"] : false;
            $entryId = isset($_POST["entry_id"]) ? $_POST["entry_id"] : false;
            if ($content && $entryId) {
                CommentManager::PostComment($loggedUser, $content, EntryType::XCLAM, $entryId);
            }
            break;
        case ACTION_EDIT_COMMENT_FORM:
            $id = $_GET["id"];
            $editingComment = CommentManager::GetCommentById($id);
            $includedPage = "edit_comment";
            break;
        case ACTION_SUBMIT_EDITED_COMMENT:
            $id = $_POST["id"];
            $content = $_POST["content"];
            $entryId = $_POST["entry_id"];
            CommentManager::UpdateComment($id, $loggedUser, $content, EntryType::XCLAM, $entryId);
            break;
        case ACTION_DELETE_COMMENT:
            if (isset($_GET["id"])) {
                CommentManager::DeleteComment($_GET["id"]);
            }
            break;
        default:
            break;
    }
} else {
    $message = "Please log in before take this action.";
}
include "pages/xclams/{$includedPage}.php";