diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-03 13:29:09 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-12-03 13:29:09 +0000 |
commit | fb125354d94ad2784e73886a57476e4fc1dc72aa (patch) | |
tree | 8e722e0dce141649c7b9c955fad03962c1f76d73 /views/default/entities/list.php | |
parent | 3500fcfa23ec6d140b88ab0f75b2116b12d739c6 (diff) | |
download | elgg-fb125354d94ad2784e73886a57476e4fc1dc72aa.tar.gz elgg-fb125354d94ad2784e73886a57476e4fc1dc72aa.tar.bz2 |
Refs #2189 the beginning of semantic markup for entity lists - needs some reorganization
git-svn-id: http://code.elgg.org/elgg/trunk@7516 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/entities/list.php')
-rw-r--r-- | views/default/entities/list.php | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/views/default/entities/list.php b/views/default/entities/list.php new file mode 100644 index 000000000..d35c66500 --- /dev/null +++ b/views/default/entities/list.php @@ -0,0 +1,63 @@ +<?php +/** + * View a list of entities + * + * @package Elgg + * + */ + +$context = $vars['context']; +$offset = $vars['offset']; +$entities = $vars['entities']; +$limit = $vars['limit']; +$count = $vars['count']; +$base_url = $vars['baseurl']; +$context = $vars['context']; +$list_type = $vars['listtype']; +$pagination = $vars['pagination']; +$full_view = $vars['fullview']; + +$html = ""; +$nav = ""; + +$list_type_toggle = elgg_get_array_value('listtypetoggle', $vars, true); + +if ($context == "search" && $count > 0 && $list_type_toggle) { + $nav .= elgg_view('navigation/listtype', array( + 'baseurl' => $base_url, + 'offset' => $offset, + 'count' => $count, + 'listtype' => $list_type, + )); +} + +if ($pagination) { + $nav .= elgg_view('navigation/pagination', array( + 'baseurl' => $base_url, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + )); +} + +if ($list_type == 'list') { + if (is_array($entities) && sizeof($entities) > 0) { + $html .= '<ul class="elgg-entity-list">'; + foreach ($entities as $entity) { + $html .= '<li>'; + $html .= elgg_view_entity($entity, $full_view); + $html .= '</li>'; + } + $html .= '</ul>'; + } +} else { + if (is_array($entities) && sizeof($entities) > 0) { + $html .= elgg_view('entities/gallery', array('entities' => $entities)); + } +} + +if ($count) { + $html .= $nav; +} + +echo $html; |