function token_include in Token 5
Same name and namespace in other branches
- 6 token.module \token_include()
General function to include the files that token relies on for the real work.
4 calls to token_include()
- theme_token_help in ./
token.module - For a given context, builds a formatted list of tokens and descriptions of their replacement values.
- token_find_duplicate_tokens in ./
token.module - Find tokens that have been declared twice by different modules.
- token_get_list in ./
token.module - A helper function that retrieves all currently exposed tokens, and merges them recursively. This is only necessary when building the token listing -- during actual value replacement, only tokens in a particular domain are requested and a normal…
- token_get_values in ./
token.module - Return a list of valid substitution tokens and their values for the specified type.
File
- ./
token.module, line 169 - The Token API module.
Code
function token_include() {
static $run = FALSE;
if (!$run) {
$run = TRUE;
$path = drupal_get_path('module', 'token');
$modules_enabled = array_keys(module_list());
$modules = array(
'node',
'user',
'taxonomy',
'comment',
'content',
);
$modules = array_intersect($modules, $modules_enabled);
foreach ($modules as $module) {
if ($module == 'content') {
$module = 'cck';
}
require_once "{$path}/token_{$module}.inc";
}
}
}