You are here

function asset_render_macro in Asset 6

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

build html from atrributes array.

Parameters

$attr: Array of attributes parsed from filter macro.

9 calls to asset_render_macro()
asset_filter in inc/asset.node.inc
Implementation of hook_filter().
asset_widget in modules/asset_content.inc
Define the behavior of a widget.
asset_widget in inc/modules/asset_content.inc
Implementation of hook_widget().
asset_wizard_form in ./asset_wizard.inc
Main form builder function for the asset wizard.
asset_wizard_form in inc/asset_wizard.inc
Main form builder function for the asset wizard.

... See full list

File

./asset.module, line 241

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);
  }
}