You are here

function smart_paging_tokens in Smart Paging 7.2

Same name and namespace in other branches
  1. 7 smart_paging.tokens.inc \smart_paging_tokens()

Implements hook_tokens().

File

./smart_paging.tokens.inc, line 28

Code

function smart_paging_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $replacements = array();
  if ($type == 'smart-paging') {
    foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'page-number':
          $replacements[$original] = pager_find_page(1) + 1;
          break;
      }
    }
  }
  return $replacements;
}