summaryrefslogtreecommitdiff
path: root/modules/tag/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tag/helpers')
-rw-r--r--modules/tag/helpers/tag_event.php9
-rw-r--r--modules/tag/helpers/tag_theme.php12
2 files changed, 12 insertions, 9 deletions
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;
}
}
}
diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php
index a32d71b6..fe30354f 100644
--- a/modules/tag/helpers/tag_theme.php
+++ b/modules/tag/helpers/tag_theme.php
@@ -19,15 +19,15 @@
*/
class tag_theme_Core {
static function head($theme) {
- $url = url::file("modules/tag/js/tag.js");
- return "<script src=\"$url\" type=\"text/javascript\"></script>";
+ $theme->script("modules/tag/js/tag.js");
+ }
+
+ static function admin_head($theme) {
+ $theme->script("modules/tag/js/tag.js");
}
static function sidebar_blocks($theme) {
// @todo this needs to be data driven
- if (!$theme->item()) {
- return;
- }
$block = new Block();
$block->css_id = "gTag";
@@ -35,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 {