function block_token_token_info in Block Token 7
Same name and namespace in other branches
- 8 block_token.module \block_token_token_info()
Implements hook_token_info().
File
- ./
block_token.module, line 113 - The file contains Block Token module code.
Code
function block_token_token_info() {
$tokens = array();
$blocks = block_token_blocks();
foreach ($blocks as $token => $block) {
$name = t('Block from module %module with delta %delta', array(
'%module' => $block->module,
'%delta' => $block->delta,
));
$tokens[$token] = array(
'name' => $name,
'description' => $name,
);
}
return array(
'types' => array(
'block_token' => array(
'name' => t("Block Token"),
'description' => t("Tokens containing blocks."),
),
),
'tokens' => array(
'block_token' => $tokens,
),
);
}