diff options
-rw-r--r-- | pages/videolist/all.php | 17 | ||||
-rw-r--r-- | pages/videolist/friends.php | 2 | ||||
-rw-r--r-- | pages/videolist/watch.php | 6 | ||||
-rw-r--r-- | views/default/object/videolist_item.php | 11 | ||||
-rw-r--r-- | views/default/page/elements/videolist_block.php | 33 | ||||
-rw-r--r-- | views/default/videolist/sidebar.php | 28 |
6 files changed, 75 insertions, 22 deletions
diff --git a/pages/videolist/all.php b/pages/videolist/all.php index db0b0ee9d..6fe68f3eb 100644 --- a/pages/videolist/all.php +++ b/pages/videolist/all.php @@ -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( diff --git a/pages/videolist/friends.php b/pages/videolist/friends.php index c505464cb..8bbb34698 100644 --- a/pages/videolist/friends.php +++ b/pages/videolist/friends.php @@ -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', diff --git a/pages/videolist/watch.php b/pages/videolist/watch.php index fc9bd1a68..3a740f396 100644 --- a/pages/videolist/watch.php +++ b/pages/videolist/watch.php @@ -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); 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(), + )); +} |