You are here

function asset_file_load in Asset 6

Same name and namespace in other branches
  1. 5.2 asset.types.inc \asset_file_load()

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

File

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

Code

function asset_file_load($asset) {
  $files = array();
  $result = db_query('SELECT f.*, a.label FROM {files} f INNER JOIN {asset_files} a ON f.fid=a.fid WHERE a.aid=%d', $asset->aid);
  while ($row = db_fetch_array($result)) {
    if ($row['label'] == 'default') {
      $default = $row;
    }
    $files[$row['label']] = $row;
  }
  return array(
    'file' => $default,
    'files' => $files,
  );
}