function notifications_content_token_values in Notifications 6
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.2 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 783 - 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'] = $node->teaser ? check_markup($node->teaser, $node->format, FALSE) : '';
$values['node-body'] = $node->body ? check_markup($node->body, $node->format, FALSE) : '';
$values['node-url'] = url('node/' . $node->nid, array(
'absolute' => TRUE,
));
$values['node-teaser-raw'] = $node->teaser ? $node->teaser : '';
$values['node-body-raw'] = $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;
}
}