function variable_tokens in Variable 6
Same name and namespace in other branches
- 7.2 variable.tokens.inc \variable_tokens()
- 7 variable.tokens.inc \variable_tokens()
Implements hook_tokens().
File
- ./
variable.tokens.inc, line 38 - Builds placeholder replacement tokens system-wide data.
Code
function variable_tokens($type, $tokens, array $data = array(), array $options = array()) {
$replacements = array();
if ($type == 'variable') {
foreach ($tokens as $name => $original) {
$variable = variable_info($name, $options);
if ($variable && !empty($variable['token'])) {
$replacements[$original] = variable_format_value($variable, $options);
}
}
}
return $replacements;
}