diff options
author | Sem <sembrestels@riseup.net> | 2011-11-06 01:30:19 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-06 01:30:19 +0100 |
commit | c2a680f932b589ada25a5c4c95523ffe07976b79 (patch) | |
tree | a00bef321918ea9cd567a3a4759805ab16912e08 /actions/videolist/edit.php | |
parent | d7ac68a7db932618c051442210614b9b6484c702 (diff) | |
download | elgg-c2a680f932b589ada25a5c4c95523ffe07976b79.tar.gz elgg-c2a680f932b589ada25a5c4c95523ffe07976b79.tar.bz2 |
Reordered actions (deleted some).
Diffstat (limited to 'actions/videolist/edit.php')
-rw-r--r-- | actions/videolist/edit.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/actions/videolist/edit.php b/actions/videolist/edit.php new file mode 100644 index 000000000..3aa536e4c --- /dev/null +++ b/actions/videolist/edit.php @@ -0,0 +1,40 @@ +<?php
+/**
+ * Elgg video edit
+ */
+
+// Get variables
+$title = strip_tags(get_input("title_videourl"));
+$tags = get_input("tags");
+$access_id = (int) get_input("access_id");
+
+$guid = (int) get_input('video_guid');
+
+if (!$video = get_entity($guid)) {
+ register_error(elgg_echo("videolist:noentity"));
+ forward(elgg_get_site_url() . "videolist/" . $_SESSION['user']->username);
+ exit;
+}
+
+$result = false;
+
+$container_guid = $video->container_guid;
+$container = get_entity($container_guid);
+
+if ($video->canEdit()) {
+
+ $video->access_id = $access_id;
+ $video->title = $title;
+
+ // Save tags
+ $tags = explode(",", $tags);
+ $video->tags = $tags;
+ $result = $video->save();
+}
+
+if ($result)
+ system_message(elgg_echo("videolist:editsaved"));
+else
+ register_error(elgg_echo("videolist:editfailed"));
+
+forward($_SERVER['HTTP_REFERER']);
|