function glossary_overview in Glossary 7
Same name and namespace in other branches
- 5.2 glossary.module \glossary_overview()
- 5 glossary.module \glossary_overview()
- 6 glossary.module \glossary_overview()
Produce the Glossary overview.
1 call to glossary_overview()
- glossary_page in ./
glossary.module - Main glossary page function.
File
- ./
glossary.module, line 773 - Glossary terms will be automatically marked with links to their descriptions.
Code
function glossary_overview($vocab, $letter = NULL) {
$dest = drupal_get_destination();
$output = '<div id="' . drupal_clean_css_identifier(drupal_strtolower($vocab->name)) . '">';
if ($vocab->description) {
$output .= '<p class="glossary-description">' . filter_xss_admin($vocab->description) . '</p>';
}
$vid = $vocab->vid;
if ($letter) {
$letter = drupal_substr($letter, 6, 1, 'UTF-8');
drupal_set_title(t('Glossary beginning with @let', array(
'@let' => drupal_strtoupper($letter),
)));
}
$current_let = '';
$no_overview = variable_get('glossary_click_option', 0) == 0 && variable_get('glossary_page_per_letter', FALSE) == TRUE;
$show_desc = variable_get('glossary_show_description', FALSE);
$separate = variable_get('glossary_separate_letters', FALSE);
$tree = taxonomy_get_tree($vid);
$output .= _glossary_alphabar($vid, $tree);
$output .= '<div class="glossary-list"><dl>' . "\n";
if ($tree) {
foreach ($tree as $term) {
// See if it's a new section.
// If we're looking for a single letter, see if this is it.
if (!$no_overview && !$letter || $term->let == $letter) {
// See if it's a new section.
if ($term->let != $current_let) {
$output .= "\n" . '<a id="letter' . $term->let . '"></a>';
if ($separate) {
$output .= '<div class="glossary-letter">' . $term->let . '</div>';
}
$current_let = $term->let;
}
$output .= theme('glossary_overview_item', array(
'term' => $term,
'show_desc' => $show_desc,
'dest' => $dest,
));
}
}
if ($current_let != '') {
$output .= '</dl>';
}
}
$output .= '</dl></div></div>';
return glossary_admin_links($vocab, $dest) . $output;
}