tagadelic.module | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/tagadelic.module b/tagadelic.module index 9aee951..05323c2 100644 --- a/tagadelic.module +++ b/tagadelic.module @@ -50,6 +50,8 @@ function tagadelic_menu() { ); $items['tagadelic/chunk/%tagadelic_vocs'] = array( 'title' => 'Tags', + 'title callback' => 'tagadelic_page_chunk_title', + 'title arguments' => array(2), 'page callback' => 'tagadelic_page_chunk', 'page arguments' => array(2), 'access callback' => 'user_access', @@ -397,3 +399,24 @@ function tagadelic_theme() { 'tagadelic_weighted' => array('arguments' => array('terms' => NULL)) ); } + +/** + * menu callback to render the tagadelic title + * + * Args: + * $vocs: array of vocabulary IDs + */ +function tagadelic_page_chunk_title($vocs) { + if ($vocs == NULL) { + return t('Tags'); + } + + foreach ($vocs as $vid) { + $vocabulary = taxonomy_vocabulary_load( $vid ); + $vocs_list .= t( ', @voc_name', array( '@voc_name' => $vocabulary->name )); + } + + // remove leading comma! + return t("Tags in") . drupal_substr( $vocs_list, 1); +} +