function download_file_field_formatter_view in DownloadFile 7
Same name and namespace in other branches
- 7.3 download_file.module \download_file_field_formatter_view()
- 7.2 download_file.module \download_file_field_formatter_view()
Implementation of hook_field_formatter_view().
File
- ./
download_file.module, line 218 - Module to direct download files or images.
Code
function download_file_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$element = array();
switch ($display['type']) {
case 'direct_download':
$element[0] = array(
'#theme' => 'download_file_formatter_direct_download',
'#items' => $items,
);
break;
case 'direct_download_icon':
$element[0] = array(
'#theme' => 'download_file_formatter_direct_download_icon',
'#items' => $items,
);
break;
case 'direct_download_accessible':
$element[0] = array(
'#theme' => 'download_file_formatter_direct_download_accessible',
'#items' => $items,
);
break;
case 'direct_download_accessible_icon':
$element[0] = array(
'#theme' => 'download_file_formatter_direct_download_accessible_icon',
'#items' => $items,
);
break;
}
return $element;
}