function asset_render_macro in Asset 5.2
Same name and namespace in other branches
- 5 asset.module \asset_render_macro()
- 6 asset.module \asset_render_macro()
build html from atrributes array.
Parameters
$attr: Array of attributes parsed from filter macro.
Related topics
2 calls to asset_render_macro()
- asset_filter in ./
asset.module - Implementation of hook_filter().
- asset_wizard_preview in ./
asset_wizard.module - Step 4: Display a preview of the formatted asset
File
- ./
asset.module, line 1127 - Main module.
Code
function asset_render_macro($attr = array()) {
// sanity check
if (!$attr['aid']) {
return;
}
$asset = asset_load($attr['aid'], TRUE);
if ($attr['format'] && $asset->formatters[$attr['format']]) {
return asset_render($asset, $attr);
}
else {
return asset_type_invoke($asset, 'view');
}
}