array(
'type' => $file['filemime'],
'length' => $file['filesize'],
),
);
// Use the description as the link text if available.
if (empty($file['data']['description'])) {
$link_text = $file['filename'];
}
else {
$link_text = $file['data']['description'];
$options['attributes']['title'] = $file['filename'];
}
// return '
'. $icon . l($link_text, $url, $options) .'
';
return l($icon . '' . $link_text . '', $url, $options= array('html' => TRUE));
}
//icon
function mothership_filefield_icon($file) {
if (is_object($file)) {
$file = (array) $file;
}
$mime = check_plain($file['filemime']);
$dashed_mime = strtr($mime, array('/' => '-'));
if ($icon_url = filefield_icon_url($file)) {
// $icon = '
';
$icon = '
';
}
// return ''. $icon .'
';
return $icon;
}