From 2e5d4a59b119fecce4f647eaa49565b024678cf9 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Tue, 4 Jan 2011 19:52:25 -0700 Subject: [PATCH] Display an item's tags in the info block. --- modules/tag/helpers/tag_event.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 829089c473..78fe705855 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -147,4 +147,20 @@ static function add_photos_form_completed($album, $form) { } } } + + static function info_block_metadata($block, $item) { + $tags = array(); + foreach (tag::item_tags($item) as $tag) { + $tags[] = "name}") . "\">$tag->name"; + } + if (count($tags)) { + $info = $block->content->metadata; + $info["tags"] = array( + "label" => t("Tags:"), + "value" => implode(", ", $tags) + ); + $block->content->metadata = $info; + } + } + }