function filefield_widget_for_file in FileField 6.2
Determine which widget will be used for displaying the edit form for the given file.
Return value
An array with info about the most appropriate file widget, or NULL if no widget is available to edit this file.
2 calls to filefield_widget_for_file()
- filefield_file_edit_form in ./
filefield.widget.inc - The filefield widget for previously uploaded files.
- filefield_validate_file_widget_support in ./
filefield.widget.inc - Check that a file is supported by at least one of the widgets that are enabled for the field instance in question.
File
- ./
filefield.module, line 588
Code
function filefield_widget_for_file($file, $field, $field_widget) {
$file_widget_info = _filefield_file_widget_info($field_widget);
$file = (object) $file;
// other modules only get to see objects
$suitability_args = array(
$file,
$field,
$field_widget,
);
return _filefield_extension_for_file($file_widget_info, $suitability_args);
}