3 * @version $Id: pagination.php 2895 2010-03-06 04:05:52Z fishbone $
5 * @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
6 * @license GNU/GPL, see LICENSE.php
7 * Joomla! is free software. This version may have been modified pursuant
8 * to the GNU General Public License, and as distributed it includes or
9 * is derivative of works licensed under the GNU General Public License or
10 * other free or open source software licenses.
11 * See COPYRIGHT.php for copyright notices and details.
15 defined('_JEXEC') or die('Restricted access');
18 * This is a file to add template specific chrome to pagination rendering.
20 * pagination_list_footer
21 * Input variable $list is an array with offsets:
23 * $list[limitstart] : int
25 * $list[limitfield] : string
26 * $list[pagescounter] : string
27 * $list[pageslinks] : string
29 * pagination_list_render
30 * Input variable $list is an array with offsets:
47 * [{PAGE}][data] : string
48 * [{PAGE}][active] : boolean
50 * pagination_item_active
51 * Input variable $item is an object with fields:
52 * $item->base : integer
53 * $item->link : string
54 * $item->text : string
56 * pagination_item_inactive
57 * Input variable $item is an object with fields:
58 * $item->base : integer
59 * $item->link : string
60 * $item->text : string
62 * This gives template designers ultimate control over how pagination is rendered.
64 * NOTE: If you override pagination_item_active OR pagination_item_inactive you MUST override them both
67 function pagination_list_footer($list)
69 // Initialize variables
70 $lang =& JFactory::getLanguage();
71 $html = "<div class=\"list-footer\">\n";
75 $html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
76 $html .= $list['pageslinks'];
77 $html .= "\n<div class=\"limit\">".JText::_('Display Num').$list['limitfield']."</div>";
81 $html .= "\n<div class=\"limit\">".JText::_('Display Num').$list['limitfield']."</div>";
82 $html .= $list['pageslinks'];
83 $html .= "\n<div class=\"counter\">".$list['pagescounter']."</div>";
86 $html .= "\n<input type=\"hidden\" name=\"limitstart\" value=\"".$list['limitstart']."\" />";
92 function pagination_list_render($list)
94 // Initialize variables
95 $lang =& JFactory::getLanguage();
96 $html = "<span class=\"pagination\">";
98 // Reverse output rendering for right-to-left display
101 $html .= '« '.$list['start']['data'];
102 $html .= ' '.$list['previous']['data'];
104 $list['pages'] = array_reverse( $list['pages'] );
106 foreach( $list['pages'] as $page ) {
107 if($page['data']['active']) {
111 $html .= ' '.$page['data'];
113 if($page['data']['active']) {
114 $html .= '</strong>';
118 $html .= ' '.$list['next']['data'];
119 $html .= ' '.$list['end']['data'];
124 $html .= '« '.$list['start']['data'];
125 $html .= $list['previous']['data'];
127 foreach( $list['pages'] as $page )
129 if($page['data']['active']) {
133 $html .= $page['data'];
135 if($page['data']['active']) {
136 $html .= '</strong>';
140 $html .= $list['next']['data'];
141 $html .= $list['end']['data'];
149 function pagination_item_active(&$item) {
150 return "<a href=\"".$item->link."\" title=\"".$item->text."\">".$item->text."</a>";
153 function pagination_item_inactive(&$item) {
154 return "<span>".$item->text."</span>";