From dd09373e0cefa8d33d0e9faa741593802d53c2a7 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Fri, 18 Feb 2011 18:37:32 +0000 Subject: Refs #2950: layout/objects => page/components git-svn-id: http://code.elgg.org/elgg/trunk@8288 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/page/components/list.php | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 views/default/page/components/list.php (limited to 'views/default/page/components/list.php') diff --git a/views/default/page/components/list.php b/views/default/page/components/list.php new file mode 100644 index 000000000..374922ecd --- /dev/null +++ b/views/default/page/components/list.php @@ -0,0 +1,75 @@ + element + * @uses $vars['item_class'] Additional CSS class for the
  • elements + */ + +$items = $vars['items']; +$offset = $vars['offset']; +$limit = $vars['limit']; +$count = $vars['count']; +$base_url = $vars['base_url']; +$pagination = elgg_extract('pagination', $vars, true); +$full_view = elgg_extract('full_view', $vars, false); +$offset_key = elgg_extract('offset_key', $vars, 'offset'); +$position = elgg_extract('position', $vars, 'after'); + +$list_class = 'elgg-list'; +if (isset($vars['list_class'])) { + $list_class = "{$vars['list_class']} $list_class"; +} + +$item_class = 'elgg-list-item'; +if (isset($vars['item_class'])) { + $item_class = "{$vars['item_class']} $item_class"; +} + +$html = ""; +$nav = ""; + +if ($pagination && $count) { + $nav .= elgg_view('navigation/pagination', array( + 'baseurl' => $base_url, + 'offset' => $offset, + 'count' => $count, + 'limit' => $limit, + 'offset_key' => $offset_key, + )); +} + +if (is_array($items) && count($items) > 0) { + $html .= "'; +} + +if ($position == 'before' || $position == 'both') { + $html = $nav . $html; +} + +if ($position == 'after' || $position == 'both') { + $html .= $nav; +} + +echo $html; -- cgit v1.2.3