*
* @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
var $first_tag_close = ' ';
var $last_tag_open = ' ';
var $last_tag_close = '';
- var $cur_tag_open = ' <b>';
- var $cur_tag_close = '</b>';
+ var $cur_tag_open = ' <strong>';
+ var $cur_tag_close = '</strong>';
var $next_tag_open = ' ';
var $next_tag_close = ' ';
var $prev_tag_open = ' ';
{
if (count($params) > 0)
{
- $this->initialize($params);
+ $this->initialize($params);
}
-
+
log_message('debug', "Pagination Class Initialized");
}
-
+
// --------------------------------------------------------------------
-
+
/**
* Initialize Preferences
*
}
}
}
-
+
// --------------------------------------------------------------------
-
+
/**
* 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
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;
}
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);
for ($loop = $start -1; $loop <= $end; $loop++)
{
$i = ($loop * $this->per_page) - $this->per_page;
-
+
if ($i >= 0)
{
if ($this->cur_page == $loop)
// Add the wrapper HTML if exists
$output = $this->full_tag_open.$output.$this->full_tag_close;
-
- return $output;
+
+ return $output;
}
}
// END Pagination Class