mình sửaEdit file file.module đường dẫn theo đường dẫnin path /modules/file
Returns HTML for an image with an appropriate icon for the given file.
- @param $variables
- An associative array containing: -file: A file object for which to make an icon.
- icon_directory: (optional) A path to a directory of icons to be used for files. Defaults to the value of the "file_icon_directory" variable.
- alt: (optional) The alternative text to represent the icon in text-based browsers. Defaults to an empty string.
- @ingroup themeable
function theme_file_icon($variables) {
$file = $variables['file'];
$alt = $variables['alt'];
$icon_directory = $variables['icon_directory'];
$mime = check_plain($file->filemime);
$icon_url = file_icon_url($file, $icon_directory);
$url = file_create_url($file->uri); /*Thêm đường dẫn file */
return '<a href='.$url.'><img class="file-icon" alt="' . check_plain($alt) . '" title="' . $mime . '" src="' . $icon_url . '" /></a>'; /* Thêm link vào icon */
}
Sau đó dùngThen using css ẩn cái tên file là okto hide the filename. Cảm ơnThanks Mahyar Farshi đã chia sẻfor share.