You are here

function biblio_token_values in Bibliography Module 5

Same name and namespace in other branches
  1. 6.2 biblio.module \biblio_token_values()
  2. 6 biblio.module \biblio_token_values()

Implementation of hook_token_values() for og specific tokens

File

./biblio.module, line 3905

Code

function biblio_token_values($type, $object = NULL) {
  switch ($type) {
    case 'node':
      if ($object->type == "biblio") {
        $type = db_result(db_query('SELECT name FROM {biblio_types} as t WHERE t.tid = %d', $object->biblio_type));

        #$title = db_result(db_query("SELECT title FROM {node} WHERE nid = %d", $gid));
        $values['biblio_year'] = check_plain($object->biblio_year);
        $values['biblio_authors'] = check_plain($object->biblio_authors);
        $values['biblio_type_id'] = check_plain($object->biblio_type);
        $values['biblio_type'] = check_plain($type);
        return $values;
      }
      break;
  }

  // No group info found. Return defaults.
  $values['biblio_year'] = '';
  $values['biblio_authors'] = '';
  $values['biblio_type'] = '';
  return $values;
}