aboutsummaryrefslogtreecommitdiff
path: root/actions/delete.php
diff options
context:
space:
mode:
authorBrett Profitt <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-26 22:44:48 +0000
committerBrett Profitt <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-26 22:44:48 +0000
commit52255de580654f351205b19565be601bd4caaacb (patch)
tree1e9d5f496a8b7111c619eafe910a2f93927231a1 /actions/delete.php
parenta8aa4bceed8e7ad0c5af2646a83d6a2da2e0b23a (diff)
downloadelgg-52255de580654f351205b19565be601bd4caaacb.tar.gz
elgg-52255de580654f351205b19565be601bd4caaacb.tar.bz2
First pass at cleaning up videolist.
Diffstat (limited to 'actions/delete.php')
-rw-r--r--actions/delete.php71
1 files changed, 34 insertions, 37 deletions
diff --git a/actions/delete.php b/actions/delete.php
index 3b5b6ddde..e98e81b67 100644
--- a/actions/delete.php
+++ b/actions/delete.php
@@ -1,44 +1,41 @@
<?php
/**
- * Elgg Videolist Plugin -
- * This plugin allows users to delete videos
- *
- * @package Elgg
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Prateek Choudhary <synapticfield@gmail.com>
- * @copyright Prateek Choudhary
- */
+ * Elgg Videolist Plugin -
+ * This plugin allows users to delete videos
+ *
+ * @package Elgg
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Prateek Choudhary <synapticfield@gmail.com>
+ * @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');
+// 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']);
+}
- // 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) {
+// 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']);
-
- }
-
-?>
+ 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']);
+} \ No newline at end of file