You are here

function designkit_get_image_info in DesignKit 7

Retrieve designkit image info for the site's default theme.

1 call to designkit_get_image_info()
_designkit_preprocess in ./designkit.module
Helper function to turn design choices into theme variables.

File

./designkit.module, line 160

Code

function designkit_get_image_info() {
  $info = designkit_get_info();
  $image = !empty($info['designkit']['image']) ? variable_get('designkit_image', array()) : array();

  // Process images array into an array of uris & add processed
  // version to page template.
  foreach ($image as $name => $fid) {
    $file = db_select('file_managed', 'f')
      ->fields('f')
      ->condition('fid', $fid)
      ->execute()
      ->fetchObject();
    if ($file && $file->uri && file_exists($file->uri)) {
      $image[$name] = array(
        'name' => $name,
        'uri' => $file->uri,
        'process' => !empty($info['designkit']['image'][$name]['effect']),
      );
    }
    else {
      unset($image[$name]);
    }
  }
  return $image;
}