| 1 |
<?php |
<?php |
| 2 |
// $Id: taxonomy_context.module,v 1.72.2.7.2.6 2009/02/21 14:51:05 nancyw Exp $ |
// $Id: taxonomy_context.module,v 1.72.2.7.2.7 2009/02/26 18:10:56 nancyw Exp $ |
| 3 |
/** |
/** |
| 4 |
* @file |
* @file |
| 5 |
* Create a block as a hierarchical menu tree for each vocabulary. |
* Create a block as a hierarchical menu tree for each vocabulary. |
| 467 |
$subterm_output .= theme('taxonomy_context_subterm', $subterm, TRUE); |
$subterm_output .= theme('taxonomy_context_subterm', $subterm, TRUE); |
| 468 |
break; |
break; |
| 469 |
} |
} |
| 470 |
|
if (module_exists('taxonomy_image')) { |
| 471 |
|
$subterm_output .= l(taxonomy_image_display($subterm->tid), taxonomy_term_path($subterm), null, null, null, null, true); |
| 472 |
|
} |
| 473 |
} |
} |
| 474 |
} |
} |
| 475 |
} |
} |
| 487 |
$term_output .= theme('taxonomy_context_term', $term, FALSE, $subterm_output, $subterm_display); |
$term_output .= theme('taxonomy_context_term', $term, FALSE, $subterm_output, $subterm_display); |
| 488 |
break; |
break; |
| 489 |
} |
} |
| 490 |
|
if (module_exists('taxonomy_image')) { |
| 491 |
|
$term_output .= l(taxonomy_image_display($term->tid), taxonomy_term_path($subterm), null, null, null, null, true); |
| 492 |
|
} |
| 493 |
|
|
| 494 |
|
|
| 495 |
return theme('taxonomy_context_term_page', $term_output); |
return theme('taxonomy_context_term_page', $term_output); |
| 496 |
} |
} |
| 739 |
break; |
break; |
| 740 |
case 'term': |
case 'term': |
| 741 |
$term = taxonomy_get_term($id); |
$term = taxonomy_get_term($id); |
| 742 |
|
if (module_exists('taxonomy_image')) { |
| 743 |
|
$term->image = l(taxonomy_image_display($term->tid), taxonomy_term_path($subterm), null, null, null, null, true); |
| 744 |
|
} |
| 745 |
|
else { |
| 746 |
|
$term->image = NULL; |
| 747 |
|
} |
| 748 |
$item = array('title' => $term->name, 'path' => taxonomy_term_path($term), 'description' => $term->description ? strip_tags(node_teaser($term->description)) : t('View this section')); |
$item = array('title' => $term->name, 'path' => taxonomy_term_path($term), 'description' => $term->description ? strip_tags(node_teaser($term->description)) : t('View this section')); |
| 749 |
break; |
break; |
| 750 |
} |
} |
| 751 |
|
|
| 752 |
if ($theme) return theme('menu_item_link', $item, $item); |
if ($theme) { |
| 753 |
else return array( |
return theme('menu_item_link', $item, $item); |
| 754 |
'title' => $item['title'], |
} |
| 755 |
'href' => $item['path'], |
else { |
| 756 |
'attributes' => ! empty($item['description']) ? array('title' => $item['description']) : array(), |
return array( |
| 757 |
); |
'title' => $item['title'], |
| 758 |
|
'href' => $item['path'], |
| 759 |
|
'attributes' => !empty($item['description']) ? array('title' => $item['description']) : array(), |
| 760 |
|
); |
| 761 |
|
} |
| 762 |
} |
} |
| 763 |
|
|
| 764 |
|
|