You are here

function asset_file_view in Asset 5.2

Same name and namespace in other branches
  1. 6 asset.types.inc \asset_file_view()

Implementation of hook_asset_type('view') for file asset type

Related topics

File

./asset.types.inc, line 32
This file is included by asset_asset_type() and includes all the file and directory specific functions

Code

function asset_file_view($asset) {
  if (strpos($asset->file['filemime'], 'image/') === 0) {
    return theme('image', file_create_path($asset->file['filepath']), $asset->title, $asset->title);
  }
  else {
    return l($asset->file['filename'], file_create_url($asset->file['filepath']));
  }
}