You are here

function asset_preview in Asset 5

Same name and namespace in other branches
  1. 6 asset.module \asset_preview()

Build a preview of an asset based on module and format options. If no module and format info is given then the default teaser formatter is used.

6 calls to asset_preview()
asset_js_preview in ./asset.module
Menu Callback from javascript to print an assets preview
asset_lightbox in ./asset.module
Integrate asset with lightbox
asset_nodeapi in ./asset.module
Implementation of hook_nodeapi() This is where we build the asset_node records.
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.

... See full list

File

./asset.module, line 681

Code

function asset_preview($aid, $module = NULL, $format = NULL) {
  $asset = asset_load($aid);
  if (!$module || !$format) {
    $formatter = asset_get_default_formatter($asset->type, $asset->extension, TRUE);
    list($module, $format) = explode(':', $formatter);
  }
  $output = module_invoke($module, 'asset_formatter', 'preview', $asset, array(
    'format' => $format,
  ));
  return $output;
}