diff options
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']);
|