From a161b38e65fa698133402f4fb23548242f494018 Mon Sep 17 00:00:00 2001 From: Dave Tosh Date: Tue, 23 Mar 2010 17:30:14 +0000 Subject: This videolist plugin shows real promise so we shall work on it for v1.8 then release it back to the community. --- actions/delete.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 actions/delete.php (limited to 'actions/delete.php') diff --git a/actions/delete.php b/actions/delete.php new file mode 100644 index 000000000..da3ad0c3b --- /dev/null +++ b/actions/delete.php @@ -0,0 +1,44 @@ + + * @copyright Prateek Choudhary + */ +// Make sure we're logged in (send us to the front page if not) +gatekeeper(); + + // Get the current page's owner + $page_owner = page_owner_entity(); + if ($page_owner === false || is_null($page_owner)) { + $page_owner = $_SESSION['user']; + set_page_owner($_SESSION['guid']); + } + + // Get input data + $guid = (int) get_input('video_id'); + + // Make sure we actually have permission to edit + $videos = get_entity($guid); + if ($videos->getSubtype() == "videolist" && $videos->canEdit()) { + + // Get owning user + $owner = get_entity($videos->getOwner()); + // Delete it! + $rowsaffected = $videos->delete(); + if ($rowsaffected > 0) { + // Success message + system_message(elgg_echo("videos:deleted")); + } else { + register_error(elgg_echo("videos:notdeleted")); + } + // Forward to the main video list page + //forward("pg/videolist/owned/" . page_owner_entity()->username); + forward($_SERVER['HTTP_REFERER']); + + } + +?> -- cgit v1.2.3