You are here

function focal_point_file_load in Focal Point 7

Implements hook_file_load().

File

./focal_point.module, line 126

Code

function focal_point_file_load($files) {
  $focal_points = focal_point_get_multiple(array_keys($files));
  foreach ($files as &$file) {
    $file->focal_point = isset($focal_points[$file->fid]) ? $focal_points[$file->fid] : '';

    // Special handling for the "test drive file".
    if ($file->fid == variable_get('focal_point_test_drive_image', NULL)) {
      $file->focal_point = variable_get('focal_point_test_drive_focal_point', FOCAL_POINT_DEFAULT);
    }
  }
}