From c427c5475fb0a446c8e49163d85f6ab1e516fc06 Mon Sep 17 00:00:00 2001
From: caprenter <caprenter@googlemail.com>
Date: Wed, 29 Sep 2010 11:12:41 +0100
Subject: [PATCH] This works on the issue at http://drupal.org/node/346312 to get vocabulary titles into the page title for 'chunks' displayed by Tagadelic

---
 tagadelic.module |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/tagadelic.module b/tagadelic.module
index f2dcf79..332a52e 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_title_callback',
+    'title arguments' => array(2),
     'page callback' => 'tagadelic_page_chunk',
     'page arguments' => array(2),
     'access callback' => 'user_access',
@@ -112,6 +114,27 @@ function tagadelic_vocs_load($vocs) {
 }
 
 /**
+* menu callback to render the tagadelic title
+*
+* Args:
+* @param $vocs. An array of vocabulary IDs
+*/
+function tagadelic_page_title_callback($vocs) {
+
+  if ($vocs == NULL) {
+    return 'Tags';
+  }
+
+  foreach ($vocs as $vid) {
+    $vocabulary = taxonomy_vocabulary_load($vid);
+    $vocs_list .= t(', @voc_name', array('@voc_name' => $vocabulary->name));
+  }
+
+  // remove leading comma!
+  return "Tags in" . substr($vocs_list, 1);
+}
+
+/**
  * menu callback renders a tagadelic page
  */
 function tagadelic_page_chunk($vocs) {
-- 
1.7.0.4

