function notifications_content_tokens in Notifications 7
Implements hook_tokens().
File
- notifications_content/
notifications_content.module, line 478 - Subscriptions to content events
Code
function notifications_content_tokens($type, $tokens, array $data = array(), array $options = array()) {
if ($type == 'node_type' && !empty($data['node_type'])) {
$replacements = array();
$sanitize = !empty($options['sanitize']);
foreach ($tokens as $name => $original) {
switch ($name) {
case 'name':
$replacements[$original] = $sanitize ? check_plain($data['node_type']->name) : $data['node_type']->name;
break;
}
}
return $replacements;
}
}