4.6.x pager.inc theme_pager_next($text, $limit, $element = 0, $interval = 1, $attributes = array())
4.7.x pager.inc theme_pager_next($text, $limit, $element = 0, $interval = 1, $parameters = array())
5.x pager.inc theme_pager_next($text, $limit, $element = 0, $interval = 1, $parameters = array())
6.x pager.inc theme_pager_next($text, $limit, $element = 0, $interval = 1, $parameters = array())
7.x pager.inc theme_pager_next($variables)

Returns HTML for the "next page" link in a query pager.

Parameters

$variables: An associative array containing:

  • text: The name (or image) of the link.
  • element: An optional integer to distinguish between multiple pagers on one page.
  • interval: The number of pages to move forward when the link is clicked.
  • parameters: An associative array of query string parameters to append to the pager links.

Related topics

1 theme call to theme_pager_next()
theme_pager in includes/pager.inc
Returns HTML for a query pager.

File

includes/pager.inc, line 519
Functions to aid in presenting database results as a set of pages.

Code

function theme_pager_next($variables) {
  $text = $variables['text'];
  $element = $variables['element'];
  $interval = $variables['interval'];
  $parameters = $variables['parameters'];
  global $pager_page_array, $pager_total;
  $output = '';

  // If we are anywhere but the last page
  if ($pager_page_array[$element] < $pager_total[$element] - 1) {
    $page_new = pager_load_array($pager_page_array[$element] + $interval, $element, $pager_page_array);

    // If the next page is the last page, mark the link as such.
    if ($page_new[$element] == $pager_total[$element] - 1) {
      $output = theme('pager_last', array(
        'text' => $text,
        'element' => $element,
        'parameters' => $parameters,
      ));
    }
    else {
      $output = theme('pager_link', array(
        'text' => $text,
        'page_new' => $page_new,
        'element' => $element,
        'parameters' => $parameters,
      ));
    }
  }
  return $output;
}

Comments

Chi’s picture

text: The name (or image) of the link.

What about image? It looks as there is no way to put image in the link.

bloke_zero’s picture

If you use your own theme function for theme_pager_link you can remove `check_plain` on the $text variable which is what was stripping out my Font Awesome icon tags.

BrianLewisDesign’s picture

use css background image:

ul.pager li.pager-next a {
display: inline-block;
padding: 6px 6px 6px 30px;
background: url(../images/arrow.png) 0 0 no-repeat;
}