]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Added a basic edit view for videolist (form action/tokens needs fixing still)
authorPete Harris <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 29 Mar 2010 18:43:13 +0000 (18:43 +0000)
committerPete Harris <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 29 Mar 2010 18:43:13 +0000 (18:43 +0000)
edit.php [new file with mode: 0644]
languages/en.php
views/default/forms/edit.php [new file with mode: 0644]
views/default/videolist/groupprofile_videolist.php

diff --git a/edit.php b/edit.php
new file mode 100644 (file)
index 0000000..5157930
--- /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
index 238651cc0b2d81894e3424832924a8f595c3ba54..18b731ada6af5fb99014ad5b230568c07eb937dd 100644 (file)
@@ -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 (file)
index 0000000..09dba43
--- /dev/null
@@ -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
index 2151a8f872f1d3ab082d57b84d8bc834c1e50be8..217eda53b8713fa834977e9a62ebcd98dfb49ad6 100644 (file)
@@ -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>";
 }
 
 ?>