function theme_glossary_block_term in Glossary 5.2
Same name and namespace in other branches
- 6 glossary.module \theme_glossary_block_term()
- 7 glossary.module \theme_glossary_block_term()
1 theme call to theme_glossary_block_term()
- glossary_block in ./
glossary.module - Implementation of hook_block().
File
- ./
glossary.module, line 987 - Glossary terms will be automatically marked with links to their descriptions.
Code
function theme_glossary_block_term($term, $link = TRUE) {
global $base_url;
static $click_option, $link_related, $one_way, $tax_img_avail;
if (!isset($click_option)) {
$click_option = variable_get('glossary_click_option', 0);
$link_related = variable_get('glossary_link_related', TRUE);
$one_way = variable_get('glossary_link_related_how', FALSE);
$tax_img_avail = module_exists('taxonomy_image');
}
if ($tax_img_avail) {
$img = taxonomy_image_display($term->tid);
if ($img) {
$obj = taxonomy_image_get_object($term->tid);
$img = '<a href="' . $obj->url . '">' . $img . '</a>';
}
}
else {
$img = NULL;
}
$output .= '<div class="glossary-block-term-name">';
$output .= $link ? l($term->name, 'glossary/term/' . $term->tid) : check_plain($term->name);
$output .= "</div>\n";
$output .= '<div class="glossary-block-term-description">';
$output .= $term->description ? check_markup($term->description) : NULL;
$output .= "</div>\n";
if ($relations = glossary_get_related($term->tid, 'name', $one_way)) {
$output .= '<span class="glossary-related">' . t('See also') . ': ';
$items = array();
foreach ($relations as $related) {
if ($link_related) {
if ($click_option == 1) {
$items[] .= l($related->name, 'glossary/' . $term->vid, array(
'fragment' => 'term' . $related->tid,
));
}
else {
$items[] .= l($related->name, 'glossary/term/' . $related->tid);
}
}
else {
$items[] .= check_plain($related->name);
}
}
$output .= implode(', ', $items) . "</span>\n";
}
if ($term->synonyms) {
$output .= '<span class="glossary-synonyms"><strong>' . t('Synonyms') . '</strong>: ';
$output .= implode(', ', $term->synonyms) . "</span>\n";
}
// return htmlspecialchars_decode($output);
return decode_entities($output);
}