file_icon_url

Versions
7
file_icon_url($file, $icon_directory = NULL)

Given a file object, create a URL to a matching icon.

Parameters

$file A file object.

$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.

Return value

A URL string to the icon, or FALSE if an appropriate icon cannot be found.

▾ 1 function calls file_icon_url()

theme_file_icon in modules/file/file.module
Return an image with an appropriate icon for the given file.

Code

modules/file/file.module, line 657

<?php
function file_icon_url($file, $icon_directory = NULL) {
  if ($icon_path = file_icon_path($file, $icon_directory)) {
    return base_path() . $icon_path;
  }
  return FALSE;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.