From 5e83ebd6d0e1eccb1a865dc6c5fe2ef712bd421b Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 28 Jun 2009 16:50:55 -0700 Subject: Use $theme->script() method to render module javascript files --- modules/tag/helpers/tag_theme.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/tag/helpers') diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index a32d71b6..b48ad178 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -19,8 +19,11 @@ */ class tag_theme_Core { static function head($theme) { - $url = url::file("modules/tag/js/tag.js"); - return ""; + $theme->script("modules/tag/js/tag.js"); + } + + static function admin_head($theme) { + $theme->script("modules/tag/js/tag.js"); } static function sidebar_blocks($theme) { -- cgit v1.2.3 From a9b27fb352490a48d4035966b8c8d463c62c7726 Mon Sep 17 00:00:00 2001 From: hiwilson Date: Mon, 29 Jun 2009 22:40:13 -0700 Subject: Let the "Popular tags" sidebar block display on tag or search page. --- modules/tag/helpers/tag_theme.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'modules/tag/helpers') diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index b48ad178..fe30354f 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -28,9 +28,6 @@ class tag_theme_Core { static function sidebar_blocks($theme) { // @todo this needs to be data driven - if (!$theme->item()) { - return; - } $block = new Block(); $block->css_id = "gTag"; @@ -38,7 +35,7 @@ class tag_theme_Core { $block->content = new View("tag_block.html"); $block->content->cloud = tag::cloud(30); - if ($theme->page_type() != "tag" && access::can("edit", $theme->item())) { + if ($theme->item() && $theme->page_type() != "tag" && access::can("edit", $theme->item())) { $controller = new Tags_Controller(); $block->content->form = tag::get_add_form($theme->item()); } else { -- cgit v1.2.3 From 311794dbcec07b8e3e0480203f3373488eb6c904 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 9 Jul 2009 22:11:49 -0700 Subject: Make the tag event handle the iptc keywords consistently with other tag add mechanisms --- modules/tag/helpers/tag_event.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/tag/helpers') diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 946326c0..7a170bf8 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -34,10 +34,13 @@ class tag_event_Core { if (!empty($iptc["2#025"])) { foreach($iptc["2#025"] as $tag) { $tag = str_replace("\0", "", $tag); - if (function_exists("mb_detect_encoding") && mb_detect_encoding($tag) != "UTF-8") { - $tag = utf8_encode($tag); + foreach (preg_split("/[,;]/", $tag) as $word) { + $word = preg_replace('/\s+/', '.', trim($word)); + if (function_exists("mb_detect_encoding") && mb_detect_encoding($word) != "UTF-8") { + $word = utf8_encode($word); + } + $tags[$word] = 1; } - $tags[$tag] = 1; } } } -- cgit v1.2.3