You are here

function analytics_features_export_alter in Analytics 7

Implements hook_features_export_alter().

File

./analytics.module, line 252

Code

function analytics_features_export_alter(&$export, $module_name) {
  if (!empty($export['features']['analytics_service'])) {
    ctools_include('export');
    $services = ctools_export_crud_load_multiple('analytics_service', $export['features']['analytics_service']);
    foreach ($services as $service) {

      // Add the service's module as a dependency.
      if ($info = analytics_get_service_info($service->service)) {
        $export['dependencies'][$info['module']] = $info['module'];
      }
    }

    // Ensure the dependencies list is still sorted alphabetically.
    ksort($export['dependencies']);
  }
}