summaryrefslogtreecommitdiff
path: root/modules/tag/helpers
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2011-05-12 23:48:54 +0000
committerNathan Kinkade <nath@nkinka.de>2011-05-12 23:48:54 +0000
commit2ad445441974c64599df496ba4a585415aa41169 (patch)
tree49b2860fdac2d2ff16134bfa2aa8d8a972b93301 /modules/tag/helpers
parent1f7c1f18c651c58048e92d615c71ac0fe6691c10 (diff)
parent9aeb824aa1d15bd94bd7cef0a322c4e8a667e67b (diff)
Manually merged a conflict after pulling from upstream.
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r--modules/tag/helpers/tag.php1
-rw-r--r--modules/tag/helpers/tag_block.php2
-rw-r--r--modules/tag/helpers/tag_installer.php7
3 files changed, 8 insertions, 2 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index 733215b3..c21104ee 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -48,6 +48,7 @@ class tag_Core {
* @return ORM_Iterator of Tag_Model in descending tag count order
*/
static function popular_tags($count) {
+ $count = max($count, 1);
return ORM::factory("tag")
->order_by("count", "DESC")
->limit($count)
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php
index 0ee0f5f5..74656a0a 100644
--- a/modules/tag/helpers/tag_block.php
+++ b/modules/tag/helpers/tag_block.php
@@ -30,7 +30,7 @@ class tag_block_Core {
$block->css_id = "g-tag";
$block->title = t("Tags");
$block->content = new View("tag_block.html");
- $block->content->cloud = tag::cloud(250);
+ $block->content->cloud = tag::cloud(module::get_var("tag", "tag_cloud_size", 250));
if ($theme->item() && $theme->page_subtype() != "tag" && access::can("edit", $theme->item())) {
$controller = new Tags_Controller();
diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php
index 16ad1239..66a78b91 100644
--- a/modules/tag/helpers/tag_installer.php
+++ b/modules/tag/helpers/tag_installer.php
@@ -36,7 +36,8 @@ class tag_installer {
KEY(`tag_id`, `id`),
KEY(`item_id`, `id`))
DEFAULT CHARSET=utf8;");
- module::set_version("tag", 2);
+ module::set_var("tag", "tag_cloud_size", 30);
+ module::set_version("tag", 3);
}
static function upgrade($version) {
@@ -45,6 +46,10 @@ class tag_installer {
$db->query("ALTER TABLE {tags} MODIFY COLUMN `name` VARCHAR(128)");
module::set_version("tag", $version = 2);
}
+ if ($version == 2) {
+ module::set_var("tag", "tag_cloud_size", 30);
+ module::set_version("tag", $version = 3);
+ }
}
static function uninstall() {