You are here

function api_tokens_page_format_cache in API Tokens 7

Renders cache cell.

1 call to api_tokens_page_format_cache()
api_tokens_page_build_row in includes/api_tokens.admin.inc
Builds token list table row.

File

includes/api_tokens.admin.inc, line 38
Administrative interface for the API Tokens module.

Code

function api_tokens_page_format_cache($token) {
  $cache = $token['cache'];
  $content = array();

  // Token is cacheable.
  if (DRUPAL_NO_CACHE != $cache) {
    DRUPAL_CACHE_PER_ROLE & $cache && ($content[] = t('Per user role'));
    DRUPAL_CACHE_PER_USER & $cache && ($content[] = t('Per user'));
    DRUPAL_CACHE_PER_PAGE & $cache && ($content[] = t('Per page'));
    DRUPAL_CACHE_GLOBAL & $cache && !$content && ($content[] = t('Global'));
  }
  else {
    $content[] = '<em>' . t('No caching') . '</em>';
  }
  return implode('<br/>', $content);
}