From 2e5d4a59b119fecce4f647eaa49565b024678cf9 Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Tue, 4 Jan 2011 19:52:25 -0700 Subject: Display an item's tags in the info block. --- modules/tag/helpers/tag_event.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'modules/tag/helpers') diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 829089c4..78fe7058 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -147,4 +147,20 @@ class tag_event_Core { } } } + + 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; + } + } + } -- cgit v1.2.3 From 06d94065ce0919f34151da05b32642a95397044f Mon Sep 17 00:00:00 2001 From: Chad Kieffer Date: Thu, 6 Jan 2011 21:03:19 -0700 Subject: Updates per Bharat's pull request review. Renamed info_block_metadata event to info_block_get_metadata. --- modules/info/helpers/info_block.php | 2 +- modules/info/views/info_block.html.php | 4 ++-- modules/tag/helpers/tag_event.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/tag/helpers') diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php index 5841ec6f..9596bc41 100644 --- a/modules/info/helpers/info_block.php +++ b/modules/info/helpers/info_block.php @@ -71,7 +71,7 @@ class info_block_Core { } $block->content->metadata = $info; - module::event("info_block_metadata", $block, $theme->item); + module::event("info_block_get_metadata", $block, $theme->item); } break; } diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php index 7c162767..b296fa1d 100644 --- a/modules/info/views/info_block.html.php +++ b/modules/info/views/info_block.html.php @@ -1,8 +1,8 @@ diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 78fe7058..6b8de723 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -148,12 +148,12 @@ class tag_event_Core { } } - static function info_block_metadata($block, $item) { + static function info_block_get_metadata($block, $item) { $tags = array(); foreach (tag::item_tags($item) as $tag) { - $tags[] = "name}") . "\">$tag->name"; + $tags[] = "name}") . "\">{$tag->name}"; } - if (count($tags)) { + if ($tags) { $info = $block->content->metadata; $info["tags"] = array( "label" => t("Tags:"), -- cgit v1.2.3