#800502 by Damien Tournoud, sun: Fixed Module page is not ordered correctly.
parent
fb9c1df0b9
commit
14d65ce19e
|
@ -5465,6 +5465,15 @@ function element_sort($a, $b) {
|
|||
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.
|
||||
*/
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue