You are here

function asset_render_macro in Asset 5

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

build html from atrributes array.

Parameters

$attr: Array of attributes parsed from filter macro.

5 calls to asset_render_macro()
asset_filter in ./asset.module
Implementation of hook_filter().
asset_widget in modules/asset_content.inc
Define the behavior of a widget.
asset_wizard_form in ./asset_wizard.inc
Main form builder function for the asset wizard.
asset_wizard_form_validate in ./asset_wizard.inc
Validate callback for asset_wizard_form().
_asset_widget_form in modules/asset_content.inc

File

./asset.module, line 471

Code

function asset_render_macro($attr = array()) {
  $asset = asset_load($attr['aid']);
  $asset->title = $attr['title'] ? $attr['title'] : $asset->title;
  if ($attr['formatter']) {
    $content = module_invoke($attr['formatter'], 'asset_formatter', 'render', $asset, $attr);
    return theme('asset', $content, $attr);
  }
  else {
    return theme('asset_render_default', $asset);
  }
}