function _filefield_sources_sort in FileField Sources 6
Same name and namespace in other branches
- 8 filefield_sources.module \_filefield_sources_sort()
- 7 filefield_sources.module \_filefield_sources_sort()
Custom sort function for ordering sources.
1 string reference to '_filefield_sources_sort'
- filefield_sources_info in ./
filefield_sources.module - Load hook_filefield_sources_info() data from all modules.
File
- ./
filefield_sources.module, line 438 - Extend FileField to allow files from multiple sources.
Code
function _filefield_sources_sort($a, $b) {
$a = (array) $a + array(
'weight' => 0,
'label' => '',
);
$b = (array) $b + array(
'weight' => 0,
'label' => '',
);
return $a['weight'] < $b['weight'] ? -1 : ($a['weight'] > $b['weight'] ? 1 : strnatcasecmp($a['label'], $b['label']));
}