You are here

function menu_custom_features_export in Features 7.2

Same name and namespace in other branches
  1. 6 includes/features.menu.inc \menu_custom_features_export()
  2. 7 includes/features.menu.inc \menu_custom_features_export()

Implements hook_features_export().

File

includes/features.menu.inc, line 70
Features integration for 'menu' module.

Code

function menu_custom_features_export($data, &$export, $module_name = '') {

  // Default hooks are provided by the feature module so we need to add
  // it as a dependency.
  $export['dependencies']['features'] = 'features';
  $export['dependencies']['menu'] = 'menu';

  // Collect a menu to module map.
  $pipe = array();
  $map = features_get_default_map('menu_custom', 'menu_name');
  foreach ($data as $menu_name) {

    // If this menu is provided by a different module, add it as a dependency.
    if (isset($map[$menu_name]) && $map[$menu_name] != $module_name) {
      $export['dependencies'][$map[$menu_name]] = $map[$menu_name];
    }
    else {
      $export['features']['menu_custom'][$menu_name] = $menu_name;
    }
  }
  return $pipe;
}