From c2a680f932b589ada25a5c4c95523ffe07976b79 Mon Sep 17 00:00:00 2001 From: Sem Date: Sun, 6 Nov 2011 01:30:19 +0100 Subject: Reordered actions (deleted some). --- actions/videolist/delete.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 actions/videolist/delete.php (limited to 'actions/videolist/delete.php') diff --git a/actions/videolist/delete.php b/actions/videolist/delete.php new file mode 100644 index 000000000..221109ec4 --- /dev/null +++ b/actions/videolist/delete.php @@ -0,0 +1,33 @@ + + * @copyright Prateek Choudhary + */ +// Make sure we're logged in (send us to the front page if not) +gatekeeper(); + +// Get input data +$guid = (int) get_input('video'); + +// Make sure we actually have permission to edit +$video = get_entity($guid); +if ($video->getSubtype() == "videolist" && $video->canEdit()) { + // Get owning user + $owner = get_entity($video->getOwner()); + + // Delete it! + $rowsaffected = $video->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($_SERVER['HTTP_REFERER']); +} \ No newline at end of file -- cgit v1.2.3