--- /dev/null
+<?php\r
+/**\r
+ * Elgg video edit\r
+ */\r
+\r
+global $CONFIG;\r
+ \r
+// Get variables\r
+$title = strip_tags(get_input("title_videourl"));\r
+$tags = get_input("tags");\r
+$access_id = (int) get_input("access_id");\r
+ \r
+$guid = (int) get_input('video_guid');\r
+\r
+if (!$video = get_entity($guid)) {\r
+ register_error(elgg_echo("videolist:noentity"));\r
+ forward($CONFIG->wwwroot . "pg/videolist/" . $_SESSION['user']->username);\r
+ exit;\r
+}\r
+ \r
+$result = false;\r
+\r
+$container_guid = $video->container_guid;\r
+$container = get_entity($container_guid);\r
+ \r
+if ($video->canEdit()) {\r
+ \r
+ $video->access_id = $access_id;\r
+ $video->title = $title;\r
+ \r
+ // Save tags\r
+ $tags = explode(",", $tags);\r
+ $video->tags = $tags;\r
+ $result = $video->save();\r
+}\r
+ \r
+if ($result)\r
+ system_message(elgg_echo("videolist:editsaved"));\r
+else\r
+ register_error(elgg_echo("videolist:editfailed"));\r
+ \r
+forward($CONFIG->wwwroot . "pg/videolist/" . $container->username);
\ No newline at end of file
$container_guid = $vars['entity']->container_guid;
?>
-<form action="<?php echo $vars['url']; ?>action/videolist/add" enctype="multipart/form-data" method="post" class="margin_top">
+<form action="<?php echo $vars['url']; ?>action/videolist/edit" enctype="multipart/form-data" method="post" class="margin_top">
<p><label><?php echo elgg_echo("title"); ?><br />
<?php echo elgg_view("input/text", array("internalname" => "title_videourl","value" => $vars['entity']->title));?>
echo "<input type='hidden' name=\"container_guid\" value=\"{$container_guid}\" />";
if (isset($vars['entity'])) {
- echo "<input type='hidden' name=\"file_guid\" value=\"{$vars['entity']->getGUID()}\" />";
+ echo "<input type='hidden' name=\"video_guid\" value=\"{$vars['entity']->getGUID()}\" />";
}
echo elgg_view('input/securitytoken');
?>