You are here

function theme_media_formatter_large_icon in D7 Media 7

Same name and namespace in other branches
  1. 7.4 includes/media.theme.inc \theme_media_formatter_large_icon()
  2. 7.2 includes/media.theme.inc \theme_media_formatter_large_icon()
  3. 7.3 includes/media.theme.inc \theme_media_formatter_large_icon()

Field formatter for displaying a file as a large icon.

2 theme calls to theme_media_formatter_large_icon()
media_field_formatter_view in includes/media.fields.inc
Implement hook_field_formatter_view().
media_file_type_media_default_view in includes/media.types.inc
Implements hook_file_type_TYPE_default_view().

File

includes/media.theme.inc, line 321
Media Theming

Code

function theme_media_formatter_large_icon($variables) {
  $file = $variables['file'];
  $icon_dir = media_variable_get('icon_base_directory') . '/' . media_variable_get('icon_set');
  $icon = file_icon_path($file, $icon_dir);
  $variables['path'] = $icon;

  // theme_image() requires the 'alt' attribute passed as its own variable.
  // @see http://drupal.org/node/999338
  if (!isset($variables['alt']) && isset($variables['attributes']['alt'])) {
    $variables['alt'] = $variables['attributes']['alt'];
  }
  return theme('image', $variables);
}