diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-31 02:57:09 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-31 02:57:09 +0000 |
commit | c685684d47f7c0a1946393ee121551ad67dde3db (patch) | |
tree | 73a195fba65149c7878e4415d84ca4366b04e846 /views/default | |
parent | 14b378536493fd9511833abc3af2bd7007c47f0c (diff) | |
download | elgg-c685684d47f7c0a1946393ee121551ad67dde3db.tar.gz elgg-c685684d47f7c0a1946393ee121551ad67dde3db.tar.bz2 |
added a proper gallery view - still need to wire up the elgg_view_list_item functions and remove the use of context
git-svn-id: http://code.elgg.org/elgg/trunk@7784 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default')
-rw-r--r-- | views/default/layout/objects/gallery.php | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/views/default/layout/objects/gallery.php b/views/default/layout/objects/gallery.php new file mode 100644 index 000000000..29534a450 --- /dev/null +++ b/views/default/layout/objects/gallery.php @@ -0,0 +1,73 @@ +<?php +/** + * Gallery view + * + * @uses $vars['items'] + */ + +$items = $vars['items']; +if (!is_array($items) && sizeof($items) == 0) { + return true; +} + +elgg_push_context('gallery'); + +$offset = $vars['offset']; +$limit = $vars['limit']; +$count = $vars['count']; +$pagination = elgg_get_array_value('pagination', $vars, true); +$full_view = elgg_get_array_value('full_view', $vars, false); +$offset_key = elgg_get_array_value('offset_key', $vars, 'offset'); +$position = elgg_get_array_value('position', $vars, 'after'); + +$num_columns = 4; + + +if ($pagination && $count) { + $nav .= elgg_view('navigation/pagination', array( + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + 'offset_key' => $offset_key, + )); +} + +if ($position == 'before' || $position == 'both') { + echo $nav; +} + +?> +<table class="elgg-gallery"> +<?php + +$col = 0; +foreach ($items as $item) { + if ($col == 0) { + echo '<tr>'; + } + $col++; + + echo '<td>'; + echo elgg_view_list_item($item, $full_view, $vars); + echo "</td>"; + + if ($col == $num_columns) { + echo '</tr>'; + $col = 0; + } +} + +if ($col > 0) { + echo '</tr>'; +} + +?> + +</table> + +<?php +if ($position == 'after' || $position == 'both') { + echo $nav; +} + +elgg_pop_context(); |