From 5335e4c0b4bffeeeb8667ed706b5e8702de00ce9 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 27 Jun 2010 11:25:31 -0700 Subject: Fix the autocomplete callback in item_edit_form(). We were incorrectly matching the form input in the jQuery selector. Did this ever work? Fixes ticket #1168 --- modules/tag/helpers/tag_event.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/tag/helpers') diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index a790b930..1a593d3f 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -67,8 +67,8 @@ class tag_event_Core { static function item_edit_form($item, $form) { $url = url::site("tags/autocomplete"); $form->script("") - ->text("$('form input[id=tags]').ready(function() { - $('form input[id=tags]').autocomplete( + ->text("$('form input[name=tags]').ready(function() { + $('form input[name=tags]').autocomplete( '$url', {max: 30, multiple: true, multipleSeparator: ',', cacheLength: 1}); });"); -- cgit v1.2.3 From f75ce45b6b6b848840d9a1688ca382a49de4f338 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 27 Jun 2010 12:14:56 -0700 Subject: When detecting encodings, give priority to ISO-8859-1 which seems to solve the umlaut problem in IPTC data. Fixes ticket #1144. --- modules/exif/helpers/exif.php | 6 ++++-- modules/tag/helpers/tag_event.php | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/tag/helpers') diff --git a/modules/exif/helpers/exif.php b/modules/exif/helpers/exif.php index 943feba7..aa77b42e 100644 --- a/modules/exif/helpers/exif.php +++ b/modules/exif/helpers/exif.php @@ -36,7 +36,8 @@ class exif_Core { foreach(self::_keys() as $field => $exifvar) { if (isset($exif_raw[$exifvar[0]][$exifvar[1]])) { $value = $exif_raw[$exifvar[0]][$exifvar[1]]; - if (function_exists("mb_detect_encoding") && mb_detect_encoding($value) != "UTF-8") { + if (function_exists("mb_detect_encoding") && + mb_detect_encoding($value, "ISO-8859-1, UTF-8") != "UTF-8") { $value = utf8_encode($value); } $keys[$field] = Input::clean($value); @@ -59,7 +60,8 @@ class exif_Core { foreach (array("Keywords" => "2#025", "Caption" => "2#120") as $keyword => $iptc_key) { if (!empty($iptc[$iptc_key])) { $value = implode(" ", $iptc[$iptc_key]); - if (function_exists("mb_detect_encoding") && mb_detect_encoding($value) != "UTF-8") { + if (function_exists("mb_detect_encoding") && + mb_detect_encoding($value, "ISO-8859-1, UTF-8") != "UTF-8") { $value = utf8_encode($value); } $keys[$keyword] = Input::clean($value); diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 1a593d3f..7fe9fba3 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -36,7 +36,8 @@ class tag_event_Core { $tag = str_replace("\0", "", $tag); foreach (explode(",", $tag) as $word) { $word = trim($word); - if (function_exists("mb_detect_encoding") && mb_detect_encoding($word) != "UTF-8") { + if (function_exists("mb_detect_encoding") && + mb_detect_encoding($word, "ISO-8859-1, UTF-8") != "UTF-8") { $word = utf8_encode($word); } $tags[$word] = 1; -- cgit v1.2.3 From 5eb4b8ff6cae33d83cfef8ea3d41cba4352e65d8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 13 Jul 2010 12:16:52 -0700 Subject: Check for the existence of uploadify() in the add_photos_form. The HTML uploader won't have that field. --- modules/tag/helpers/tag_event.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/tag/helpers') diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 7fe9fba3..0cc2170c 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -106,6 +106,10 @@ class tag_event_Core { } static function add_photos_form($album, $form) { + if (!isset($group->uploadify)) { + return; + } + $group = $form->add_photos; $group->input("tags") ->label(t("Add tags to all uploaded files")) @@ -125,6 +129,10 @@ class tag_event_Core { } static function add_photos_form_completed($album, $form) { + if (!isset($group->uploadify)) { + return; + } + foreach (explode(",", $form->add_photos->tags->value) as $tag_name) { $tag_name = trim($tag_name); if ($tag_name) { -- cgit v1.2.3