You are here

function asset_icon in Asset 5.2

Related topics

4 calls to asset_icon()
asset_field_formatter in modules/asset_content.inc
Implementation of hook_field_formatter().
theme_assetfield in ./asset_wizard.module
Format an assetfield.
theme_asset_icon in ./asset.module
Theme an individual icon for browsing. Allows a link_title property to be added to the asset object to override the display title. This is used to display .. as the link title for the parent directory.
theme_asset_wizard_textfield_preview in ./asset_wizard.module

File

./asset.module, line 637
Main module.

Code

function asset_icon($asset, $size = 64) {
  $icon = asset_type_invoke($asset, 'icon');
  if (!$icon) {
    $icon = drupal_get_path('module', 'asset') . '/icons/file.png';
  }
  if (is_file($icon) && (list($width, $height, $type, $image_attributes) = @getimagesize($icon))) {
    $height = min($size, $height);
    $width = min($size, $width);
  }
  else {
    $height = $width = $size;
  }
  return theme('image', $icon, $asset->title, $asset->title, array(
    'width' => $width,
    'height' => $height,
  ), FALSE);
}