Commit 14d65ce1 authored by webchick's avatar webchick
Browse files

#800502 by Damien Tournoud, sun: Fixed Module page is not ordered correctly.

parent fb9c1df0
...@@ -5465,6 +5465,15 @@ function element_sort($a, $b) { ...@@ -5465,6 +5465,15 @@ function element_sort($a, $b) {
return ($a_weight < $b_weight) ? -1 : 1; return ($a_weight < $b_weight) ? -1 : 1;
} }
/**
* 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. * Retrieve the default properties for the defined element type.
*/ */
......
...@@ -959,9 +959,14 @@ function system_modules($form, $form_state = array()) { ...@@ -959,9 +959,14 @@ function system_modules($form, $form_state = array()) {
t('Description'), t('Description'),
array('data' => t('Operations'), 'colspan' => 3), 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'] = array('#type' => 'actions');
$form['actions']['submit'] = array( $form['actions']['submit'] = array(
'#type' => 'submit', '#type' => 'submit',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment