You are here

function custom_breadcrumbs_views_features_export in Custom Breadcrumbs Features 7.2

Implements hook_features_export(). [component hook]

File

includes/custom_breadcrumbs_features.features.inc, line 128
Code to provide custom_breadcrumbs with features integration.

Code

function custom_breadcrumbs_views_features_export($data, &$export, $module_name) {

  // Add views as dependency.
  $view_names = array();
  $views = views_get_all_views();
  foreach ($data as $machine_name) {
    $view_path = custom_breadcrumbs_features_generic_load($machine_name, 'custom_breadcrumbs_views')->views_path;
    foreach ($views as $view) {
      foreach ($view->display as $display) {
        if (isset($display->display_options['path']) && $display->display_options['path'] == $view_path) {
          $view_names[] = $view->name;
          break 2;
        }
      }
    }
  }
  $pipe = array(
    'views_view' => drupal_map_assoc($view_names),
  );
  return custom_breadcrumbs_features_generic_export($data, $export, $module_name, 'custom_breadcrumbs_views', $pipe);
}