Skip to main content
deleted 21 characters in body
Source Link
tuan
  • 1
  • 1

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.

mình sửa file.module đường dẫn theo đường dẫn /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ùng css ẩn cái tên file là ok. Cảm ơn Mahyar Farshi đã chia sẻ.

Edit file file.module in 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 */
}

Then using css to hide the filename. Thanks Mahyar Farshi for share.

mình sửa file.module đường dẫn theo đường dẫn /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 ''; / Thêm link vàoReturns 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ùng css ẩn cái tên file là ok. Cảm ơn Mahyar Farshi đã chia sẻ.

mình sửa file.module đường dẫn theo đường dẫn /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 ''; / Thêm link vào icon */ }

Sau đó dùng css ẩn cái tên file là ok. Cảm ơn Mahyar Farshi đã chia sẻ.

mình sửa file.module đường dẫn theo đường dẫn /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ùng css ẩn cái tên file là ok. Cảm ơn Mahyar Farshi đã chia sẻ.

Source Link
tuan
  • 1
  • 1

mình sửa file.module đường dẫn theo đường dẫn /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 ''; / Thêm link vào icon */ }

Sau đó dùng css ẩn cái tên file là ok. Cảm ơn Mahyar Farshi đã chia sẻ.