You are here

function asset_preview in Asset 6

Same name and namespace in other branches
  1. 5 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.

8 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 inc/asset.node.inc
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_widget in inc/modules/asset_content.inc
Implementation of hook_widget().

... See full list

File

./asset.module, line 420

Code

function asset_preview($aid, $module = NULL, $format = NULL) {
  $asset = asset_load($aid);
  if (empty($module) || empty($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;
}