aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/include/functions.php')
-rw-r--r--admin/include/functions.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index a82cf5265..44d32f5dd 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -2054,4 +2054,21 @@ function get_fckb_tag_ids($raw_tags)
return $tag_ids;
}
-?>
+
+/** returns the argument_ids array with new sequenced keys based on related
+ * names. Sequence is not case sensitive.
+ * Warning: By definition, this function breaks original keys
+ */
+function order_by_name($element_ids,$name)
+{
+ $ordered_element_ids = array();
+ foreach ($element_ids as $k_id => $element_id)
+ {
+ $key = strtolower($name[$element_id]) .'-'. $name[$element_id] .'-'. $k_id;
+ $ordered_element_ids[$key] = $element_id;
+ }
+ ksort($ordered_element_ids);
+ return $ordered_element_ids;
+}
+
+?> \ No newline at end of file