summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-06-13 13:17:15 +0200
committerAndrey Andreev <narf@devilix.net>2014-06-13 13:17:15 +0200
commitcfbc6f7d3e2bf886c13ccbe5ef876f4cf9c0f259 (patch)
tree7f7bc1e731370bf44d13f48b5ed3230d5873a188 /system/libraries
parent7cea03ba6367919c25665b28644951588f817abd (diff)
parent8ed90fa219df5f37b32dc2b5bbd96da98cdd0b5c (diff)
Merge pull request #3104 from TakayukiSakai/develop
Make num_links=0 in pagination library possible to configure
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Pagination.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index 5b9bfcb5d..3c8baac36 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -393,9 +393,9 @@ class CI_Pagination {
// Check the user defined number of links.
$this->num_links = (int) $this->num_links;
- if ($this->num_links < 1)
+ if ($this->num_links < 0)
{
- show_error('Your number of links must be a positive number.');
+ show_error('Your number of links must be a non-negative number.');
}
// Keep any existing query string items.
@@ -533,7 +533,7 @@ class CI_Pagination {
$output = '';
// Render the "First" link.
- if ($this->first_link !== FALSE && $this->cur_page > ($this->num_links + 1))
+ if ($this->first_link !== FALSE && $this->cur_page > ($this->num_links + 1 + ! $this->num_links))
{
// Take the general parameters, and squeeze this pagination-page attr in for JS frameworks.
$attributes = sprintf('%s %s="%d"', $this->_attributes, $this->data_page_attr, 1);
@@ -609,7 +609,7 @@ class CI_Pagination {
}
// Render the "Last" link
- if ($this->last_link !== FALSE && ($this->cur_page + $this->num_links) < $num_pages)
+ if ($this->last_link !== FALSE && ($this->cur_page + $this->num_links + ! $this->num_links) < $num_pages)
{
$i = ($this->use_page_numbers) ? $num_pages : ($num_pages * $this->per_page) - $this->per_page;