You are here

function og_activity_token_values in Heartbeat 6.3

Same name and namespace in other branches
  1. 6.4 modules/og_activity/og_activity.module \og_activity_token_values()

Implementation of hook_token_values().

File

modules/og_activity/og_activity.module, line 111

Code

function og_activity_token_values($type, $object = NULL, $options = array()) {
  switch ($type) {
    case 'node':
      if (is_array($object->og_groups)) {
        $gids = array_filter($object->og_groups);
        $gid = $gids[0];
        $title = db_result(db_query("SELECT title FROM {node} WHERE nid = %d", $gid));
        $values['ogname-title-link'] = l(check_plain($title), 'node/' . $gid);
      }
      else {

        // No group info found. Return defaults.
        // $values['ogname-title-link'] = '';
      }
      break;
  }
  return $values;
}