You are here

function iss_file_load in Image Style Selector 7.2

Implements hook_file_load().

File

./iss.module, line 300

Code

function iss_file_load($files) {
  foreach ($files as $fid => &$file) {
    if ($file->type == 'image') {
      $file->iss_styles = array();
      $query = db_query("SELECT iss.source_style, iss.target_style FROM iss_styles iss WHERE iss.fid = :fid", array(
        ':fid' => $fid,
      ));
      while ($result = $query
        ->fetchAssoc()) {
        $file->iss_styles[$result['source_style']] = $result['target_style'];
      }
    }
  }
}