summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-09-05 15:38:16 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-09-05 15:38:16 +0000
commit14d65ce19eb2a9c8b02a711567f6b7e42e426f1f (patch)
treedb8fd6a5a1051d00976044713859110f9f1e4d51
parentfb9c1df0b942df39115a9130dfa76e2b3fd33217 (diff)
downloadbrdo-14d65ce19eb2a9c8b02a711567f6b7e42e426f1f.tar.gz
brdo-14d65ce19eb2a9c8b02a711567f6b7e42e426f1f.tar.bz2
#800502 by Damien Tournoud, sun: Fixed Module page is not ordered correctly.
-rw-r--r--includes/common.inc9
-rw-r--r--modules/system/system.admin.inc5
2 files changed, 14 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index a70d26e93..39606404e 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5466,6 +5466,15 @@ function element_sort($a, $b) {
}
/**
+ * Array sorting callback; sorts elements by title.
+ */
+function element_sort_by_title($a, $b) {
+ $a_title = (is_array($a) && isset($a['#title'])) ? $a['#title'] : '';
+ $b_title = (is_array($b) && isset($b['#title'])) ? $b['#title'] : '';
+ return strnatcasecmp($a_title, $b_title);
+}
+
+/**
* Retrieve the default properties for the defined element type.
*/
function element_info($type) {
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 8daa45a3c..9839b7554 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -959,9 +959,14 @@ function system_modules($form, $form_state = array()) {
t('Description'),
array('data' => t('Operations'), 'colspan' => 3),
),
+ // Ensure that the "Core" package fieldset comes first.
+ '#weight' => $package == 'Core' ? -10 : NULL,
);
}
+ // Lastly, sort all fieldsets by title.
+ uasort($form['modules'], 'element_sort_by_title');
+
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',