summaryrefslogtreecommitdiff
path: root/modules/tag/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-25 22:38:11 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-25 22:38:11 +0000
commit1ea0382f5346c2fb1a2388a8a53adfe40078dc10 (patch)
treeda5788af9a86a8b559eca22bcec2ae63a858a9ea /modules/tag/helpers
parente9e589e5ebb54d016f1e52d4ba776970456e39b6 (diff)
Moving right along on tags. Now the threshold for which tags can be changed. The default is to show all the tags (i.e. count >= the minimum frequency) by clicking on the "See Less" link, the tag cloud will not show the minimum frequency, so the number of tags shown is smaller.
The "See More" link works the opposite way.
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r--modules/tag/helpers/tag.php5
-rw-r--r--modules/tag/helpers/tag_block.php10
2 files changed, 11 insertions, 4 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index 6dfbcf38..70448527 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -57,7 +57,8 @@ class tag_Core {
*
* @param int $filter Minimum frequency to be included in the tag cloud
* @return array List of tags each entry has the following format:
- * array("name" => "tag_name", "count" => "frequency", "class" => "bucket")
+ * array("id" => "tag_id", "name" => "tag_name", "count" => "frequency",
+ * "class" => "bucket")
*/
public static function load_buckets($filter=1) {
$tag_list = array();
@@ -84,7 +85,7 @@ class tag_Core {
}
// Set the tag to the current class
- $tag_list[$key] = array("name" => $tag->name, "count" => $tag->count,
+ $tag_list[$key] = array("id" => $tag->id, "name" => $tag->name, "count" => $tag->count,
"class" => "$bucket_count");
$bucket_items++;
$tags_set++;
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php
index 629008b6..23a9e276 100644
--- a/modules/tag/helpers/tag_block.php
+++ b/modules/tag/helpers/tag_block.php
@@ -19,12 +19,18 @@
*/
class tag_block_Core {
- public static function sidebar_blocks($theme) {
+ public static function head($theme) {
+ $url = url::file("modules/tag/js/tag.js");
+ return "<script src=\"$url\" type=\"text/javascript\"></script>";
+ }
+
+ public static function sidebar_blocks($theme, $filter=1) {
$block = new Block();
$block->id = "gTag";
$block->title = _("Tags");
$block->content = new View("tag_block.html");
- $block->content->tag_list = tag::load_buckets();
+ $block->content->tag_list = tag::load_buckets($filter);
+ $block->content->filter = $filter;
return $block;
}
} \ No newline at end of file