You are here

function defaultconfig_component_rebuild_menu_custom in Default config 7

Provision menus that should exist by default.

1 string reference to 'defaultconfig_component_rebuild_menu_custom'
defaultconfig_defaultconfig_components in ./defaultconfig.module
Implements hook_defaultconfig_components().

File

./defaultconfig.module, line 127
main module file.

Code

function defaultconfig_component_rebuild_menu_custom(array $info, $defaults, $module = FALSE) {
  foreach ($defaults as $menu) {

    // Only save the menu if it doesn't already exist.
    $existing = menu_load($menu['menu_name']);
    if (empty($existing)) {
      menu_save($menu);
    }
  }
}