You are here

function glossary_term in Glossary 7

Same name and namespace in other branches
  1. 5.2 glossary.module \glossary_term()
  2. 5 glossary.module \glossary_term()
  3. 6 glossary.module \glossary_term()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 string reference to 'glossary_term'
glossary_menu in ./glossary.module
Implements hook_menu().

File

./glossary.module, line 268
Glossary terms will be automatically marked with links to their descriptions.

Code

function glossary_term($tid) {
  $output = NULL;
  $result = db_select('taxonomy_term_data', 't')
    ->fields('t', array(
    'vid',
    'tid',
  ))
    ->condition('tid', $tid)
    ->addTag('term_access')
    ->execute();
  $output .= '<div class="glossary-list">' . "\n";
  foreach ($result as $row) {
    $term = taxonomy_term_load($row->tid);
    drupal_set_title($term->name);
    $output .= '<dl>' . theme('glossary_overview_item', array(
      'term' => $term,
      'show_desc' => TRUE,
    )) . '</dl>';
    $vid = $row->vid;
  }
  $output .= "</div>\n";
  $tree = taxonomy_get_tree($vid);
  $alphabar = _glossary_alphabar($vid, $tree);
  $output = $alphabar . '<br/>' . $output;
  return $output;
}