You are here

function views_features_export_render in Features 6

Implementation of hook_features_export_render().

File

includes/features.views.inc, line 82

Code

function views_features_export_render($module, $data) {
  $code = array();
  $code[] = '  $views = array();';
  $code[] = '';

  // Build views & add to export array
  foreach ($data as $view_name) {

    // Build the view
    $view = views_get_view($view_name, TRUE);
    if ($view) {
      $code[] = '  // Exported view: ' . $view_name;
      $code[] = $view
        ->export('  ');
      $code[] = '  $views[$view->name] = $view;';
      $code[] = '';
    }
  }
  $code[] = '  return $views;';
  $code = implode("\n", $code);
  return array(
    'views_default_views' => $code,
  );
}