You are here

function theme_asset in Asset 6

Same name and namespace in other branches
  1. 5.2 asset.module \theme_asset()
  2. 5 asset.module \theme_asset()

Theme rendered assets

1 theme call to theme_asset()
asset_render_macro in ./asset.module
build html from atrributes array.

File

inc/asset.themes.inc, line 5

Code

function theme_asset($content, $attributes) {
  if ($attributes['formatter'] == "imagecache" || $attributes['format'] == "image") {

    // We don't put images in a div because IE6 doesn't like <a><div><img/></div></a></>
    $align = 'asset-align-' . ($attributes['align'] ? $attributes['align'] : 'none');
    $content = str_replace("/>", "class=\"" . $align . "\"/>", $content);
    return $content;
  }
  else {
    $class = 'asset-' . $attributes['formatter'] . '-' . $attributes['format'];
    $class .= ' asset-align-' . ($attributes['align'] ? $attributes['align'] : 'none');
    $output = '<span class="' . $class . '">' . $content . '</span>';
    return $output;
  }
}