You are here

function imageapi_optimize_features_export_render in Image Optimize (or ImageAPI Optimize) 7.2

Implements hook_features_export_render().

File

./imageapi_optimize.features.inc, line 57
Features integration for the ImageAPI Optimize module.

Code

function imageapi_optimize_features_export_render($module_name, $data, $export = NULL) {
  $code = array();
  $code[] = '  $pipelines = array();';
  $code[] = '';
  foreach ($data as $name) {
    if ($piepline = imageapi_optimize_pipeline_load($name)) {
      _imageapi_optimize_features_pipeline_sanitize($piepline);
      $pipeline = features_var_export($piepline, '  ');
      $pipeline_identifier = features_var_export($name);
      $code[] = "  // Exported imageapi optimize pipeline: {$name}.";
      $code[] = "  \$pipelines[{$pipeline_identifier}] = {$pipeline};";
      $code[] = "";
    }
  }
  $code[] = '  return $pipelines;';
  $code = implode("\n", $code);
  return array(
    'imageapi_optimize_default_pipelines' => $code,
  );
}