X-Git-Url: http://git.onelab.eu/?p=www-register-wizard.git;a=blobdiff_plain;f=libraries%2FPagination.php;h=d73c58e086a0d959d43e76b391c3a61a3bf6272a;hp=54ddd4c3a4665e9e1b40d982fc9953f840c01547;hb=47598daa8c32dbbd72db83dc33f2ce91b3f6f7b0;hpb=4afb2fe256f094a1caf6bff14f51c6a88938cc9f
diff --git a/libraries/Pagination.php b/libraries/Pagination.php
index 54ddd4c..d73c58e 100644
--- a/libraries/Pagination.php
+++ b/libraries/Pagination.php
@@ -6,7 +6,7 @@
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
- * @copyright Copyright (c) 2008, EllisLab, Inc.
+ * @copyright Copyright (c) 2008 - 2009, EllisLab, Inc.
* @license http://codeigniter.com/user_guide/license.html
* @link http://codeigniter.com
* @since Version 1.0
@@ -42,8 +42,8 @@ class CI_Pagination {
var $first_tag_close = ' ';
var $last_tag_open = ' ';
var $last_tag_close = '';
- var $cur_tag_open = ' ';
- var $cur_tag_close = '';
+ var $cur_tag_open = ' ';
+ var $cur_tag_close = '';
var $next_tag_open = ' ';
var $next_tag_close = ' ';
var $prev_tag_open = ' ';
@@ -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