1 views.theme.inc theme_views_mini_pager($variables)

File

core/modules/views/templates/views.theme.inc, line 1138
Preprocessors and helper functions to make theme development easier.

Code

function theme_views_mini_pager($variables) {
  global $pager_page_array, $pager_total;

  $tags = $variables['tags'];
  $element = $variables['element'];
  $parameters = $variables['parameters'];

  // Pager is only needed if there are results.
  if (!isset($pager_page_array[$element]) || empty($pager_total)) {
    return '';
  }

  // Current is the page we are currently paged to.
  $pager_current = $pager_page_array[$element] + 1;
  // Max is the maximum page number.
  $pager_max = $pager_total[$element];
  // End of marker calculations.

  if ($pager_total[$element] > 1) {
    $li_previous = theme('pager_previous', 
    array(
      'text' => isset($tags[1]) ? $tags[1] : t('‹‹'),
      'element' => $element,
      'interval' => 1,
      'parameters' => $parameters,
    )
    );

    $li_next = theme('pager_next', 
    array(
      'text' => isset($tags[3]) ? $tags[3] : t('››'),
      'element' => $element,
      'interval' => 1,
      'parameters' => $parameters,
    )
    );

    if ($li_previous) {
      $items[] = array(
        'class' => array('pager-previous'),
        'data' => $li_previous,
      );
    }
    $items[] = array(
      'class' => array('pager-current'),
      'data' => t('@current of @max', array('@current' => $pager_current, '@max' => $pager_max)),
    );

    if ($li_next) {
      $items[] = array(
        'class' => array('pager-next'),
        'data' => $li_next,
      );
    }

    return theme('item_list', 
    array(
      'items' => $items,
      'title' => NULL,
      'type' => 'ul',
      'attributes' => array('class' => array('pager')),
    )
    );
  }
}