summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-11-07 18:33:53 +0000
committerDries Buytaert <dries@buytaert.net>2010-11-07 18:33:53 +0000
commitd3852cd3f5b45e0c50c2b2ee29015d5a9d04f9a2 (patch)
tree5220f73b7cf851f2ec86151d7a34c22f908540eb
parent0447e92bf3f6e60cf308b3041ea1c685d8cecca6 (diff)
downloadbrdo-d3852cd3f5b45e0c50c2b2ee29015d5a9d04f9a2.tar.gz
brdo-d3852cd3f5b45e0c50c2b2ee29015d5a9d04f9a2.tar.bz2
- Patch #961136 by sun: move system_sort_by_title() into common.inc.
-rw-r--r--includes/common.inc13
-rw-r--r--modules/system/system.admin.inc15
2 files changed, 14 insertions, 14 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 86fb23ae9..6018eb549 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5788,6 +5788,19 @@ function drupal_sort_weight($a, $b) {
}
/**
+ * Array sorting callback; sorts elements by 'title' key.
+ */
+function drupal_sort_title($a, $b) {
+ if (!isset($b['title'])) {
+ return -1;
+ }
+ if (!isset($a['title'])) {
+ return 1;
+ }
+ return strcasecmp($a['title'], $b['title']);
+}
+
+/**
* Check if the key is a property.
*/
function element_property($key) {
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index f20605589..0b6e45683 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -90,7 +90,7 @@ function system_admin_index() {
// Only display a section if there are any available tasks.
if ($admin_tasks = system_get_module_admin_tasks($module, $info->info)) {
// Sort links by title.
- uasort($admin_tasks, 'system_sort_by_title');
+ uasort($admin_tasks, 'drupal_sort_title');
// Move 'Configure permissions' links to the bottom of each section.
$permission_key = "admin/people/permissions#module-$module";
if (isset($admin_tasks[$permission_key])) {
@@ -903,19 +903,6 @@ function system_modules($form, $form_state = array()) {
}
/**
- * Array sorting callback; sorts elements by 'title' key.
- */
-function system_sort_by_title($a, $b) {
- if (!isset($b['title'])) {
- return -1;
- }
- if (!isset($a['title'])) {
- return 1;
- }
- return strcasecmp($a['title'], $b['title']);
-}
-
-/**
* Array sorting callback; sorts modules or themes by their name.
*/
function system_sort_modules_by_info_name($a, $b) {