You are here

function biblio_token_values in Bibliography Module 6

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

Implementation of hook_token_values() for og specific tokens

File

./biblio.module, line 2356

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_contributors[1][0][lastname]);
        $values['biblio_type_id'] = check_plain($object->biblio_type);
        $values['biblio_type'] = check_plain($type);
        $values['biblio_citekey'] = check_plain($object->biblio_citekey);
        return $values;
      }
      break;
  }

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