aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/delete.php18
-rw-r--r--languages/en.php1
-rw-r--r--start.php3
-rw-r--r--views/default/forms/edit.php1
-rw-r--r--views/default/object/videolist.php4
5 files changed, 11 insertions, 16 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
diff --git a/languages/en.php b/languages/en.php
index 886b13859..f4d2294b2 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -56,6 +56,7 @@ $english = array(
"videolist:searchTubeVideos:googlevideos" => "Search video.google.com",
"videolist:group" => "Group Videos",
"videolist:groupall" => "All Group Videos",
+ "videolist:delete:confirm" => "Are you sure you want to delete this video?",
"videolist:none" => "This group does not have any videos yet",
"videolist:none:found" => "No videos were found."
);
diff --git a/start.php b/start.php
index b57f66d37..84a624932 100644
--- a/start.php
+++ b/start.php
@@ -200,5 +200,6 @@ register_elgg_event_handler('annotate','all','videolist_object_notifications');
global $CONFIG;
register_action("videolist/add", false, $CONFIG->pluginspath . "videolist/actions/add.php");
+register_action("videolist/edit", false, $CONFIG->pluginspath . "videolist/actions/edit.php");
register_action("videolist/tubesearch", false, $CONFIG->pluginspath . "videolist/actions/tubesearch.php");
-register_action("videolist/remove", false, $CONFIG->pluginspath . "videolist/actions/delete.php"); \ No newline at end of file
+register_action("videolist/delete", false, $CONFIG->pluginspath . "videolist/actions/delete.php"); \ No newline at end of file
diff --git a/views/default/forms/edit.php b/views/default/forms/edit.php
index 09dba432c..00658bd2b 100644
--- a/views/default/forms/edit.php
+++ b/views/default/forms/edit.php
@@ -29,6 +29,7 @@ $container_guid = $vars['entity']->container_guid;
if (isset($vars['entity'])) {
echo "<input type='hidden' name=\"file_guid\" value=\"{$vars['entity']->getGUID()}\" />";
}
+ echo elgg_view('input/securitytoken');
?>
<input type="submit" value="<?php echo elgg_echo("save"); ?>" />
</p>
diff --git a/views/default/object/videolist.php b/views/default/object/videolist.php
index 19015384a..82336ec97 100644
--- a/views/default/object/videolist.php
+++ b/views/default/object/videolist.php
@@ -33,8 +33,8 @@ if(!empty($video_file)) {
// include edit and delete options
if ($owner->canEdit()) {
- $info .= "<span class='entity_edit'><a href=\"{$vars['url']}mod/videolist/edit.php?file_guid={$video_guid}\">" . elgg_echo('edit') . "</a></span>";
- $info .= "<span class='delete_button'>" . elgg_view('output/confirmlink',array('href' => $vars['url'] . "action/videolist/delete?file=" . $video_guid, 'text' => elgg_echo("delete"),'confirm' => elgg_echo("videolist:delete:confirm"),)). "</span>";
+ $info .= "<span class='entity_edit'><a href=\"{$vars['url']}mod/videolist/edit.php?video={$video_guid}\">" . elgg_echo('edit') . "</a></span>";
+ $info .= "<span class='delete_button'>" . elgg_view('output/confirmlink',array('href' => $vars['url'] . "action/videolist/delete?video=" . $video_guid, 'text' => elgg_echo("delete"),'confirm' => elgg_echo("videolist:delete:confirm"),)). "</span>";
}
$info .= "</div>";