function heartbeat_token_info in Heartbeat 7
Implements hook_token_info().
File
- modules/
heartbeat_rules/ heartbeat_rules.module, line 27 - Rules integration. Event/trigger as well as the heartbeat actions.
Code
function heartbeat_token_info() {
$type = array(
'name' => t('Heartbeat activity'),
'description' => t('Tokens related to individual heartbeat activity messages.'),
'needs-data' => 'heartbeat_activity',
);
// Core tokens for nodes.
$node['link'] = array(
'name' => t("Content name with a link to it"),
'description' => t('The node with a link to it.'),
);
// Core tokens for nodes.
$user['link'] = array(
'name' => t("Username with a link to it"),
'description' => t('The user with a link to it.'),
);
// Heartbeat tokens.
$heartbeat_activity['actor-link'] = array(
'name' => t("Actor username with a link to it"),
'description' => t('The acting user with a link to it.'),
);
return array(
'types' => array(
'heartbeat_activity' => $type,
),
'tokens' => array(
'node' => $node,
'user' => $user,
'heartbeat_activity' => $heartbeat_activity,
),
);
}