]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Sidebar.
authorSem <sembrestels@riseup.net>
Wed, 9 Nov 2011 02:10:35 +0000 (03:10 +0100)
committerSem <sembrestels@riseup.net>
Wed, 9 Nov 2011 02:10:35 +0000 (03:10 +0100)
pages/videolist/all.php
pages/videolist/friends.php
pages/videolist/watch.php
views/default/object/videolist_item.php
views/default/page/elements/videolist_block.php [new file with mode: 0644]
views/default/videolist/sidebar.php [new file with mode: 0644]

index db0b0ee9d0b55718145696d977cca33c177e0ea7..6fe68f3eb955d4f01de3a590a787a36f66e09ef6 100644 (file)
@@ -20,22 +20,7 @@ $content = elgg_list_entities(array(
        'full_view' => FALSE
 ));
 
-// get the latest comments on all videos
-$comments = elgg_get_annotations(array(
-       'type' => 'object',
-       'subype' => 'videolist',
-       'annotation_names' => array('generic_comment'),
-       'limit' => 4,
-       'order_by' => 'time_created desc',
-));
-$sidebar = elgg_view('annotation/latest_comments', array('comments' => $comments));
-
-// tag-cloud display
-$sidebar .= elgg_view_tagcloud(array(
-       'type' => 'object',
-       'subtype' => 'videolist',
-       'limit' => 50,
-));
+$sidebar = elgg_view('videolist/sidebar');
 
 elgg_set_context('videolist');
 $body = elgg_view_layout('content', array(
index c505464cb1e51ab9f176b040f61330d30ef7dba0..8bbb34698afce3e0af7500a301781baa5af0f033 100644 (file)
@@ -21,7 +21,7 @@ if (!$content) {
        $content = elgg_echo("videolist:none");
 }
 
-//$sidebar = elgg_view('videolist/sidebar', array());
+$sidebar = elgg_view('videolist/sidebar', array());
 
 $body = elgg_view_layout('content', array(
        'filter_context' => 'friends',
index fc9bd1a681fa6933c09968bcc729829c67f8204a..3a740f396ca39ad288735c12bea02502e132bc0c 100644 (file)
@@ -27,10 +27,16 @@ elgg_push_breadcrumb($title);
 $content = elgg_view_entity($videolist_item, array('full_view' => true));
 $content .= elgg_view_comments($videolist_item);
 
+$sidebar = elgg_view('videolist/sidebar', array(
+       'show_comments' => false,
+       'show_videolist' => true,
+));
+
 $body = elgg_view_layout('content', array(
        'content' => $content,
        'title' => $title,
        'filter' => '',
+       'sidebar' => $sidebar,
 ));
 
 echo elgg_view_page($title, $body);
index 63f3e6334321f3bc45bb0078f706450954a65455..bda333a2d15c09677b13401efce5eb1f522b1708 100644 (file)
@@ -16,8 +16,6 @@ $owner = $entity->getOwnerEntity();
 $container = $entity->getContainerEntity();
 $categories = elgg_view('output/categories', $vars);
 $excerpt = elgg_get_excerpt($entity->description);
-$mime = $entity->mimetype;
-$base_type = substr($mime, 0, strpos($mime,'/'));
 
 $body = elgg_view('output/longtext', array('value' => $entity->description));
 
@@ -88,9 +86,12 @@ HTML;
 
 } elseif (elgg_in_context('gallery')) {
        echo '<div class="videolist-gallery-item">';
-       echo "<h3>" . $entity->title . "</h3>";
-       echo elgg_view_entity_icon($entity, 'medium');
-       echo "<p class='subtitle'>$owner_link $date</p>";
+       $content = elgg_view('output/url', array(
+               'text' => elgg_get_excerpt($entity->title, 25),
+               'href' => $entity->getURL(),
+       ));
+       $content .= "<p class='subtitle'>$owner_link $date</p>";
+       echo elgg_view_image_block($entity_icon, $content);
        echo '</div>';
 } else {
        // brief view
diff --git a/views/default/page/elements/videolist_block.php b/views/default/page/elements/videolist_block.php
new file mode 100644 (file)
index 0000000..264862c
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Display the latest videolist items
+ *
+ * Generally used in a sidebar.
+ *
+ * @uses $vars['container_guid'] The videolist container
+ * @uses $vars['limit']          The number of comments to display
+ */
+
+$container_guid = elgg_extract('container_guid', $vars, ELGG_ENTITIES_ANY_VALUE);
+
+$container = get_entity($container_guid);
+
+$options = array(
+       'container_guid' => $container_guid,
+       'limit' => elgg_extract('limit', $vars, 4),
+       'type' => 'object',
+       'subtypes' => 'videolist_item',
+       'full_view' => false,
+);
+
+if($container) {
+       $title = elgg_echo('videolist:user', array($container->name));
+} else {
+       $title = elgg_echo('videolist');
+}
+
+elgg_push_context('gallery');
+$content = elgg_list_entities($options);
+elgg_pop_context('gallery');
+
+echo elgg_view_module('aside', $title, $content);
diff --git a/views/default/videolist/sidebar.php b/views/default/videolist/sidebar.php
new file mode 100644 (file)
index 0000000..4a9e1cd
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Videolist sidebar
+ */
+
+$show_comments = elgg_extract('show_comments', $vars, true);
+$show_tags = elgg_extract('show_tags', $vars, true);
+$show_videolist = elgg_extract('show_videolist', $vars, false);
+
+if($show_videolist){
+       echo elgg_view('page/elements/videolist_block', array(
+               'container_guid' => elgg_get_page_owner_guid(),
+       ));
+}
+
+if($show_comments) {
+       echo elgg_view('page/elements/comments_block', array(
+               'subtypes' => 'videolist_item',
+               'owner_guid' => elgg_get_page_owner_guid(),
+       ));
+}
+
+if($show_tags) {
+       echo elgg_view('page/elements/tagcloud_block', array(
+               'subtypes' => 'videolist_item',
+               'owner_guid' => elgg_get_page_owner_guid(),
+       ));
+}