### Eclipse Workspace Patch 1.0 #P tagadelic Index: tagadelic.module =================================================================== RCS file: /cvs/drupal/contributions/modules/tagadelic/tagadelic.module,v retrieving revision 1.48 diff -u -r1.48 tagadelic.module --- tagadelic.module 14 Sep 2009 19:32:04 -0000 1.48 +++ tagadelic.module 3 Jan 2011 17:37:11 -0000 @@ -41,7 +41,8 @@ 'type' => MENU_SUGGESTED_ITEM, ); $items['tagadelic/list/%tagadelic_vocs'] = array( - 'title' => 'Tags', + 'title callback' => 'tagadelic_page_title_callback', + 'title arguments' => array(2), 'page callback' => 'tagadelic_page_list', 'page arguments' => array(2), 'access callback' => 'user_access', @@ -49,7 +50,8 @@ 'type' => MENU_CALLBACK, ); $items['tagadelic/chunk/%tagadelic_vocs'] = array( - 'title' => 'Tags', + 'title callback' => 'tagadelic_page_title_callback', + 'title arguments' => array(2), 'page callback' => 'tagadelic_page_chunk', 'page arguments' => array(2), 'access callback' => 'user_access', @@ -112,6 +114,36 @@ } /** +* menu callback to render the tagadelic title +* @param $vocs. an array of taxonomy vocabulary IDs +*/ +function tagadelic_page_title_callback($vocs) { + $title = ''; + + if (empty($vocs)) { + $title = t('Tags'); + } + else { + $title = t('Tags in @vocabularies', array('@vocabularies' => theme('tagadelic_list_vocs', $vocs))); + } + + return $title; +} + +/** + * theme function that creates a comma separted list of vocubulary terms + * @params $vocs. an array of taxonomy vocabulary ids + * @ingroup themable + */ +function theme_tagadelic_list_vocs($vocs) { + foreach ($vocs as $vid) { + $vocabulary = taxonomy_vocabulary_load($vid); + $voc_names[] = $vocabulary->name; + } + return join(', ', $voc_names); +} + +/** * menu callback renders a tagadelic page */ function tagadelic_page_chunk($vocs) { @@ -408,7 +440,8 @@ return array( 'tagadelic_list_box' => array('arguments' => array('vocabulary' => NULL, 'tags' => NULL)), 'tagadelic_more' => array('arguments' => array('vid' => NULL)), - 'tagadelic_weighted' => array('arguments' => array('terms' => NULL)) + 'tagadelic_weighted' => array('arguments' => array('terms' => NULL)), + 'tagadelic_list_vocs' => array('arguments' => array('vid' => NULL)) ); }