Andrey Andreev | c5536aa | 2012-11-01 17:33:58 +0200 | [diff] [blame] | 1 | <?php |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
Phil Sturgeon | 07c1ac8 | 2012-03-09 17:03:37 +0000 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.2.4 or newer |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 6 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 7 | * NOTICE OF LICENSE |
Eric Barnes | 9a4902a | 2011-12-03 23:46:06 -0500 | [diff] [blame] | 8 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 9 | * Licensed under the Open Software License version 3.0 |
Eric Barnes | 9a4902a | 2011-12-03 23:46:06 -0500 | [diff] [blame] | 10 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 11 | * This source file is subject to the Open Software License (OSL 3.0) that is |
| 12 | * bundled with this package in the files license.txt / license.rst. It is |
| 13 | * also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/OSL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
| 18 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 19 | * @package CodeIgniter |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 20 | * @author EllisLab Dev Team |
darwinel | 871754a | 2014-02-11 17:34:57 +0100 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 22 | * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 23 | * @link http://codeigniter.com |
| 24 | * @since Version 1.0 |
| 25 | * @filesource |
| 26 | */ |
Andrey Andreev | c5536aa | 2012-11-01 17:33:58 +0200 | [diff] [blame] | 27 | defined('BASEPATH') OR exit('No direct script access allowed'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 28 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 29 | /** |
| 30 | * Pagination Class |
| 31 | * |
| 32 | * @package CodeIgniter |
| 33 | * @subpackage Libraries |
| 34 | * @category Pagination |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 35 | * @author EllisLab Dev Team |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 36 | * @link http://codeigniter.com/user_guide/libraries/pagination.html |
| 37 | */ |
| 38 | class CI_Pagination { |
| 39 | |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 40 | /** |
| 41 | * Base URL |
| 42 | * |
| 43 | * The page that we're linking to |
| 44 | * |
| 45 | * @var string |
| 46 | */ |
| 47 | protected $base_url = ''; |
| 48 | |
| 49 | /** |
| 50 | * Prefix |
| 51 | * |
| 52 | * @var string |
| 53 | */ |
| 54 | protected $prefix = ''; |
| 55 | |
| 56 | /** |
| 57 | * Suffix |
| 58 | * |
| 59 | * @var string |
| 60 | */ |
| 61 | protected $suffix = ''; |
| 62 | |
| 63 | /** |
| 64 | * Total number of items |
| 65 | * |
| 66 | * @var int |
| 67 | */ |
| 68 | protected $total_rows = 0; |
| 69 | |
| 70 | /** |
| 71 | * Items per page |
| 72 | * |
| 73 | * @var int |
| 74 | */ |
| 75 | protected $per_page = 10; |
| 76 | |
| 77 | /** |
| 78 | * Number of links to show |
| 79 | * |
| 80 | * Relates to "digit" type links shown before/after |
| 81 | * the currently viewed page. |
| 82 | * |
| 83 | * @var int |
| 84 | */ |
| 85 | protected $num_links = 2; |
| 86 | |
| 87 | /** |
| 88 | * Current page |
| 89 | * |
| 90 | * @var int |
| 91 | */ |
| 92 | protected $cur_page = 0; |
| 93 | |
| 94 | /** |
| 95 | * Use page numbers flag |
| 96 | * |
| 97 | * Whether to use actual page numbers instead of an offset |
| 98 | * |
| 99 | * @var bool |
| 100 | */ |
| 101 | protected $use_page_numbers = FALSE; |
| 102 | |
| 103 | /** |
| 104 | * First link |
| 105 | * |
| 106 | * @var string |
| 107 | */ |
| 108 | protected $first_link = '‹ First'; |
| 109 | |
| 110 | /** |
| 111 | * Next link |
| 112 | * |
| 113 | * @var string |
| 114 | */ |
| 115 | protected $next_link = '>'; |
| 116 | |
| 117 | /** |
| 118 | * Previous link |
| 119 | * |
| 120 | * @var string |
| 121 | */ |
| 122 | protected $prev_link = '<'; |
| 123 | |
| 124 | /** |
| 125 | * Last link |
| 126 | * |
| 127 | * @var string |
| 128 | */ |
| 129 | protected $last_link = 'Last ›'; |
| 130 | |
| 131 | /** |
| 132 | * URI Segment |
| 133 | * |
| 134 | * @var int |
| 135 | */ |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 136 | protected $uri_segment = 0; |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 137 | |
| 138 | /** |
| 139 | * Full tag open |
| 140 | * |
| 141 | * @var string |
| 142 | */ |
| 143 | protected $full_tag_open = ''; |
| 144 | |
| 145 | /** |
| 146 | * Full tag close |
| 147 | * |
| 148 | * @var string |
| 149 | */ |
| 150 | protected $full_tag_close = ''; |
| 151 | |
| 152 | /** |
| 153 | * First tag open |
| 154 | * |
| 155 | * @var string |
| 156 | */ |
| 157 | protected $first_tag_open = ''; |
| 158 | |
| 159 | /** |
| 160 | * First tag close |
| 161 | * |
| 162 | * @var string |
| 163 | */ |
| 164 | protected $first_tag_close = ''; |
| 165 | |
| 166 | /** |
| 167 | * Last tag open |
| 168 | * |
| 169 | * @var string |
| 170 | */ |
| 171 | protected $last_tag_open = ''; |
| 172 | |
| 173 | /** |
| 174 | * Last tag close |
| 175 | * |
| 176 | * @var string |
| 177 | */ |
| 178 | protected $last_tag_close = ''; |
| 179 | |
| 180 | /** |
| 181 | * First URL |
| 182 | * |
| 183 | * An alternative URL for the first page |
| 184 | * |
| 185 | * @var string |
| 186 | */ |
| 187 | protected $first_url = ''; |
| 188 | |
| 189 | /** |
| 190 | * Current tag open |
| 191 | * |
| 192 | * @var string |
| 193 | */ |
| 194 | protected $cur_tag_open = '<strong>'; |
| 195 | |
| 196 | /** |
| 197 | * Current tag close |
| 198 | * |
| 199 | * @var string |
| 200 | */ |
| 201 | protected $cur_tag_close = '</strong>'; |
| 202 | |
| 203 | /** |
| 204 | * Next tag open |
| 205 | * |
| 206 | * @var string |
| 207 | */ |
| 208 | protected $next_tag_open = ''; |
| 209 | |
| 210 | /** |
| 211 | * Next tag close |
| 212 | * |
| 213 | * @var string |
| 214 | */ |
| 215 | protected $next_tag_close = ''; |
| 216 | |
| 217 | /** |
| 218 | * Previous tag open |
| 219 | * |
| 220 | * @var string |
| 221 | */ |
| 222 | protected $prev_tag_open = ''; |
| 223 | |
| 224 | /** |
| 225 | * Previous tag close |
| 226 | * |
| 227 | * @var string |
| 228 | */ |
| 229 | protected $prev_tag_close = ''; |
| 230 | |
| 231 | /** |
| 232 | * Number tag open |
| 233 | * |
| 234 | * @var string |
| 235 | */ |
| 236 | protected $num_tag_open = ''; |
| 237 | |
| 238 | /** |
| 239 | * Number tag close |
| 240 | * |
| 241 | * @var string |
| 242 | */ |
| 243 | protected $num_tag_close = ''; |
| 244 | |
| 245 | /** |
| 246 | * Page query string flag |
| 247 | * |
| 248 | * @var bool |
| 249 | */ |
Phil Sturgeon | f82b929 | 2012-06-23 15:49:23 +0100 | [diff] [blame] | 250 | protected $page_query_string = FALSE; |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 251 | |
| 252 | /** |
| 253 | * Query string segment |
| 254 | * |
| 255 | * @var string |
| 256 | */ |
Alex Bilbie | f7e23b3 | 2012-09-07 09:52:32 +0100 | [diff] [blame] | 257 | protected $query_string_segment = 'per_page'; |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 258 | |
| 259 | /** |
| 260 | * Display pages flag |
| 261 | * |
| 262 | * @var bool |
| 263 | */ |
| 264 | protected $display_pages = TRUE; |
| 265 | |
| 266 | /** |
| 267 | * Attributes |
| 268 | * |
| 269 | * @var string |
| 270 | */ |
| 271 | protected $_attributes = ''; |
| 272 | |
| 273 | /** |
| 274 | * Link types |
| 275 | * |
| 276 | * "rel" attribute |
| 277 | * |
| 278 | * @see CI_Pagination::_attr_rel() |
| 279 | * @var array |
| 280 | */ |
| 281 | protected $_link_types = array(); |
| 282 | |
| 283 | /** |
| 284 | * Reuse query string flag |
| 285 | * |
| 286 | * @var bool |
| 287 | */ |
Phil Sturgeon | f82b929 | 2012-06-23 15:49:23 +0100 | [diff] [blame] | 288 | protected $reuse_query_string = FALSE; |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 289 | |
| 290 | /** |
| 291 | * Data page attribute |
| 292 | * |
| 293 | * @var string |
| 294 | */ |
| 295 | protected $data_page_attr = 'data-ci-pagination-page'; |
| 296 | |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 297 | /** |
| 298 | * CI Singleton |
| 299 | * |
| 300 | * @var object |
| 301 | */ |
| 302 | protected $CI; |
| 303 | |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 304 | // -------------------------------------------------------------------- |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 305 | |
| 306 | /** |
| 307 | * Constructor |
| 308 | * |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 309 | * @param array $params Initialization parameters |
Andrey Andreev | 5645479 | 2012-05-17 14:32:19 +0300 | [diff] [blame] | 310 | * @return void |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 311 | */ |
Greg Aker | a926328 | 2010-11-10 15:26:43 -0600 | [diff] [blame] | 312 | public function __construct($params = array()) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 313 | { |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 314 | $this->CI =& get_instance(); |
| 315 | $this->CI->load->language('pagination'); |
Andrey Andreev | aef63e5 | 2014-02-13 14:49:55 +0200 | [diff] [blame] | 316 | foreach (array('first_link', 'next_link', 'prev_link', 'last_link') as $key) |
| 317 | { |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 318 | if (($val = $this->CI->lang->line('pagination_'.$key)) !== FALSE) |
Andrey Andreev | aef63e5 | 2014-02-13 14:49:55 +0200 | [diff] [blame] | 319 | { |
| 320 | $this->$key = $val; |
| 321 | } |
| 322 | } |
| 323 | |
Eric Barnes | bce4140 | 2011-12-03 23:47:41 -0500 | [diff] [blame] | 324 | $this->initialize($params); |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 325 | log_message('debug', 'Pagination Class Initialized'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 326 | } |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 327 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 328 | // -------------------------------------------------------------------- |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 329 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 330 | /** |
| 331 | * Initialize Preferences |
| 332 | * |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 333 | * @param array $params Initialization parameters |
Andrey Andreev | 6f6102c | 2014-02-08 19:11:40 +0200 | [diff] [blame] | 334 | * @return CI_Pagination |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 335 | */ |
Andrey Andreev | aef63e5 | 2014-02-13 14:49:55 +0200 | [diff] [blame] | 336 | public function initialize(array $params = array()) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 337 | { |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 338 | if (isset($params['attributes']) && is_array($params['attributes'])) |
| 339 | { |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 340 | $this->_parse_attributes($params['attributes']); |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 341 | unset($params['attributes']); |
| 342 | } |
| 343 | |
| 344 | // Deprecated legacy support for the anchor_class option |
| 345 | // Should be removed in CI 3.1+ |
| 346 | if (isset($params['anchor_class'])) |
| 347 | { |
| 348 | empty($params['anchor_class']) OR $attributes['class'] = $params['anchor_class']; |
| 349 | unset($params['anchor_class']); |
| 350 | } |
| 351 | |
Andrey Andreev | aef63e5 | 2014-02-13 14:49:55 +0200 | [diff] [blame] | 352 | foreach ($params as $key => $val) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 353 | { |
Andrey Andreev | e9c8c89 | 2014-02-17 17:29:23 +0200 | [diff] [blame] | 354 | if (property_exists($this, $key)) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 355 | { |
Andrey Andreev | aef63e5 | 2014-02-13 14:49:55 +0200 | [diff] [blame] | 356 | $this->$key = $val; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 357 | } |
| 358 | } |
Andrey Andreev | 6f6102c | 2014-02-08 19:11:40 +0200 | [diff] [blame] | 359 | |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 360 | if ($this->CI->config->item('enable_query_strings') === TRUE) |
| 361 | { |
| 362 | $this->page_query_string = TRUE; |
| 363 | } |
| 364 | |
Andrey Andreev | 6f6102c | 2014-02-08 19:11:40 +0200 | [diff] [blame] | 365 | return $this; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 366 | } |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 367 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 368 | // -------------------------------------------------------------------- |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 369 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 370 | /** |
| 371 | * Generate the pagination links |
| 372 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 373 | * @return string |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 374 | */ |
Eric Barnes | 9a4902a | 2011-12-03 23:46:06 -0500 | [diff] [blame] | 375 | public function create_links() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 376 | { |
| 377 | // If our item count or per-page total is zero there is no need to continue. |
Andrey Andreev | b367f7b | 2013-10-14 12:27:00 +0300 | [diff] [blame] | 378 | // Note: DO NOT change the operator to === here! |
| 379 | if ($this->total_rows == 0 OR $this->per_page == 0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 380 | { |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 381 | return ''; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 382 | } |
| 383 | |
| 384 | // Calculate the total number of pages |
Ronald Beilsma | cfb7021 | 2011-12-29 09:57:49 +0100 | [diff] [blame] | 385 | $num_pages = (int) ceil($this->total_rows / $this->per_page); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 386 | |
| 387 | // Is there only one page? Hm... nothing more to do here then. |
Ronald Beilsma | cfb7021 | 2011-12-29 09:57:49 +0100 | [diff] [blame] | 388 | if ($num_pages === 1) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 389 | { |
| 390 | return ''; |
| 391 | } |
| 392 | |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 393 | // Check the user defined number of links. |
Eric Barnes | 3b37659 | 2012-01-04 00:28:27 -0500 | [diff] [blame] | 394 | $this->num_links = (int) $this->num_links; |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 395 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 396 | if ($this->num_links < 1) |
| 397 | { |
| 398 | show_error('Your number of links must be a positive number.'); |
| 399 | } |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 400 | |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 401 | // Keep any existing query string items. |
| 402 | // Note: Has nothing to do with any other query string option. |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 403 | if ($this->reuse_query_string === TRUE) |
| 404 | { |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 405 | $get = $this->CI->input->get(); |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 406 | |
| 407 | // Unset the controll, method, old-school routing options |
| 408 | unset($get['c'], $get['m'], $get[$this->query_string_segment]); |
| 409 | } |
Eric Roberts | ba67f3b | 2013-01-28 18:01:01 -0600 | [diff] [blame] | 410 | else |
| 411 | { |
| 412 | $get = array(); |
| 413 | } |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 414 | |
| 415 | // Put together our base and first URLs. |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 416 | // Note: DO NOT append to the properties as that would break successive calls |
| 417 | $base_url = trim($this->base_url); |
| 418 | $first_url = $this->first_url; |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 419 | |
| 420 | $query_string = ''; |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 421 | $query_string_sep = (strpos($base_url, '?') === FALSE) ? '?' : '&'; |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 422 | |
| 423 | // Are we using query strings? |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 424 | if ($this->page_query_string === TRUE) |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 425 | { |
| 426 | // If a custom first_url hasn't been specified, we'll create one from |
| 427 | // the base_url, but without the page item. |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 428 | if ($first_url === '') |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 429 | { |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 430 | $first_url = $base_url; |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 431 | |
| 432 | // If we saved any GET items earlier, make sure they're appended. |
| 433 | if ( ! empty($get)) |
| 434 | { |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 435 | $first_url .= $query_string_sep.http_build_query($get); |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 436 | } |
| 437 | } |
| 438 | |
| 439 | // Add the page segment to the end of the query string, where the |
| 440 | // page number will be appended. |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 441 | $base_url .= $query_string_sep.http_build_query(array_merge($get, array($this->query_string_segment => ''))); |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 442 | } |
| 443 | else |
| 444 | { |
| 445 | // Standard segment mode. |
| 446 | // Generate our saved query string to append later after the page number. |
| 447 | if ( ! empty($get)) |
| 448 | { |
Eric Roberts | 9668d1d | 2013-01-28 17:45:34 -0600 | [diff] [blame] | 449 | $query_string = $query_string_sep.http_build_query($get); |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 450 | $this->suffix .= $query_string; |
| 451 | } |
| 452 | |
| 453 | // Does the base_url have the query string in it? |
| 454 | // If we're supposed to save it, remove it so we can append it later. |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 455 | if ($this->reuse_query_string === TRUE && ($base_query_pos = strpos($base_url, '?')) !== FALSE) |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 456 | { |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 457 | $base_url = substr($base_url, 0, $base_query_pos); |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 458 | } |
| 459 | |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 460 | if ($first_url === '') |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 461 | { |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 462 | $first_url = $base_url.$query_string; |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 463 | } |
| 464 | |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 465 | $base_url = rtrim($base_url, '/').'/'; |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 466 | } |
| 467 | |
| 468 | // Determine the current page number. |
| 469 | $base_page = ($this->use_page_numbers) ? 1 : 0; |
| 470 | |
| 471 | // Are we using query strings? |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 472 | if ($this->page_query_string === TRUE) |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 473 | { |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 474 | $this->cur_page = $this->CI->input->get($this->query_string_segment); |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 475 | } |
| 476 | else |
| 477 | { |
| 478 | // Default to the last segment number if one hasn't been defined. |
| 479 | if ($this->uri_segment === 0) |
| 480 | { |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 481 | $this->uri_segment = count($this->CI->uri->segment_array()); |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 482 | } |
| 483 | |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 484 | $this->cur_page = $this->CI->uri->segment($this->uri_segment); |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 485 | |
| 486 | // Remove any specified prefix/suffix from the segment. |
Eric Roberts | 032af98 | 2013-01-28 23:25:52 -0600 | [diff] [blame] | 487 | if ($this->prefix !== '' OR $this->suffix !== '') |
| 488 | { |
| 489 | $this->cur_page = str_replace(array($this->prefix, $this->suffix), '', $this->cur_page); |
| 490 | } |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 491 | } |
| 492 | |
| 493 | // If something isn't quite right, back to the default base page. |
Eric Roberts | 032af98 | 2013-01-28 23:25:52 -0600 | [diff] [blame] | 494 | if ( ! ctype_digit($this->cur_page) OR ($this->use_page_numbers && (int) $this->cur_page === 0)) |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 495 | { |
| 496 | $this->cur_page = $base_page; |
| 497 | } |
Eric Roberts | 032af98 | 2013-01-28 23:25:52 -0600 | [diff] [blame] | 498 | else |
| 499 | { |
| 500 | // Make sure we're using integers for comparisons later. |
| 501 | $this->cur_page = (int) $this->cur_page; |
| 502 | } |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 503 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 504 | // Is the page number beyond the result range? |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 505 | // If so, we show the last page. |
Aaron Kuzemchak | 11c5f16 | 2011-09-03 20:59:07 -0400 | [diff] [blame] | 506 | if ($this->use_page_numbers) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 507 | { |
Aaron Kuzemchak | 11c5f16 | 2011-09-03 20:59:07 -0400 | [diff] [blame] | 508 | if ($this->cur_page > $num_pages) |
| 509 | { |
| 510 | $this->cur_page = $num_pages; |
| 511 | } |
| 512 | } |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 513 | elseif ($this->cur_page > $this->total_rows) |
Aaron Kuzemchak | 11c5f16 | 2011-09-03 20:59:07 -0400 | [diff] [blame] | 514 | { |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 515 | $this->cur_page = ($num_pages - 1) * $this->per_page; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 516 | } |
Derek Allard | faac15e | 2009-03-07 17:17:58 +0000 | [diff] [blame] | 517 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 518 | $uri_page_number = $this->cur_page; |
Eric Barnes | 9a4902a | 2011-12-03 23:46:06 -0500 | [diff] [blame] | 519 | |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 520 | // If we're using offset instead of page numbers, convert it |
| 521 | // to a page number, so we can generate the surrounding number links. |
Aaron Kuzemchak | 11c5f16 | 2011-09-03 20:59:07 -0400 | [diff] [blame] | 522 | if ( ! $this->use_page_numbers) |
| 523 | { |
Bo-Yi Wu | 5d50453 | 2012-07-14 00:03:56 +0800 | [diff] [blame] | 524 | $this->cur_page = (int) floor(($this->cur_page/$this->per_page) + 1); |
Aaron Kuzemchak | 11c5f16 | 2011-09-03 20:59:07 -0400 | [diff] [blame] | 525 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 526 | |
| 527 | // Calculate the start and end numbers. These determine |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 528 | // which number to start and end the digit links with. |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 529 | $start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1; |
| 530 | $end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 531 | |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 532 | // And here we go... |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 533 | $output = ''; |
Phil Sturgeon | f82b929 | 2012-06-23 15:49:23 +0100 | [diff] [blame] | 534 | |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 535 | // Render the "First" link. |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 536 | if ($this->first_link !== FALSE && $this->cur_page > ($this->num_links + 1)) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 537 | { |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 538 | // Take the general parameters, and squeeze this pagination-page attr in for JS frameworks. |
Andrey Andreev | 685cdd7 | 2012-07-13 20:11:13 +0300 | [diff] [blame] | 539 | $attributes = sprintf('%s %s="%d"', $this->_attributes, $this->data_page_attr, 1); |
Phil Sturgeon | a44cf57 | 2012-07-12 11:50:46 +0100 | [diff] [blame] | 540 | |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 541 | $output .= $this->first_tag_open.'<a href="'.$first_url.'"'.$attributes.$this->_attr_rel('start').'>' |
| 542 | .$first_link.'</a>'.$this->first_tag_close; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 543 | } |
| 544 | |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 545 | // Render the "Previous" link. |
Phil Sturgeon | f82b929 | 2012-06-23 15:49:23 +0100 | [diff] [blame] | 546 | if ($this->prev_link !== FALSE && $this->cur_page !== 1) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 547 | { |
Aaron Kuzemchak | a5e13f9 | 2011-09-04 16:39:47 -0400 | [diff] [blame] | 548 | $i = ($this->use_page_numbers) ? $uri_page_number - 1 : $uri_page_number - $this->per_page; |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 549 | |
Phil Sturgeon | a44cf57 | 2012-07-12 11:50:46 +0100 | [diff] [blame] | 550 | $attributes = sprintf('%s %s="%d"', $this->_attributes, $this->data_page_attr, (int) $i); |
| 551 | |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 552 | if ($i === $base_page) |
Robin Sowell | 2a6c1da | 2010-05-24 12:20:03 -0400 | [diff] [blame] | 553 | { |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 554 | // First page |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 555 | $output .= $this->prev_tag_open.'<a href="'.$first_url.'"'.$attributes.$this->_attr_rel('prev').'>' |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 556 | .$this->prev_link.'</a>'.$this->prev_tag_close; |
Robin Sowell | 2a6c1da | 2010-05-24 12:20:03 -0400 | [diff] [blame] | 557 | } |
| 558 | else |
| 559 | { |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 560 | $append = $this->prefix.$i.$this->suffix; |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 561 | $output .= $this->prev_tag_open.'<a href="'.$base_url.$append.'"'.$attributes.$this->_attr_rel('prev').'>' |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 562 | .$this->prev_link.'</a>'.$this->prev_tag_close; |
Robin Sowell | 2a6c1da | 2010-05-24 12:20:03 -0400 | [diff] [blame] | 563 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 564 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 565 | } |
| 566 | |
Derek Allard | e01fd0f | 2010-07-05 11:06:07 -0400 | [diff] [blame] | 567 | // Render the pages |
| 568 | if ($this->display_pages !== FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 569 | { |
Derek Allard | e01fd0f | 2010-07-05 11:06:07 -0400 | [diff] [blame] | 570 | // Write the digit links |
| 571 | for ($loop = $start -1; $loop <= $end; $loop++) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 572 | { |
Aaron Kuzemchak | a5e13f9 | 2011-09-04 16:39:47 -0400 | [diff] [blame] | 573 | $i = ($this->use_page_numbers) ? $loop : ($loop * $this->per_page) - $this->per_page; |
Phil Sturgeon | a44cf57 | 2012-07-12 11:50:46 +0100 | [diff] [blame] | 574 | |
Phil Sturgeon | a44cf57 | 2012-07-12 11:50:46 +0100 | [diff] [blame] | 575 | $attributes = sprintf('%s %s="%d"', $this->_attributes, $this->data_page_attr, (int) $i); |
| 576 | |
Aaron Kuzemchak | 11c5f16 | 2011-09-03 20:59:07 -0400 | [diff] [blame] | 577 | if ($i >= $base_page) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 578 | { |
Alex Bilbie | d261b1e | 2012-06-02 11:12:16 +0100 | [diff] [blame] | 579 | if ($this->cur_page === $loop) |
Robin Sowell | 2a6c1da | 2010-05-24 12:20:03 -0400 | [diff] [blame] | 580 | { |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 581 | // Current page |
| 582 | $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; |
| 583 | } |
| 584 | elseif ($i === $base_page) |
| 585 | { |
| 586 | // First page |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 587 | $output .= $this->num_tag_open.'<a href="'.$first_url.'"'.$attributes.$this->_attr_rel('start').'>' |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 588 | .$loop.'</a>'.$this->num_tag_close; |
Robin Sowell | 2a6c1da | 2010-05-24 12:20:03 -0400 | [diff] [blame] | 589 | } |
| 590 | else |
| 591 | { |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 592 | $append = $this->prefix.$i.$this->suffix; |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 593 | $output .= $this->num_tag_open.'<a href="'.$base_url.$append.'"'.$attributes.$this->_attr_rel('start').'>' |
Eric Roberts | 9f3a590 | 2013-01-28 04:29:06 -0600 | [diff] [blame] | 594 | .$loop.'</a>'.$this->num_tag_close; |
Robin Sowell | 2a6c1da | 2010-05-24 12:20:03 -0400 | [diff] [blame] | 595 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 596 | } |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | // Render the "next" link |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 601 | if ($this->next_link !== FALSE && $this->cur_page < $num_pages) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 602 | { |
Aaron Kuzemchak | a5e13f9 | 2011-09-04 16:39:47 -0400 | [diff] [blame] | 603 | $i = ($this->use_page_numbers) ? $this->cur_page + 1 : $this->cur_page * $this->per_page; |
Aaron Kuzemchak | 11c5f16 | 2011-09-03 20:59:07 -0400 | [diff] [blame] | 604 | |
Phil Sturgeon | a44cf57 | 2012-07-12 11:50:46 +0100 | [diff] [blame] | 605 | $attributes = sprintf('%s %s="%d"', $this->_attributes, $this->data_page_attr, (int) $i); |
| 606 | |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 607 | $output .= $this->next_tag_open.'<a href="'.$base_url.$this->prefix.$i.$this->suffix.'"'.$attributes |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 608 | .$this->_attr_rel('next').'>'.$this->next_link.'</a>'.$this->next_tag_close; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 609 | } |
| 610 | |
| 611 | // Render the "Last" link |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 612 | if ($this->last_link !== FALSE && ($this->cur_page + $this->num_links) < $num_pages) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 613 | { |
Aaron Kuzemchak | a5e13f9 | 2011-09-04 16:39:47 -0400 | [diff] [blame] | 614 | $i = ($this->use_page_numbers) ? $num_pages : ($num_pages * $this->per_page) - $this->per_page; |
Phil Sturgeon | c00a5a0 | 2011-11-22 15:25:32 +0000 | [diff] [blame] | 615 | |
Phil Sturgeon | a44cf57 | 2012-07-12 11:50:46 +0100 | [diff] [blame] | 616 | $attributes = sprintf('%s %s="%d"', $this->_attributes, $this->data_page_attr, (int) $i); |
| 617 | |
Andrey Andreev | b1616b8 | 2014-02-13 15:12:43 +0200 | [diff] [blame] | 618 | $output .= $this->last_tag_open.'<a href="'.$base_url.$this->prefix.$i.$this->suffix.'"'.$attributes.'>' |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 619 | .$this->last_link.'</a>'.$this->last_tag_close; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 620 | } |
| 621 | |
Phil Sturgeon | c00a5a0 | 2011-11-22 15:25:32 +0000 | [diff] [blame] | 622 | // Kill double slashes. Note: Sometimes we can end up with a double slash |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 623 | // in the penultimate link so we'll kill all double slashes. |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 624 | $output = preg_replace('#([^:])//+#', '\\1/', $output); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 625 | |
| 626 | // Add the wrapper HTML if exists |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 627 | return $this->full_tag_open.$output.$this->full_tag_close; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 628 | } |
Andrey Andreev | 796bc95 | 2012-03-26 19:40:40 +0300 | [diff] [blame] | 629 | |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 630 | // -------------------------------------------------------------------- |
| 631 | |
| 632 | /** |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 633 | * Parse attributes |
| 634 | * |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 635 | * @param array $attributes |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 636 | * @return void |
| 637 | */ |
| 638 | protected function _parse_attributes($attributes) |
| 639 | { |
| 640 | isset($attributes['rel']) OR $attributes['rel'] = TRUE; |
| 641 | $this->_link_types = ($attributes['rel']) |
Andrey Andreev | ffe8ade | 2014-02-17 18:51:48 +0200 | [diff] [blame^] | 642 | ? array('start' => 'start', 'prev' => 'prev', 'next' => 'next') |
| 643 | : array(); |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 644 | unset($attributes['rel']); |
| 645 | |
| 646 | $this->_attributes = ''; |
| 647 | foreach ($attributes as $key => $value) |
| 648 | { |
| 649 | $this->_attributes .= ' '.$key.'="'.$value.'"'; |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | // -------------------------------------------------------------------- |
| 654 | |
| 655 | /** |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 656 | * Add "rel" attribute |
| 657 | * |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 658 | * @link http://www.w3.org/TR/html5/links.html#linkTypes |
Andrey Andreev | 0fa95bd | 2012-11-01 23:33:14 +0200 | [diff] [blame] | 659 | * @param string $type |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 660 | * @return string |
| 661 | */ |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 662 | protected function _attr_rel($type) |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 663 | { |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 664 | if (isset($this->_link_types[$type])) |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 665 | { |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 666 | unset($this->_link_types[$type]); |
| 667 | return ' rel="'.$type.'"'; |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 668 | } |
| 669 | |
Andrey Andreev | 88c4727 | 2012-06-17 02:32:31 +0300 | [diff] [blame] | 670 | return ''; |
Andrey Andreev | 5a1e5e3 | 2012-06-12 11:28:26 +0300 | [diff] [blame] | 671 | } |
| 672 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 673 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 674 | |
| 675 | /* End of file Pagination.php */ |
Andrey Andreev | 685cdd7 | 2012-07-13 20:11:13 +0300 | [diff] [blame] | 676 | /* Location: ./system/libraries/Pagination.php */ |