blob: 75745dd48a26f71cbb9d9df73e088616901d9b5c [file] [log] [blame]
Andrey Andreev33987e62011-12-24 19:48:45 +02001<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Derek Allard2067d1a2008-11-13 22:59:24 +00002/**
3 * CodeIgniter
4 *
Phil Sturgeon07c1ac82012-03-09 17:03:37 +00005 * An open source application development framework for PHP 5.2.4 or newer
Derek Allard2067d1a2008-11-13 22:59:24 +00006 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -05007 * NOTICE OF LICENSE
Eric Barnes9a4902a2011-12-03 23:46:06 -05008 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -05009 * Licensed under the Open Software License version 3.0
Eric Barnes9a4902a2011-12-03 23:46:06 -050010 *
Derek Jonesf4a4bd82011-10-20 12:18:42 -050011 * 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 Allard2067d1a2008-11-13 22:59:24 +000019 * @package CodeIgniter
Derek Jonesf4a4bd82011-10-20 12:18:42 -050020 * @author EllisLab Dev Team
Greg Aker0defe5d2012-01-01 18:46:41 -060021 * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/)
Derek Jonesf4a4bd82011-10-20 12:18:42 -050022 * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
Derek Allard2067d1a2008-11-13 22:59:24 +000023 * @link http://codeigniter.com
24 * @since Version 1.0
25 * @filesource
26 */
27
Derek Allard2067d1a2008-11-13 22:59:24 +000028/**
29 * Pagination Class
30 *
31 * @package CodeIgniter
32 * @subpackage Libraries
33 * @category Pagination
Derek Jonesf4a4bd82011-10-20 12:18:42 -050034 * @author EllisLab Dev Team
Derek Allard2067d1a2008-11-13 22:59:24 +000035 * @link http://codeigniter.com/user_guide/libraries/pagination.html
36 */
37class CI_Pagination {
38
Phil Sturgeonf82b9292012-06-23 15:49:23 +010039 protected $base_url = ''; // The page we are linking to
40 protected $prefix = ''; // A custom prefix added to the path.
41 protected $suffix = ''; // A custom suffix added to the path.
42 protected $total_rows = 0; // Total number of items (database results)
43 protected $per_page = 10; // Max number of items you want shown per page
44 protected $num_links = 2; // Number of "digit" links to show before/after the currently viewed page
45 protected $cur_page = 0; // The current page being viewed
46 protected $use_page_numbers = FALSE; // Use page number for segment instead of offset
47 protected $first_link = '&lsaquo; First';
48 protected $next_link = '&gt;';
49 protected $prev_link = '&lt;';
50 protected $last_link = 'Last &rsaquo;';
51 protected $uri_segment = 3;
52 protected $full_tag_open = '';
53 protected $full_tag_close = '';
54 protected $first_tag_open = '';
55 protected $first_tag_close = '&nbsp;';
56 protected $last_tag_open = '&nbsp;';
57 protected $last_tag_close = '';
58 protected $first_url = ''; // Alternative URL for the First Page.
59 protected $cur_tag_open = '&nbsp;<strong>';
60 protected $cur_tag_close = '</strong>';
61 protected $next_tag_open = '&nbsp;';
62 protected $next_tag_close = '&nbsp;';
63 protected $prev_tag_open = '&nbsp;';
64 protected $prev_tag_close = '';
65 protected $num_tag_open = '&nbsp;';
66 protected $num_tag_close = '';
67 protected $page_query_string = FALSE;
68 protected $query_string_segment = 'per_page';
69 protected $display_pages = TRUE;
70 protected $_attributes = '';
71 protected $_link_types = array();
72 protected $reuse_query_string = FALSE;
Derek Allard2067d1a2008-11-13 22:59:24 +000073
74 /**
75 * Constructor
76 *
Derek Allard2067d1a2008-11-13 22:59:24 +000077 * @param array initialization parameters
Andrey Andreev56454792012-05-17 14:32:19 +030078 * @return void
Derek Allard2067d1a2008-11-13 22:59:24 +000079 */
Greg Akera9263282010-11-10 15:26:43 -060080 public function __construct($params = array())
Derek Allard2067d1a2008-11-13 22:59:24 +000081 {
Eric Barnesbce41402011-12-03 23:47:41 -050082 $this->initialize($params);
Andrey Andreev796bc952012-03-26 19:40:40 +030083 log_message('debug', 'Pagination Class Initialized');
Derek Allard2067d1a2008-11-13 22:59:24 +000084 }
Derek Allardfaac15e2009-03-07 17:17:58 +000085
Derek Allard2067d1a2008-11-13 22:59:24 +000086 // --------------------------------------------------------------------
Derek Allardfaac15e2009-03-07 17:17:58 +000087
Derek Allard2067d1a2008-11-13 22:59:24 +000088 /**
89 * Initialize Preferences
90 *
Derek Allard2067d1a2008-11-13 22:59:24 +000091 * @param array initialization parameters
92 * @return void
93 */
Eric Barnes9a4902a2011-12-03 23:46:06 -050094 public function initialize($params = array())
Derek Allard2067d1a2008-11-13 22:59:24 +000095 {
Andrey Andreev88c47272012-06-17 02:32:31 +030096 $attributes = array();
97
98 if (isset($params['attributes']) && is_array($params['attributes']))
99 {
100 $attributes = $params['attributes'];
101 unset($params['attributes']);
102 }
103
104 // Deprecated legacy support for the anchor_class option
105 // Should be removed in CI 3.1+
106 if (isset($params['anchor_class']))
107 {
108 empty($params['anchor_class']) OR $attributes['class'] = $params['anchor_class'];
109 unset($params['anchor_class']);
110 }
111
112 $this->_parse_attributes($attributes);
113
Derek Allard2067d1a2008-11-13 22:59:24 +0000114 if (count($params) > 0)
115 {
116 foreach ($params as $key => $val)
117 {
Andrey Andreev88c47272012-06-17 02:32:31 +0300118 if (isset($this->$key))
Derek Allard2067d1a2008-11-13 22:59:24 +0000119 {
120 $this->$key = $val;
121 }
122 }
123 }
124 }
Derek Allardfaac15e2009-03-07 17:17:58 +0000125
Derek Allard2067d1a2008-11-13 22:59:24 +0000126 // --------------------------------------------------------------------
Derek Allardfaac15e2009-03-07 17:17:58 +0000127
Derek Allard2067d1a2008-11-13 22:59:24 +0000128 /**
129 * Generate the pagination links
130 *
Derek Allard2067d1a2008-11-13 22:59:24 +0000131 * @return string
Derek Allardfaac15e2009-03-07 17:17:58 +0000132 */
Eric Barnes9a4902a2011-12-03 23:46:06 -0500133 public function create_links()
Derek Allard2067d1a2008-11-13 22:59:24 +0000134 {
135 // If our item count or per-page total is zero there is no need to continue.
Alex Bilbied261b1e2012-06-02 11:12:16 +0100136 if ($this->total_rows === 0 OR $this->per_page === 0)
Derek Allard2067d1a2008-11-13 22:59:24 +0000137 {
Derek Allardfaac15e2009-03-07 17:17:58 +0000138 return '';
Derek Allard2067d1a2008-11-13 22:59:24 +0000139 }
140
141 // Calculate the total number of pages
Ronald Beilsmacfb70212011-12-29 09:57:49 +0100142 $num_pages = (int) ceil($this->total_rows / $this->per_page);
Derek Allard2067d1a2008-11-13 22:59:24 +0000143
144 // Is there only one page? Hm... nothing more to do here then.
Ronald Beilsmacfb70212011-12-29 09:57:49 +0100145 if ($num_pages === 1)
Derek Allard2067d1a2008-11-13 22:59:24 +0000146 {
147 return '';
148 }
149
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400150 // Set the base page index for starting page number
Aaron Kuzemchaka5e13f92011-09-04 16:39:47 -0400151 $base_page = ($this->use_page_numbers) ? 1 : 0;
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400152
Derek Allardfaac15e2009-03-07 17:17:58 +0000153 // Determine the current page number.
Derek Allard2067d1a2008-11-13 22:59:24 +0000154 $CI =& get_instance();
Derek Allardfaac15e2009-03-07 17:17:58 +0000155
Eric Barnes3b376592012-01-04 00:28:27 -0500156 // See if we are using a prefix or suffix on links
Alex Bilbied261b1e2012-06-02 11:12:16 +0100157 if ($this->prefix !== '' OR $this->suffix !== '')
Eric Barnes8d727f12012-01-04 00:06:36 -0500158 {
Eric Barnes3b376592012-01-04 00:28:27 -0500159 $this->cur_page = (int) str_replace(array($this->prefix, $this->suffix), '', $CI->uri->segment($this->uri_segment));
Eric Barnes8d727f12012-01-04 00:06:36 -0500160 }
161
Derek Allard2067d1a2008-11-13 22:59:24 +0000162 if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
163 {
Andrey Andreev7eb7ebf2012-06-12 10:26:27 +0300164 if ($CI->input->get($this->query_string_segment) != $base_page)
Derek Allard2067d1a2008-11-13 22:59:24 +0000165 {
Andrey Andreev33987e62011-12-24 19:48:45 +0200166 $this->cur_page = (int) $CI->input->get($this->query_string_segment);
Derek Allard2067d1a2008-11-13 22:59:24 +0000167 }
168 }
Alex Bilbied261b1e2012-06-02 11:12:16 +0100169 elseif ( ! $this->cur_page && $CI->uri->segment($this->uri_segment) !== $base_page)
Derek Allard2067d1a2008-11-13 22:59:24 +0000170 {
Andrey Andreev33987e62011-12-24 19:48:45 +0200171 $this->cur_page = (int) $CI->uri->segment($this->uri_segment);
Derek Allard2067d1a2008-11-13 22:59:24 +0000172 }
Eric Barnes9a4902a2011-12-03 23:46:06 -0500173
Andrey Andreev33987e62011-12-24 19:48:45 +0200174 // Set current page to 1 if it's not valid or if using page numbers instead of offset
Alex Bilbied261b1e2012-06-02 11:12:16 +0100175 if ( ! is_numeric($this->cur_page) OR ($this->use_page_numbers && $this->cur_page === 0))
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400176 {
177 $this->cur_page = $base_page;
178 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000179
Eric Barnes3b376592012-01-04 00:28:27 -0500180 $this->num_links = (int) $this->num_links;
Derek Allardfaac15e2009-03-07 17:17:58 +0000181
Derek Allard2067d1a2008-11-13 22:59:24 +0000182 if ($this->num_links < 1)
183 {
184 show_error('Your number of links must be a positive number.');
185 }
Derek Allardfaac15e2009-03-07 17:17:58 +0000186
Derek Allard2067d1a2008-11-13 22:59:24 +0000187 // Is the page number beyond the result range?
188 // If so we show the last page
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400189 if ($this->use_page_numbers)
Derek Allard2067d1a2008-11-13 22:59:24 +0000190 {
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400191 if ($this->cur_page > $num_pages)
192 {
193 $this->cur_page = $num_pages;
194 }
195 }
Andrey Andreev796bc952012-03-26 19:40:40 +0300196 elseif ($this->cur_page > $this->total_rows)
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400197 {
Andrey Andreev796bc952012-03-26 19:40:40 +0300198 $this->cur_page = ($num_pages - 1) * $this->per_page;
Derek Allard2067d1a2008-11-13 22:59:24 +0000199 }
Derek Allardfaac15e2009-03-07 17:17:58 +0000200
Derek Allard2067d1a2008-11-13 22:59:24 +0000201 $uri_page_number = $this->cur_page;
Eric Barnes9a4902a2011-12-03 23:46:06 -0500202
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400203 if ( ! $this->use_page_numbers)
204 {
205 $this->cur_page = floor(($this->cur_page/$this->per_page) + 1);
206 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000207
208 // Calculate the start and end numbers. These determine
209 // which number to start and end the digit links with
Andrey Andreev796bc952012-03-26 19:40:40 +0300210 $start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1;
211 $end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages;
Derek Allard2067d1a2008-11-13 22:59:24 +0000212
Andrey Andreev796bc952012-03-26 19:40:40 +0300213 // Is pagination being used over GET or POST? If get, add a per_page query
Derek Allard2067d1a2008-11-13 22:59:24 +0000214 // string. If post, add a trailing slash to the base URL if needed
215 if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
216 {
217 $this->base_url = rtrim($this->base_url).'&amp;'.$this->query_string_segment.'=';
218 }
219 else
220 {
221 $this->base_url = rtrim($this->base_url, '/') .'/';
222 }
223
Barry Mienydd671972010-10-04 16:33:58 +0200224 // And here we go...
Derek Allard2067d1a2008-11-13 22:59:24 +0000225 $output = '';
Phil Sturgeonf82b9292012-06-23 15:49:23 +0100226 $query_string = '';
227
228 // Add anything in the query string back to the links
229 // Note: Nothing to do with query_string_segment or any other query string options
230 if ($this->reuse_query_string === TRUE)
231 {
232 $get = $CI->input->get();
233
234 // Unset the controll, method, old-school routing options
235 unset($get['c'], $get['m'], $get[$this->query_string_segment]);
236
237 // Put everything else onto the end
238 $query_string = (strpos($this->base_url, '&amp;') !== FALSE ? '&amp;' : '?') . http_build_query($get, '', '&amp;');
239
240 // Add this after the suffix to put it into more links easily
241 $this->suffix .= $query_string;
242 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000243
244 // Render the "First" link
Andrey Andreev796bc952012-03-26 19:40:40 +0300245 if ($this->first_link !== FALSE && $this->cur_page > ($this->num_links + 1))
Derek Allard2067d1a2008-11-13 22:59:24 +0000246 {
Alex Bilbied261b1e2012-06-02 11:12:16 +0100247 $first_url = ($this->first_url === '') ? $this->base_url : $this->first_url;
Andrey Andreev88c47272012-06-17 02:32:31 +0300248 $output .= $this->first_tag_open.'<a href="'.$first_url.'"'.$this->_attributes.$this->_attr_rel('start').'>'
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300249 .$this->first_link.'</a>'.$this->first_tag_close;
Derek Allard2067d1a2008-11-13 22:59:24 +0000250 }
251
252 // Render the "previous" link
Phil Sturgeonf82b9292012-06-23 15:49:23 +0100253 if ($this->prev_link !== FALSE && $this->cur_page !== 1)
Derek Allard2067d1a2008-11-13 22:59:24 +0000254 {
Aaron Kuzemchaka5e13f92011-09-04 16:39:47 -0400255 $i = ($this->use_page_numbers) ? $uri_page_number - 1 : $uri_page_number - $this->per_page;
Barry Mienydd671972010-10-04 16:33:58 +0200256
Alex Bilbied261b1e2012-06-02 11:12:16 +0100257 if ($i === $base_page && $this->first_url !== '')
Robin Sowell2a6c1da2010-05-24 12:20:03 -0400258 {
Phil Sturgeonf82b9292012-06-23 15:49:23 +0100259 $output .= $this->prev_tag_open.'<a href="'.$this->first_url.$query_string.'"'.$this->_attributes.$this->_attr_rel('prev').'>'
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300260 .$this->prev_link.'</a>'.$this->prev_tag_close;
Robin Sowell2a6c1da2010-05-24 12:20:03 -0400261 }
262 else
263 {
Phil Sturgeonf82b9292012-06-23 15:49:23 +0100264 $append = ($i === $base_page) ? $query_string : $this->prefix.$i.$this->suffix;
265 $output .= $this->prev_tag_open.'<a href="'.$this->base_url.$append.'"'.$this->_attributes.$this->_attr_rel('prev').'>'
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300266 .$this->prev_link.'</a>'.$this->prev_tag_close;
Robin Sowell2a6c1da2010-05-24 12:20:03 -0400267 }
Barry Mienydd671972010-10-04 16:33:58 +0200268
Derek Allard2067d1a2008-11-13 22:59:24 +0000269 }
270
Derek Allarde01fd0f2010-07-05 11:06:07 -0400271 // Render the pages
272 if ($this->display_pages !== FALSE)
Derek Allard2067d1a2008-11-13 22:59:24 +0000273 {
Derek Allarde01fd0f2010-07-05 11:06:07 -0400274 // Write the digit links
275 for ($loop = $start -1; $loop <= $end; $loop++)
Derek Allard2067d1a2008-11-13 22:59:24 +0000276 {
Aaron Kuzemchaka5e13f92011-09-04 16:39:47 -0400277 $i = ($this->use_page_numbers) ? $loop : ($loop * $this->per_page) - $this->per_page;
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400278 if ($i >= $base_page)
Derek Allard2067d1a2008-11-13 22:59:24 +0000279 {
Alex Bilbied261b1e2012-06-02 11:12:16 +0100280 if ($this->cur_page === $loop)
Robin Sowell2a6c1da2010-05-24 12:20:03 -0400281 {
Derek Allarde01fd0f2010-07-05 11:06:07 -0400282 $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page
Robin Sowell2a6c1da2010-05-24 12:20:03 -0400283 }
284 else
285 {
Alex Bilbied261b1e2012-06-02 11:12:16 +0100286 $n = ($i === $base_page) ? '' : $i;
Andrey Andreev88c47272012-06-17 02:32:31 +0300287 if ($n === '' && ! empty($this->first_url))
Derek Allarde01fd0f2010-07-05 11:06:07 -0400288 {
Phil Sturgeonf82b9292012-06-23 15:49:23 +0100289 $output .= $this->num_tag_open.'<a href="'.$this->first_url.$query_string.'"'.$this->_attributes.$this->_attr_rel('start').'>'
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300290 .$loop.'</a>'.$this->num_tag_close;
Derek Allarde01fd0f2010-07-05 11:06:07 -0400291 }
292 else
293 {
Phil Sturgeonf82b9292012-06-23 15:49:23 +0100294 $append = ($n === '') ? $query_string : $this->prefix.$n.$this->suffix;
295 $output .= $this->num_tag_open.'<a href="'.$this->base_url.$append.'"'.$this->_attributes.$this->_attr_rel('start').'>'
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300296 .$loop.'</a>'.$this->num_tag_close;
Derek Allarde01fd0f2010-07-05 11:06:07 -0400297 }
Robin Sowell2a6c1da2010-05-24 12:20:03 -0400298 }
Derek Allard2067d1a2008-11-13 22:59:24 +0000299 }
300 }
301 }
302
303 // Render the "next" link
Andrey Andreev796bc952012-03-26 19:40:40 +0300304 if ($this->next_link !== FALSE && $this->cur_page < $num_pages)
Derek Allard2067d1a2008-11-13 22:59:24 +0000305 {
Aaron Kuzemchaka5e13f92011-09-04 16:39:47 -0400306 $i = ($this->use_page_numbers) ? $this->cur_page + 1 : $this->cur_page * $this->per_page;
Aaron Kuzemchak11c5f162011-09-03 20:59:07 -0400307
Andrey Andreev88c47272012-06-17 02:32:31 +0300308 $output .= $this->next_tag_open.'<a href="'.$this->base_url.$this->prefix.$i.$this->suffix.'"'.$this->_attributes
309 .$this->_attr_rel('next').'>'.$this->next_link.'</a>'.$this->next_tag_close;
Derek Allard2067d1a2008-11-13 22:59:24 +0000310 }
311
312 // Render the "Last" link
Andrey Andreev796bc952012-03-26 19:40:40 +0300313 if ($this->last_link !== FALSE && ($this->cur_page + $this->num_links) < $num_pages)
Derek Allard2067d1a2008-11-13 22:59:24 +0000314 {
Aaron Kuzemchaka5e13f92011-09-04 16:39:47 -0400315 $i = ($this->use_page_numbers) ? $num_pages : ($num_pages * $this->per_page) - $this->per_page;
Phil Sturgeonc00a5a02011-11-22 15:25:32 +0000316
Andrey Andreev88c47272012-06-17 02:32:31 +0300317 $output .= $this->last_tag_open.'<a href="'.$this->base_url.$this->prefix.$i.$this->suffix.'"'.$this->_attributes.'>'
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300318 .$this->last_link.'</a>'.$this->last_tag_close;
Derek Allard2067d1a2008-11-13 22:59:24 +0000319 }
320
Phil Sturgeonc00a5a02011-11-22 15:25:32 +0000321 // Kill double slashes. Note: Sometimes we can end up with a double slash
Derek Allard2067d1a2008-11-13 22:59:24 +0000322 // in the penultimate link so we'll kill all double slashes.
Andrey Andreev796bc952012-03-26 19:40:40 +0300323 $output = preg_replace('#([^:])//+#', '\\1/', $output);
Derek Allard2067d1a2008-11-13 22:59:24 +0000324
325 // Add the wrapper HTML if exists
Andrey Andreev796bc952012-03-26 19:40:40 +0300326 return $this->full_tag_open.$output.$this->full_tag_close;
Derek Allard2067d1a2008-11-13 22:59:24 +0000327 }
Andrey Andreev796bc952012-03-26 19:40:40 +0300328
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300329 // --------------------------------------------------------------------
330
331 /**
Andrey Andreev88c47272012-06-17 02:32:31 +0300332 * Parse attributes
333 *
334 * @param array
335 * @return void
336 */
337 protected function _parse_attributes($attributes)
338 {
339 isset($attributes['rel']) OR $attributes['rel'] = TRUE;
340 $this->_link_types = ($attributes['rel'])
341 ? array('start' => 'start', 'prev' => 'prev', 'next' => 'next')
342 : array();
343 unset($attributes['rel']);
344
345 $this->_attributes = '';
346 foreach ($attributes as $key => $value)
347 {
348 $this->_attributes .= ' '.$key.'="'.$value.'"';
349 }
350 }
351
352 // --------------------------------------------------------------------
353
354 /**
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300355 * Add "rel" attribute
356 *
Andrey Andreev88c47272012-06-17 02:32:31 +0300357 * @link http://www.w3.org/TR/html5/links.html#linkTypes
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300358 * @param string
359 * @return string
360 */
Andrey Andreev88c47272012-06-17 02:32:31 +0300361 protected function _attr_rel($type)
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300362 {
Andrey Andreev88c47272012-06-17 02:32:31 +0300363 if (isset($this->_link_types[$type]))
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300364 {
Andrey Andreev88c47272012-06-17 02:32:31 +0300365 unset($this->_link_types[$type]);
366 return ' rel="'.$type.'"';
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300367 }
368
Andrey Andreev88c47272012-06-17 02:32:31 +0300369 return '';
Andrey Andreev5a1e5e32012-06-12 11:28:26 +0300370 }
371
Derek Allard2067d1a2008-11-13 22:59:24 +0000372}
Derek Allard2067d1a2008-11-13 22:59:24 +0000373
374/* End of file Pagination.php */
Andrey Andreev796bc952012-03-26 19:40:40 +0300375/* Location: ./system/libraries/Pagination.php */