You are here

function theme_download_file_insert_direct_download_item_accessible in DownloadFile 6

Theme function for the 'direct_download_accessible' 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_item_accessible()
download_file_insert_content in ./download_file.inc
Implementation of hook_insert_content().

File

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

Code

function theme_download_file_insert_direct_download_item_accessible($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']),
  );
  $accessibility = theme('download_file_detail_accessible', $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'];
  }
  $item['link_text'] .= ' ' . $accessibility;
  return theme('download_file_insert_link', $item, $widget);
}