Created
January 16, 2015 16:51
-
-
Save iberezovchuk/a34830d30776b7f9e742 to your computer and use it in GitHub Desktop.
#Drupal: Changing fie icon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function themeName_file_icon($variables) { | |
$file = $variables['file']; | |
$icon_directory = $variables['icon_directory']; | |
$mime = check_plain($file->filemime); | |
if ($mime == 'application/vnd.ms-excel') { | |
$icon_directory = path_to_theme() . '/images'; | |
} | |
$icon_url = file_icon_url($file, $icon_directory); | |
return '<img class="file-icon" alt="" title="' . $mime . '" src="' . $icon_url . '" />'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment