You are here

function theme_advanced_forum_topic_pager in Advanced Forum 6.2

Theme function to return assembled pager for use on each topic in list.

Parameters

$pagecount: Number of pages to include on the pager.

$topic: Topic object to create a pager for.

Return value

Assembled pager.

1 theme call to theme_advanced_forum_topic_pager()
advanced_forum_handler_field_node_topic_pager::render in includes/views/advanced_forum_handler_field_node_topic_pager.inc

File

includes/theme.inc, line 118
Holds theme functions and template preprocesses. Other style related functions are in style.inc

Code

function theme_advanced_forum_topic_pager($pagecount, $topic) {

  // Get the information to assemble the pager. This returns an object with
  // the following properties:
  //  initial_pages: Array of linked numbers for first set of pages
  //  last_page_text: Linked text "Last page" (translatable)
  //  last_page_number: Linked number pointing to the last page.
  $topic_pager = advanced_forum_create_topic_pager($pagecount, $topic);
  $last_page = '';
  if (!empty($topic_pager->initial_pages)) {
    if (!empty($topic_pager->last_page_text)) {

      // If you prefer to end with the number, replace
      // $topic_pager->last_page_text with $topic_pager->last_page_number
      $last_page = ' … ' . $topic_pager->last_page_text;
    }
    return '<span class="topic-pager">(' . t('Page') . ': ' . implode(", ", $topic_pager->initial_pages) . $last_page . ')</span>';
  }
}