aboutsummaryrefslogtreecommitdiff
path: root/views/default/layout/objects/list.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-09 02:39:14 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-09 02:39:14 +0000
commit50a4c1460497c7c8c0d78f0ad3e34d0d9951220c (patch)
treee2fe3353f78799ae180edf54a48b6aaa3402da44 /views/default/layout/objects/list.php
parent3a25d30512da0f165c93f9ed96995c3c42eb7f3b (diff)
downloadelgg-50a4c1460497c7c8c0d78f0ad3e34d0d9951220c.tar.gz
elgg-50a4c1460497c7c8c0d78f0ad3e34d0d9951220c.tar.bz2
added ability to include pagination before and after a list
git-svn-id: http://code.elgg.org/elgg/trunk@7577 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/layout/objects/list.php')
-rw-r--r--views/default/layout/objects/list.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/views/default/layout/objects/list.php b/views/default/layout/objects/list.php
index 2c3a8206e..9cbd85f0b 100644
--- a/views/default/layout/objects/list.php
+++ b/views/default/layout/objects/list.php
@@ -10,6 +10,7 @@
* @uses $vars['count'] Number of items in the complete list
* @uses $vars['base_url'] Base URL of list (optional)
* @uses $vars['pagination'] Show pagination? (default: true)
+ * @uses $vars['position'] Position of the pagination: before, after, or both
* @uses $vars['full_view'] Show the full view of the items (default: false)
* @uses $vars['list_class'] Additional CSS class for the <ul> element
* @uses $vars['item_class'] Additional CSS class for the <li> elements
@@ -23,6 +24,7 @@ $base_url = $vars['base_url'];
$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');
$list_class = 'elgg-list';
if (isset($vars['list_class'])) {
@@ -37,7 +39,7 @@ if (isset($vars['item_class'])) {
$html = "";
$nav = "";
-if ($pagination) {
+if ($pagination && $count) {
$nav .= elgg_view('navigation/pagination', array(
'baseurl' => $base_url,
'offset' => $offset,
@@ -62,7 +64,11 @@ if (is_array($items) && count($items) > 0) {
$html .= '</ul>';
}
-if ($count) {
+if ($position == 'before' || $position == 'both') {
+ $html = $nav . $html;
+}
+
+if ($position == 'after' || $position == 'both') {
$html .= $nav;
}