Updated Paginator to fit better with bootstrap 2.1

The Paginator Renders a list of links compatible with bootstrap 2.1 standards ... so the irritating bug that used to be there on active and disabled pages is gone
This commit is contained in:
kapil verma 2012-09-01 19:00:47 +05:30
parent e8046847c4
commit f97fb3a457
1 changed files with 4 additions and 4 deletions

View File

@ -183,7 +183,7 @@ public function links($adjacent = 3)
$links = $this->slider($adjacent); $links = $this->slider($adjacent);
} }
$content = $this->previous().' '.$links.' '.$this->next(); $content = '<ul>' . $this->previous() . $links . $this->next() . '</ul>';
return '<div class="pagination">'.$content.'</div>'; return '<div class="pagination">'.$content.'</div>';
} }
@ -300,7 +300,7 @@ protected function element($element, $page, $text, $disabled)
// the "first" element should be a span instead of a link. // the "first" element should be a span instead of a link.
if ($disabled($this->page, $this->last)) if ($disabled($this->page, $this->last))
{ {
return HTML::span($text, array('class' => "{$class} disabled")); return '<li'.HTML::attributes(array('class'=>"{$class} disabled")).'><a href="#">'.$text.'</a>';
} }
else else
{ {
@ -349,7 +349,7 @@ protected function range($start, $end)
{ {
if ($this->page == $page) if ($this->page == $page)
{ {
$pages[] = HTML::span($page, array('class' => 'current')); $pages[] = '<li class="active"><a href="#">'.$page.'</a></li>';
} }
else else
{ {
@ -372,7 +372,7 @@ protected function link($page, $text, $class)
{ {
$query = '?page='.$page.$this->appendage($this->appends); $query = '?page='.$page.$this->appendage($this->appends);
return HTML::link(URI::current().$query, $text, compact('class'), Request::secure()); return '<li'.HTML::attributes(compact($class)).'>'. HTML::link(URI::current().$query, $text, [], Request::secure()).'</li>';
} }
/** /**