aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-09 03:10:35 +0100
committerSem <sembrestels@riseup.net>2011-11-09 03:10:35 +0100
commitb0f15fbebe3781626ba6b086d63ed364f6822209 (patch)
treec0b9358920ac777d6a0a5125f5cf528b7ca52643 /views/default
parent6b16fa9b322ae12a54c66ba5160cc7547d6e7667 (diff)
downloadelgg-b0f15fbebe3781626ba6b086d63ed364f6822209.tar.gz
elgg-b0f15fbebe3781626ba6b086d63ed364f6822209.tar.bz2
Sidebar.
Diffstat (limited to 'views/default')
-rw-r--r--views/default/object/videolist_item.php11
-rw-r--r--views/default/page/elements/videolist_block.php33
-rw-r--r--views/default/videolist/sidebar.php28
3 files changed, 67 insertions, 5 deletions
diff --git a/views/default/object/videolist_item.php b/views/default/object/videolist_item.php
index 63f3e6334..bda333a2d 100644
--- a/views/default/object/videolist_item.php
+++ b/views/default/object/videolist_item.php
@@ -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
index 000000000..264862ccf
--- /dev/null
+++ b/views/default/page/elements/videolist_block.php
@@ -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
index 000000000..4a9e1cdda
--- /dev/null
+++ b/views/default/videolist/sidebar.php
@@ -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(),
+ ));
+}