You are here

function theme_download_file_insert_direct_download_icon_item in DownloadFile 6

Theme function for the 'direct_download_icon' file via the Insert module.

Parameters

$file: File to format.

$widget: Widget for Insert module.

Return value

A string containing the HTML ouput.

1 theme call to theme_download_file_insert_direct_download_icon_item()
download_file_insert_content in ./download_file.inc
Implementation of hook_insert_content().

File

./download_file.inc, line 98
Insert support for DownloadFile module.

Code

function theme_download_file_insert_direct_download_icon_item($file, $widget) {

  // Views may call this function with a NULL value, return an empty string.
  if (empty($file['fid'])) {
    return '';
  }
  $item = array(
    'url' => download_file_url($file['fid']),
    'icon' => theme('filefield_icon', $file),
  );

  // Use the description as the link text if available.
  if (empty($file['data']['description'])) {
    $item['link_text'] = $file['filename'];
  }
  else {
    $item['link_text'] = $file['data']['description'];
    $item['title'] = $file['filename'];
  }
  return theme('download_file_insert_link', $item, $widget);
}