You are here

function theme_smart_paging_page_title_suffix in Smart Paging 7.2

Same name and namespace in other branches
  1. 7 smart_paging.module \theme_smart_paging_page_title_suffix()

Default theme for smart_paging_page_title_suffix.

2 theme calls to theme_smart_paging_page_title_suffix()
smart_paging_field_attach_view_alter in ./smart_paging.module
Implements hook_field_attach_view_alter().
smart_paging_preprocess_page in ./smart_paging.module
Implements MODULE_preprocess_page()

File

./smart_paging.module, line 1541
Provides smart paging capability to Drupal contents.

Code

function theme_smart_paging_page_title_suffix($variable) {
  static $title_suffix;
  static $set_title_done;
  if (isset($variable['page'])) {
    $page = $variable['page'];
    if (isset($page['suffix']) && isset($page['current_page']) && isset($page['total_page'])) {
      $title_suffix = t($page['suffix']) . ($page['current_page'] + 1) . t(' of ') . $page['total_page'];

      // $variable['bypass_drupal_set_title'] can be set at:
      // THEME_preprocess_smart_paging_page_title_suffix()
      // MODULE_preprocess_smart_paging_page_title_suffix()
      if (!$set_title_done && !isset($variable['bypass_drupal_set_title'])) {

        // Target head title (<title> tag)
        drupal_set_title(drupal_get_title() . check_plain($title_suffix), PASS_THROUGH);
        $set_title_done = TRUE;
      }
    }
  }
  if (!isset($variable['bypass_drupal_set_title'])) {
    return $title_suffix;
  }
  else {
    return '';
  }
}