You are here

function image_features_export_render in Features 7

Same name and namespace in other branches
  1. 7.2 includes/features.image.inc \image_features_export_render()

Implements hook_features_export_render().

File

includes/features.image.inc, line 52

Code

function image_features_export_render($module_name, $data, $export = NULL) {
  $code = array();
  $code[] = '  $styles = array();';
  $code[] = '';
  foreach ($data as $name) {
    if ($style = image_style_load($name)) {
      _image_features_style_sanitize($style);
      $style_export = features_var_export($style, '  ');
      $style_identifier = features_var_export($name);
      $code[] = "  // Exported image style: {$name}.";
      $code[] = "  \$styles[{$style_identifier}] = {$style_export};";
      $code[] = "";
    }
  }
  $code[] = '  return $styles;';
  $code = implode("\n", $code);
  return array(
    'image_default_styles' => $code,
  );
}