From f522643d7032bdd2f97dc132ac49f201d72e2672 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 24 Dec 2009 01:47:00 -0800 Subject: [PATCH] Clean up tag display logic. --- modules/rwinfo/helpers/rwinfo_theme.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/rwinfo/helpers/rwinfo_theme.php b/modules/rwinfo/helpers/rwinfo_theme.php index 6c3574be..83c890dd 100644 --- a/modules/rwinfo/helpers/rwinfo_theme.php +++ b/modules/rwinfo/helpers/rwinfo_theme.php @@ -28,21 +28,18 @@ class rwinfo_theme_Core { // rWatcher Edit: Display Tags if (module::is_active("tag")) { - $tagsItem = ORM::factory("tag") + $tags = ORM::factory("tag") ->join("items_tags", "tags.id", "items_tags.tag_id") ->where("items_tags.item_id", "=", $item->id) ->find_all(); - if (count($tagsItem) > 0) { + if (count($tags) > 0) { $results .= "
  • "; $results .= t("Tags:") . " "; - for ($counter=0; $counter" . html::clean($tagsItem[$counter]->name) . ", "; - } else { - $results .= "" . html::clean($tagsItem[$counter]->name) . ""; - } + $anchors = array(); + foreach ($tags as $tag) { + $anchors[] = "id}") . ">" . html::clean($tag->name) . ""; } - $results .= "
  • "; + $results .= join(", ", $anchors) . ""; } } // rWatcher End Edit