From 1c5187b50916debb67a443246bfd5fa592c539ab Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 22 Jul 2011 11:18:27 -0700 Subject: [PATCH] removed span class from paginator class. --- system/paginator.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/system/paginator.php b/system/paginator.php index 10e6be16..819dbf7e 100644 --- a/system/paginator.php +++ b/system/paginator.php @@ -48,12 +48,10 @@ class Paginator { public function __construct($results, $total, $per_page) { $this->page = static::page($total, $per_page); - + $this->last_page = ceil($total / $per_page); $this->per_page = $per_page; $this->results = $results; $this->total = $total; - - $this->last_page = ceil($total / $per_page); } /** @@ -93,14 +91,13 @@ class Paginator { * * If there are not enough pages to make it worth sliding, all of the pages will be listed. * - * Note: "7" is added to the adjacent range to account for the seven constant elements in a - * slider: the first and last two links, the current page, and the two "..." strings. - * * @param int $adjacent * @return string */ private function numbers($adjacent = 3) { + // "7" is added to the adjacent range to account for the seven constant elements + // in a slider: the first and last two links, the current page, and the two "..." strings. return ($this->last_page < 7 + ($adjacent * 2)) ? $this->range(1, $this->last_page) : $this->slider($adjacent); } @@ -120,10 +117,8 @@ class Paginator { { return $this->beginning().$this->range($this->last_page - 2 - ($adjacent * 2), $this->last_page); } - else - { - return $this->beginning().$this->range($this->page - $adjacent, $this->page + $adjacent).$this->ending(); - } + + return $this->beginning().$this->range($this->page - $adjacent, $this->page + $adjacent).$this->ending(); } /** @@ -140,7 +135,7 @@ class Paginator { return HTML::link(Request::uri().'?page='.($this->page - 1), $text, array('class' => 'prev_page')).' '; } - return HTML::span($text, array('class' => 'disabled prev_page')).' '; + return "$text "; } /** @@ -157,7 +152,7 @@ class Paginator { return HTML::link(Request::uri().'?page='.($this->page + 1), $text, array('class' => 'next_page')); } - return HTML::span($text, array('class' => 'disabled next_page')); + return "$text"; } /** @@ -167,7 +162,7 @@ class Paginator { */ private function beginning() { - return $this->range(1, 2).'...'; + return $this->range(1, 2).'... '; } /** @@ -177,7 +172,7 @@ class Paginator { */ private function ending() { - return '...'.$this->range($this->last_page - 1, $this->last_page); + return '... '.$this->range($this->last_page - 1, $this->last_page); } /** @@ -195,7 +190,7 @@ class Paginator { for ($i = $start; $i <= $end; $i++) { - $pages .= ($this->page == $i) ? HTML::span($i, array('class' => 'current')).' ' : HTML::link(Request::uri().'?page='.$i, $i).' '; + $pages .= ($this->page == $i) ? "$i " : HTML::link(Request::uri().'?page='.$i, $i).' '; } return $pages;