function _filefield_sort_by_weight in FileField 6.2
Helper function to sort file formatter/widget settings according to user drag-n-drop reordering.
1 call to _filefield_sort_by_weight()
- _filefield_file_extension_info in ./
filefield.module - Common implementation for _filefield_file_widget_info() and _filefield_file_formatter_info(): sort and the given extensions and mark them as enabled or not, based on the extension $settings from hook_widget_settings() or hook_field_settings()…
File
- ./
filefield.module, line 723
Code
function _filefield_sort_by_weight($items) {
uasort($items, '_filefield_sort_by_weight_helper');
foreach ($items as $delta => $item) {
unset($items[$delta]['weight']);
}
return $items;
}