function file_icon_url
file_icon_url($file, $icon_directory = NULL)
Creates a URL to the icon for a file object.
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.
File
- modules/file/file.module, line 861
- Defines a "managed_file" Form API field and a "file" field for Field module.
Code
function file_icon_url($file, $icon_directory = NULL) { if ($icon_path = file_icon_path($file, $icon_directory)) { return base_path() . $icon_path; } return FALSE; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!file!file.module/function/file_icon_url/7.x