diff options
| author | colings <colings@example.com> | 2011-01-09 11:43:45 -0600 |
|---|---|---|
| committer | colings <colings@example.com> | 2011-01-09 11:43:45 -0600 |
| commit | 02a349f68ac480d5b1a630e14b4f2e3558328673 (patch) | |
| tree | 25bf25960b6811d8dbcbed6f6c9d63de7c03bd4e /modules/tag/helpers | |
| parent | c2a1ea64eda2bf3e22ecaf4df4714c091bc5d7c4 (diff) | |
| parent | de5b06ae7442db2c7a8999c0c806997248ddb151 (diff) | |
Merge remote branch 'upstream/master'
Diffstat (limited to 'modules/tag/helpers')
| -rw-r--r-- | modules/tag/helpers/tag.php | 2 | ||||
| -rw-r--r-- | modules/tag/helpers/tag_event.php | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index bcd3b0c0..7d5c643a 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -36,11 +36,9 @@ class tag_Core { $tag = ORM::factory("tag")->where("name", "=", $tag_name)->find(); if (!$tag->loaded()) { $tag->name = $tag_name; - $tag->count = 0; } $tag->add($item); - $tag->count++; return $tag->save(); } diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 829089c4..baf8b1ae 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -147,4 +147,19 @@ class tag_event_Core { } } } + + static function info_block_get_metadata($block, $item) { + $tags = array(); + foreach (tag::item_tags($item) as $tag) { + $tags[] = "<a href=\"" . url::site("tag/{$tag->name}") . "\">{$tag->name}</a>"; + } + if ($tags) { + $info = $block->content->metadata; + $info["tags"] = array( + "label" => t("Tags:"), + "value" => implode(", ", $tags) + ); + $block->content->metadata = $info; + } + } } |
