aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/element_set_global.php3
-rw-r--r--include/functions_html.inc.php2
-rw-r--r--include/functions_tag.inc.php7
3 files changed, 8 insertions, 4 deletions
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index 1c1013727..5dbe4a18b 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -293,7 +293,6 @@ if (count($page['cat_elements_id']) > 0)
INNER JOIN '.TAGS_TABLE.' ON tag_id = id
WHERE image_id IN ('.implode(',', $page['cat_elements_id']).')
GROUP BY tag_id
- ORDER BY name ASC
;';
$result = pwg_query($query);
@@ -303,6 +302,8 @@ if (count($page['cat_elements_id']) > 0)
array_push($tags, $row);
}
+ usort($tags, 'name_compare');
+
$template->assign_vars(
array(
'DEL_TAG_SELECTION' => get_html_tag_selection($tags, 'del_tags'),
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php
index 7db40add4..993c46dea 100644
--- a/include/functions_html.inc.php
+++ b/include/functions_html.inc.php
@@ -563,7 +563,7 @@ function get_html_tag_selection(
function name_compare($a, $b)
{
- return strcmp($a['name'], $b['name']);
+ return strcmp(strtolower($a['name']), strtolower($b['name']));
}
/**
diff --git a/include/functions_tag.inc.php b/include/functions_tag.inc.php
index 3e3934669..046eb6bb1 100644
--- a/include/functions_tag.inc.php
+++ b/include/functions_tag.inc.php
@@ -91,9 +91,10 @@ SELECT DISTINCT image_id
function get_all_tags()
{
$query = '
-SELECT id AS tag_id, name, url_name
+SELECT id AS tag_id,
+ name,
+ url_name
FROM '.TAGS_TABLE.'
- ORDER BY name
;';
$result = pwg_query($query);
@@ -104,6 +105,8 @@ SELECT id AS tag_id, name, url_name
array_push($tags, $row);
}
+ usort($tags, 'name_compare');
+
return $tags;
}