Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed the addition of the styling tags to next and previous.

Added two addition styling options for next inactive and previous inactive.
  • Loading branch information...
commit 005ea5ade69ed5e7d6dfa80778acd7ec9a46b544 1 parent 6882fe9
Phil-F Phil-F authored

Showing 1 changed file with 20 additions and 16 deletions. Show diff stats Hide diff stats

  1. +20 16 classes/pagination.php
36 classes/pagination.php
@@ -40,18 +40,22 @@ class Pagination
40 40 * @var array The HTML for the display
41 41 */
42 42 public static $template = array(
43   - 'wrapper_start' => '<div class="pagination"> ',
44   - 'wrapper_end' => ' </div>',
45   - 'page_start' => '<span class="page-links"> ',
46   - 'page_end' => ' </span>',
47   - 'previous_start' => '<span class="previous"> ',
48   - 'previous_end' => ' </span>',
49   - 'previous_mark' => '&laquo; ',
50   - 'next_start' => '<span class="next"> ',
51   - 'next_end' => ' </span>',
52   - 'next_mark' => ' &raquo;',
53   - 'active_start' => '<span class="active"> ',
54   - 'active_end' => ' </span>',
  43 + 'wrapper_start' => '<div class="pagination"> ',
  44 + 'wrapper_end' => ' </div>',
  45 + 'page_start' => '<span class="page-links"> ',
  46 + 'page_end' => ' </span>',
  47 + 'previous_start' => '<span class="previous"> ',
  48 + 'previous_end' => ' </span>',
  49 + 'previous_inactive_start' => ' <span class="previous-inactive">',
  50 + 'previous_inactive_end' => ' </span>',
  51 + 'previous_mark' => '&laquo; ',
  52 + 'next_start' => '<span class="next"> ',
  53 + 'next_end' => ' </span>',
  54 + 'next_inactive_start' => ' <span class="next-inactive">',
  55 + 'next_inactive_end' => ' </span>',
  56 + 'next_mark' => ' &raquo;',
  57 + 'active_start' => '<span class="active"> ',
  58 + 'active_end' => ' </span>',
55 59 );
56 60
57 61 /**
@@ -227,12 +231,12 @@ public static function next_link($value)
227 231
228 232 if (static::$current_page == static::$total_pages)
229 233 {
230   - return $value.static::$template['next_mark'];
  234 + return static::$template['next_inactive_start'].$value.static::$template['next_mark'].static::$template['next_inactive_end'];
231 235 }
232 236 else
233 237 {
234 238 $next_page = static::$current_page + 1;
235   - return \Html::anchor(rtrim(static::$pagination_url, '/').'/'.$next_page, $value.static::$template['next_mark']);
  239 + return static::$template['next_start'].\Html::anchor(rtrim(static::$pagination_url, '/').'/'.$next_page, $value.static::$template['next_mark']).static::$template['next_end'];
236 240 }
237 241 }
238 242
@@ -254,13 +258,13 @@ public static function prev_link($value)
254 258
255 259 if (static::$current_page == 1)
256 260 {
257   - return static::$template['previous_mark'].$value;
  261 + return static::$template['previous_inactive_start'].static::$template['previous_mark'].$value.static::$template['previous_inactive_end'];
258 262 }
259 263 else
260 264 {
261 265 $previous_page = static::$current_page - 1;
262 266 $previous_page = ($previous_page == 1) ? '' : '/'.$previous_page;
263   - return \Html::anchor(rtrim(static::$pagination_url, '/').$previous_page, static::$template['previous_mark'].$value);
  267 + return static::$template['previous_start'].\Html::anchor(rtrim(static::$pagination_url, '/').$previous_page, static::$template['previous_mark'].$value).static::$template['previous_end'];
264 268 }
265 269 }
266 270 }

0 comments on commit 005ea5a

Please sign in to comment.
Something went wrong with that request. Please try again.