function theme_file_icon

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 file.module theme_file_icon($variables)
cle7 file.module theme_file_icon($variables)
elmsmedia7 file.module theme_file_icon($variables)
icor7 file.module theme_file_icon($variables)
meedjum_blog7 file.module theme_file_icon($variables)
mooc7 file.module theme_file_icon($variables)

Returns HTML for an image with an appropriate icon for the given file.

Parameters

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

Related topics

4 theme calls to theme_file_icon()
theme_file_entity_download_link in sites/all/modules/ulmus/file_entity/file_entity.theme.inc
Copy of theme_file_file_link() for linking to the file download URL.
theme_file_entity_file_link in sites/all/modules/ulmus/file_entity/file_entity.theme.inc
Copy of theme_file_file_link() for linking to the view file page.
theme_file_link in modules/file/file.module
Returns HTML for a link to a file.
views_handler_field_file_filemime::render in sites/all/modules/ulmus/views/modules/system/views_handler_field_file_filemime.inc
Render the field.
5 string references to the theme hook from theme_file_icon()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

file_theme in modules/file/file.module
Implements hook_theme().
theme_file_entity_download_link in sites/all/modules/ulmus/file_entity/file_entity.theme.inc
Copy of theme_file_file_link() for linking to the file download URL.
theme_file_entity_file_link in sites/all/modules/ulmus/file_entity/file_entity.theme.inc
Copy of theme_file_file_link() for linking to the view file page.
theme_file_link in modules/file/file.module
Returns HTML for a link to a file.
views_handler_field_file_filemime::render in sites/all/modules/ulmus/views/modules/system/views_handler_field_file_filemime.inc
Render the field.

File

modules/file/file.module, line 760
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function theme_file_icon($variables) {
  $file = $variables['file'];
  $icon_directory = $variables['icon_directory'];

  $mime = check_plain($file->filemime);
  $icon_url = file_icon_url($file, $icon_directory);
  return '<img class="file-icon" alt="" title="' . $mime . '" src="' . $icon_url . '" />';
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.