aboutsummaryrefslogtreecommitdiff
path: root/actions/delete.php
diff options
context:
space:
mode:
authorDave Tosh <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-07 09:12:36 +0000
committerDave Tosh <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-07 09:12:36 +0000
commit27060aa8d0f1782ebe7595d1c02fdca0a5dd6725 (patch)
treefeb1e07eb0b6cb667a59519990d08a216aa7883a /actions/delete.php
parent1b812b80069ee62c112488e7b5d883ea263e0ce4 (diff)
downloadelgg-27060aa8d0f1782ebe7595d1c02fdca0a5dd6725.tar.gz
elgg-27060aa8d0f1782ebe7595d1c02fdca0a5dd6725.tar.bz2
delete wired up on videolist - still need to add edit
Diffstat (limited to 'actions/delete.php')
-rw-r--r--actions/delete.php18
1 files changed, 5 insertions, 13 deletions
diff --git a/actions/delete.php b/actions/delete.php
index e98e81b67..221109ec4 100644
--- a/actions/delete.php
+++ b/actions/delete.php
@@ -11,24 +11,17 @@
// 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');
+$guid = (int) get_input('video');
// Make sure we actually have permission to edit
-$videos = get_entity($guid);
-if ($videos->getSubtype() == "videolist" && $videos->canEdit()) {
+$video = get_entity($guid);
+if ($video->getSubtype() == "videolist" && $video->canEdit()) {
// Get owning user
- $owner = get_entity($videos->getOwner());
+ $owner = get_entity($video->getOwner());
// Delete it!
- $rowsaffected = $videos->delete();
+ $rowsaffected = $video->delete();
if ($rowsaffected > 0) {
// Success message
system_message(elgg_echo("videos:deleted"));
@@ -36,6 +29,5 @@ if ($videos->getSubtype() == "videolist" && $videos->canEdit()) {
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']);
} \ No newline at end of file