You are here

function menu_install in Drupal 7

Same name and namespace in other branches
  1. 6 modules/menu/menu.install \menu_install()

Implements hook_install().

File

modules/menu/menu.install, line 46
Install, update and uninstall functions for the menu module.

Code

function menu_install() {
  $system_menus = menu_list_system_menus();
  $t = get_t();
  $descriptions = array(
    'navigation' => $t('The <em>Navigation</em> menu contains links intended for site visitors. Links are added to the <em>Navigation</em> menu automatically by some modules.'),
    'user-menu' => $t("The <em>User</em> menu contains links related to the user's account, as well as the 'Log out' link."),
    'management' => $t('The <em>Management</em> menu contains links for administrative tasks.'),
    'main-menu' => $t('The <em>Main</em> menu is used on many sites to show the major sections of the site, often in a top navigation bar.'),
  );
  foreach ($system_menus as $menu_name => $title) {
    $menu = array(
      'menu_name' => $menu_name,
      'title' => $t($title),
      'description' => $descriptions[$menu_name],
    );
    menu_save($menu);
  }
}