function file_icon_url

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.

1 call to file_icon_url()
theme_file_icon in modules/file/file.module
Returns HTML for an image with an appropriate icon for the given file.

File

modules/file/file.module, line 884

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.