aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Tosh <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-07 20:24:20 +0000
committerDave Tosh <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-07 20:24:20 +0000
commit73cac44d633c45225cd9f1ee102e56044027d04d (patch)
treedc64cdae2bcf48503a982b3842482e73dd6b9c6f
parentb055677aa5563fd703982753d2facaa76536335a (diff)
downloadelgg-73cac44d633c45225cd9f1ee102e56044027d04d.tar.gz
elgg-73cac44d633c45225cd9f1ee102e56044027d04d.tar.bz2
edit videos
-rw-r--r--actions/edit.php42
-rw-r--r--views/default/forms/edit.php4
2 files changed, 44 insertions, 2 deletions
diff --git a/actions/edit.php b/actions/edit.php
new file mode 100644
index 000000000..6ccc2a320
--- /dev/null
+++ b/actions/edit.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Elgg video edit
+ */
+
+global $CONFIG;
+
+// 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($CONFIG->wwwroot . "pg/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($CONFIG->wwwroot . "pg/videolist/" . $container->username); \ No newline at end of file
diff --git a/views/default/forms/edit.php b/views/default/forms/edit.php
index 00658bd2b..4114b5ad6 100644
--- a/views/default/forms/edit.php
+++ b/views/default/forms/edit.php
@@ -8,7 +8,7 @@ $page_owner = page_owner_entity();
$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));?>
@@ -27,7 +27,7 @@ $container_guid = $vars['entity']->container_guid;
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');
?>