You are here

function template_preprocess_designkit in DesignKit 7

Same name and namespace in other branches
  1. 6 designkit.module \template_preprocess_designkit()

Preprocessor for theme('designkit').

File

./designkit.module, line 271

Code

function template_preprocess_designkit(&$variables) {

  // Map each color to a corresponding variable name.
  foreach ($variables['color'] as $key => $color) {
    $variables[$key] = $color;
  }

  // Map each image to a corresponding variable name.
  // Provide a _raw version for non-image cache processed URLs.
  foreach ($variables['image'] as $key => $options) {
    $variables["{$key}_raw"] = $variables[$key] = file_create_url($options['uri']);
    if (!empty($options['process'])) {
      $variables[$key] = image_style_url("designkit-image-{$key}", $options['uri']);
    }
  }
}