function theme_pager_link

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 pager.inc theme_pager_link($variables)
cle7 pager.inc theme_pager_link($variables)
elmsmedia7 pager.inc theme_pager_link($variables)
icor7 pager.inc theme_pager_link($variables)
meedjum_blog7 pager.inc theme_pager_link($variables)
mooc7 pager.inc theme_pager_link($variables)

Returns HTML for a link to a specific query result page.

Parameters

$variables: An associative array containing:

  • text: The link text. Also used to figure out the title attribute of the link, if it is not provided in $variables['attributes']['title']; in this case, $variables['text'] must be one of the standard pager link text strings that would be generated by the pager theme functions, such as a number or t('« first').
  • page_new: The first result to display on the linked page.
  • element: An optional integer to distinguish between multiple pagers on one page.
  • parameters: An associative array of query string parameters to append to the pager link.
  • attributes: An associative array of HTML attributes to apply to the pager link.

See also

theme_pager()

Related topics

8 theme calls to theme_pager_link()
aurora_pager_first in sites/all/themes/ulmus/aurora/includes/pager.inc
Returns HTML for the "first page" link in a query pager.
aurora_pager_last in sites/all/themes/ulmus/aurora/includes/pager.inc
Returns HTML for the "last page" link in query pager.
aurora_pager_next in sites/all/themes/ulmus/aurora/includes/pager.inc
Returns HTML for the "next page" link in a query pager.
aurora_pager_previous in sites/all/themes/ulmus/aurora/includes/pager.inc
Returns HTML for the "previous page" link in a query pager.
theme_pager_first in includes/pager.inc
Returns HTML for the "first page" link in a query pager.

... See full list

9 string references to the theme hook from theme_pager_link()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

aurora_pager_first in sites/all/themes/ulmus/aurora/includes/pager.inc
Returns HTML for the "first page" link in a query pager.
aurora_pager_last in sites/all/themes/ulmus/aurora/includes/pager.inc
Returns HTML for the "last page" link in query pager.
aurora_pager_next in sites/all/themes/ulmus/aurora/includes/pager.inc
Returns HTML for the "next page" link in a query pager.
aurora_pager_previous in sites/all/themes/ulmus/aurora/includes/pager.inc
Returns HTML for the "previous page" link in a query pager.
drupal_common_theme in includes/common.inc
Provides theme registration for themes across .inc files.

... See full list

File

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

Code

function theme_pager_link($variables) {
  $text = $variables['text'];
  $page_new = $variables['page_new'];
  $element = $variables['element'];
  $parameters = $variables['parameters'];
  $attributes = $variables['attributes'];

  $page = isset($_GET['page']) ? $_GET['page'] : '';
  if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) {
    $parameters['page'] = $new_page;
  }

  $query = array();
  if (count($parameters)) {
    $query = drupal_get_query_parameters($parameters, array());
  }
  if ($query_pager = pager_get_query_parameters()) {
    $query = array_merge($query, $query_pager);
  }

  // Set each pager link title
  if (!isset($attributes['title'])) {
    static $titles = NULL;
    if (!isset($titles)) {
      $titles = array(
        t('« first') => t('Go to first page'),
        t('‹ previous') => t('Go to previous page'),
        t('next ›') => t('Go to next page'),
        t('last »') => t('Go to last page'),
      );
    }
    if (isset($titles[$text])) {
      $attributes['title'] = $titles[$text];
    }
    elseif (is_numeric($text)) {
      $attributes['title'] = t('Go to page @number', array('@number' => $text));
    }
  }

  // @todo l() cannot be used here, since it adds an 'active' class based on the
  //   path only (which is always the current path for pager links). Apparently,
  //   none of the pager links is active at any time - but it should still be
  //   possible to use l() here.
  // @see http://drupal.org/node/1410574
  $attributes['href'] = url($_GET['q'], array('query' => $query));
  return '<a' . drupal_attributes($attributes) . '>' . check_plain($text) . '</a>';
}