summaryrefslogtreecommitdiffstats
path: root/system/libraries/Pagination.php
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2009-03-07 18:17:58 +0100
committerDerek Allard <derek.allard@ellislab.com>2009-03-07 18:17:58 +0100
commitfaac15e56fd45a18049f83d4282436c3d86f6939 (patch)
treeb300a7b74af3525f6aa09ba219c72bef72da7a3a /system/libraries/Pagination.php
parentf88ad5e88fded3d1bfbf71ef9c194ebcc433c5e0 (diff)
spaces for tabs
Diffstat (limited to 'system/libraries/Pagination.php')
-rw-r--r--system/libraries/Pagination.php38
1 files changed, 19 insertions, 19 deletions
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index 09b5bec84..629cbf140 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -63,14 +63,14 @@ class CI_Pagination {
{
if (count($params) > 0)
{
- $this->initialize($params);
+ $this->initialize($params);
}
-
+
log_message('debug', "Pagination Class Initialized");
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Initialize Preferences
*
@@ -91,21 +91,21 @@ class CI_Pagination {
}
}
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Generate the pagination links
*
* @access public
* @return string
- */
+ */
function create_links()
{
// If our item count or per-page total is zero there is no need to continue.
if ($this->total_rows == 0 OR $this->per_page == 0)
{
- return '';
+ return '';
}
// Calculate the total number of pages
@@ -117,15 +117,15 @@ class CI_Pagination {
return '';
}
- // Determine the current page number.
+ // Determine the current page number.
$CI =& get_instance();
-
+
if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
{
if ($CI->input->get($this->query_string_segment) != 0)
{
$this->cur_page = $CI->input->get($this->query_string_segment);
-
+
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
@@ -135,31 +135,31 @@ class CI_Pagination {
if ($CI->uri->segment($this->uri_segment) != 0)
{
$this->cur_page = $CI->uri->segment($this->uri_segment);
-
+
// Prep the current page - no funny business!
$this->cur_page = (int) $this->cur_page;
}
}
$this->num_links = (int)$this->num_links;
-
+
if ($this->num_links < 1)
{
show_error('Your number of links must be a positive number.');
}
-
+
if ( ! is_numeric($this->cur_page))
{
$this->cur_page = 0;
}
-
+
// Is the page number beyond the result range?
// If so we show the last page
if ($this->cur_page > $this->total_rows)
{
$this->cur_page = ($num_pages - 1) * $this->per_page;
}
-
+
$uri_page_number = $this->cur_page;
$this->cur_page = floor(($this->cur_page/$this->per_page) + 1);
@@ -200,7 +200,7 @@ class CI_Pagination {
for ($loop = $start -1; $loop <= $end; $loop++)
{
$i = ($loop * $this->per_page) - $this->per_page;
-
+
if ($i >= 0)
{
if ($this->cur_page == $loop)
@@ -234,8 +234,8 @@ class CI_Pagination {
// Add the wrapper HTML if exists
$output = $this->full_tag_open.$output.$this->full_tag_close;
-
- return $output;
+
+ return $output;
}
}
// END Pagination Class