aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--edit.php43
-rw-r--r--languages/en.php2
-rw-r--r--views/default/forms/edit.php36
-rw-r--r--views/default/videolist/groupprofile_videolist.php6
4 files changed, 84 insertions, 3 deletions
diff --git a/edit.php b/edit.php
new file mode 100644
index 000000000..515793003
--- /dev/null
+++ b/edit.php
@@ -0,0 +1,43 @@
+<?php
+/**
+* Elgg Edit Video
+*/
+
+require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
+
+gatekeeper();
+
+$video_file = (int) get_input('file_guid');
+if ($video_file = get_entity($video_file)) {
+
+ // Set the page owner
+ $page_owner = page_owner_entity();
+ if ($page_owner === false || is_null($page_owner)) {
+ $container_guid = $video_file->container_guid;
+ if (!empty($container_guid))
+ if ($page_owner = get_entity($container_guid)) {
+ set_page_owner($container_guid->guid);
+ }
+ if (empty($page_owner)) {
+ $page_owner = $_SESSION['user'];
+ set_page_owner($_SESSION['guid']);
+ }
+ }
+
+ if ($video_file->canEdit()) {
+ // set up breadcrumbs
+ elgg_push_breadcrumb(elgg_echo('videolist:all'), $CONFIG->wwwroot."mod/videolist/all.php");
+ elgg_push_breadcrumb(sprintf(elgg_echo("videolist:user"),$page_owner->name), $CONFIG->wwwroot."pg/videolist/".$page_owner->username);
+ elgg_push_breadcrumb(sprintf(elgg_echo("videolist:edit")));
+
+ $area1 = elgg_view('navigation/breadcrumbs');
+ $area1 .= elgg_view_title($title = elgg_echo('videolist:edit'));
+ $area2 = elgg_view("forms/edit",array('entity' => $video_file));
+ $body = elgg_view_layout('one_column_with_sidebar', $area1.$area2, $area3);
+ page_draw(elgg_echo("videolist:edit"), $body);
+ }
+} else {
+ forward();
+}
+
+?> \ No newline at end of file
diff --git a/languages/en.php b/languages/en.php
index 238651cc0..18b731ada 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -13,12 +13,14 @@ $english = array(
"videolist" => "Videos",
"videolist:home" => '%s \'s Videos',
+ "videolist:user" => '%s \'s Videos',
"videolist:new" => 'Add a Video',
"videolist:find" => 'All Site videos',
"videolist:all" => 'All Site videos',
"videolist:add" => 'Add a Video',
"videolist:search" => "All Site videos",
'videolist:friends' => "Friends' videos",
+ 'videolist:edit' => "Edit video",
"videolist:title_videourl" => 'Enter Video Url',
"videolist:submit" => 'Submit',
"videolist:videoTitle" => "Title",
diff --git a/views/default/forms/edit.php b/views/default/forms/edit.php
new file mode 100644
index 000000000..09dba432c
--- /dev/null
+++ b/views/default/forms/edit.php
@@ -0,0 +1,36 @@
+<?php
+/**
+* Elgg Video Plugin > Edit view
+*/
+// Make sure we're logged in (send us to the front page if not)
+gatekeeper();
+$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">
+
+ <p><label><?php echo elgg_echo("title"); ?><br />
+ <?php echo elgg_view("input/text", array("internalname" => "title_videourl","value" => $vars['entity']->title));?>
+ </label></p>
+
+ <p><label><?php echo elgg_echo("tags"); ?><br />
+ <?php echo elgg_view("input/tags", array("internalname" => "tags","value" => $vars['entity']->tags));?>
+ </label></p>
+
+ <p><label><?php echo elgg_echo('access'); ?><br />
+ <?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $vars['entity']->access_id)); ?>
+ </label></p>
+
+ <p>
+ <?php
+ 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()}\" />";
+ }
+ ?>
+ <input type="submit" value="<?php echo elgg_echo("save"); ?>" />
+ </p>
+
+</form> \ No newline at end of file
diff --git a/views/default/videolist/groupprofile_videolist.php b/views/default/videolist/groupprofile_videolist.php
index 2151a8f87..217eda53b 100644
--- a/views/default/videolist/groupprofile_videolist.php
+++ b/views/default/videolist/groupprofile_videolist.php
@@ -11,7 +11,7 @@
?>
<div id="filerepo_widget_layout">
-<h2><?php echo elgg_echo("videolist:group"); ?></h2>
+<h3><?php echo elgg_echo("videolist:group"); ?></h3>
<?php
@@ -41,7 +41,7 @@ if ($videos) {
echo "</div>";
}
echo "<div class=\"filerepo_listview_date\"><p class=\"filerepo_timestamp\"><small>" . friendly_time($f->time_created) . "</small></p></div>";
- echo "</div><div class=\"clearfloat\" style=\"height:8px;\"></div>";
+ echo "</div>";
}
echo "</div>";
@@ -52,7 +52,7 @@ if ($videos) {
echo "<div class=\"forum_latest\"><a href=\"{$users_file_url}\">" . elgg_echo("videolist:groupall") . "</a></div>";
} else {
- echo "<div class=\"forum_latest\">" . elgg_echo("videolist:none") . "</div>";
+ echo "<p class='margin_top'>" . elgg_echo("videolist:none") . "</p>";
}
?>