function notifications_content_token_values in Notifications 6.2
Same name and namespace in other branches
- 5 notifications_content/notifications_content.module \notifications_content_token_values()
- 6.4 notifications_content/notifications_content.module \notifications_content_token_values()
- 6 notifications_content/notifications_content.module \notifications_content_token_values()
- 6.3 notifications_content/notifications_content.module \notifications_content_token_values()
Implementation of hook_token_values()
File
- notifications_content/
notifications_content.module, line 871 - Subscriptions to content events
Code
function notifications_content_token_values($type, $object = NULL, $options = array()) {
switch ($type) {
case 'node':
if ($node = $object) {
$values['node-teaser'] = !empty($node->teaser) ? check_markup($node->teaser, $node->format, FALSE) : '';
$values['node-body'] = !empty($node->body) ? check_markup($node->body, $node->format, FALSE) : '';
$values['node-teaser-raw'] = !empty($node->teaser) ? $node->teaser : '';
$values['node-body-raw'] = !empty($node->body) ? $node->body : '';
return $values;
}
break;
case 'comment':
if ($comment = (object) $object) {
$values['comment-url'] = url('node/' . $comment->nid, array(
'fragment' => 'comment-' . $comment->cid,
'absolute' => TRUE,
));
$values['comment-reply-url'] = url('comment/reply/' . $comment->nid . '/' . $comment->cid, array(
'absolute' => TRUE,
));
return $values;
}
break;
}
}