You are here

function og_activity_token_values in Heartbeat 6.4

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

Implementation of hook_token_values().

File

modules/og_activity/og_activity.module, line 98

Code

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