summaryrefslogtreecommitdiff
path: root/modules/tag/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-27 00:26:04 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-27 00:26:04 +0000
commitd881c91e0c542133187e00d62c9191add7a5c33d (patch)
tree23cccf4a825ab410e6b2ca48ed3b107d3952d86e /modules/tag/helpers
parente3fa1c8acd0e617651e9b4a613413dc51521c63d (diff)
Trying to add tags, but it doesn't work yet. For some reason that i can't figure out, the form never validates and I never get into the true branch of the if. I'm taking a break for awhile.
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r--modules/tag/helpers/tag.php12
-rw-r--r--modules/tag/helpers/tag_block.php11
2 files changed, 21 insertions, 2 deletions
diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php
index 0ca86dc8..6e8f95f9 100644
--- a/modules/tag/helpers/tag.php
+++ b/modules/tag/helpers/tag.php
@@ -59,4 +59,16 @@ class tag_Core {
->limit($count)
->find_all();
}
+
+ public static function get_add_form($item_id) {
+ $form = new Forge(url::site("form/add/tags/$item_id"), "", "post", array("id" => "gAddTag"));
+ $form->input("text")
+ ->label(_("(Enter tags separated by commas)"))
+ ->id("gNewTags")
+ ->class("text")
+ ->value("add new tags...")
+ ->rules("required");
+ $form->submit(_("Add"));
+ return $form;
+ }
}
diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php
index 1576ac08..5cf6aa75 100644
--- a/modules/tag/helpers/tag_block.php
+++ b/modules/tag/helpers/tag_block.php
@@ -19,6 +19,11 @@
*/
class tag_block_Core {
+ 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) {
$block = new Block();
$block->id = "gTag";
@@ -31,9 +36,11 @@ class tag_block_Core {
usort($tags, array("tag_block", "sort_by_name"));
$block->content->tags = $tags;
-
- return $block;
+ if ($block->content->page_type != "tag") {
+ $block->content->item = $theme->item();
+ }
}
+ return $block;
}
public static function sort_by_name($tag1, $tag2) {