コード例 #1
0
ファイル: template.php プロジェクト: helsbib/elsinore
/**
 * Overrides dynamo filefield icon.
 */
function elsinore_filefield_icon($file)
{
    $icon = '';
    // Cast file to object for uniform access.
    if (is_object($file)) {
        $file = (array) $file;
    }
    $alt = t('PDF file');
    if ($icon_url = filefield_icon_url($file)) {
        $icon = theme('image', $icon_url, t('PDF file'));
    }
    return $icon;
}
コード例 #2
0
ファイル: template.cck.php プロジェクト: Joanl/ding
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 = '<img class="field-icon-'. $dashed_mime .'"  alt="'. $mime .' icon" src="'. $icon_url .'" />';
        $icon = '<img "  alt="' . $mime . ' icon" src="' . $icon_url . '" />';
    }
    //  return '<div class="filefield-icon field-icon-'. $dashed_mime .'">'. $icon .'</div>';
    return $icon;
}