You are here

function favorite_nodesactivity_token_values in Activity 6

Same name and namespace in other branches
  1. 5.4 contrib/favorite_nodesactivity/favorite_nodesactivity.module \favorite_nodesactivity_token_values()

Token module integration. Defines available default token values.

File

contrib/favorite_nodesactivity/favorite_nodesactivity.module, line 64

Code

function favorite_nodesactivity_token_values($type, $data = NULL, $options = array()) {
  global $user;
  if ($type == 'favorite_nodesactivity' && !empty($data)) {
    $data['possessive'] = $user->uid == $data['uid'] ? t('your') : t('their');
    $data['favorites-link'] = l(t('favorites'), 'user/' . $data['uid'] . '/favorites');
    $data['node-type'] = theme('activity_node_type', $data['node-type']);
    $data['node-link'] = l($data['node-title'], 'node/' . $data['node-id']);
    return $data;
  }
}