From 5257aad873f71bb0125d8b576748c7bf1bf3163d Mon Sep 17 00:00:00 2001 From: mistic100 Date: Wed, 25 May 2011 13:33:29 +0000 Subject: bug:2278 fixed (merge r10970 r11008 r11039 from trunk) replace FCBKcomplete by TokenInput to avoid 3rd tag issue on autocomplete git-svn-id: http://piwigo.org/svn/branches/2.2@11056 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'admin/include/functions.php') diff --git a/admin/include/functions.php b/admin/include/functions.php index f5afa9633..c929d2c55 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -2100,25 +2100,29 @@ function get_active_menu($menu_page) return 0; } -function get_fckb_taglist($query) +function get_taglist($query) { $result = pwg_query($query); + $taglist = array(); while ($row = pwg_db_fetch_assoc($result)) { array_push( $taglist, array( - 'key' => $row['tag_name'], - 'value' => '~~'.$row['tag_id'].'~~', + 'name' => $row['tag_name'], + 'id' => '~~'.$row['tag_id'].'~~', ) ); } - + + $cmp = create_function('$a,$b', 'return strcasecmp($a["name"], $b["name"]);'); + usort($taglist, $cmp); + return $taglist; } -function get_fckb_tag_ids($raw_tags) +function get_tag_ids($raw_tags) { // In $raw_tags we receive something like array('~~6~~', '~~59~~', 'New // tag', 'Another new tag') The ~~34~~ means that it is an existing @@ -2126,6 +2130,7 @@ function get_fckb_tag_ids($raw_tags) // or "1234" (numeric characters only) $tag_ids = array(); + $raw_tags = explode(',',$raw_tags); foreach ($raw_tags as $raw_tag) { -- cgit v1.2.3