You are here

function api_tokens_collect_tokens in API Tokens 7

Collects information on all the tokens in the system.

2 calls to api_tokens_collect_tokens()
api_tokens_page_list in includes/api_tokens.admin.inc
Renders token list page.
api_tokens_render in ./api_tokens.module
Processes API tokens.
2 string references to 'api_tokens_collect_tokens'
api_tokens_param_info in ./api_tokens.module
Returns parameters info of the token process function.
api_tokens_prepare_handler in ./api_tokens.module
Prepares token process function.

File

./api_tokens.module, line 79
The API Tokens module

Code

function api_tokens_collect_tokens() {
  $tokens =& drupal_static(__FUNCTION__, FALSE);
  if (!$tokens) {
    $tokens = array();
    $modules = module_implements('api_tokens_info');
    foreach ($modules as $module) {
      $module_tokens = module_invoke($module, 'api_tokens_info');
      foreach ($module_tokens as $token => &$token_info) {
        api_tokens_populate_defaults($token, $token_info, $module);
      }
      $tokens = array_merge($tokens, $module_tokens);
    }

    // Alter token definitions.
    drupal_alter('api_tokens_info', $tokens);
  }
  return $tokens;
}