menu_rebuild

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 menu_rebuild()

(Re)populate the database tables used by various menu functions.

This function will clear and populate the {menu_router} table, add entries to {menu_links} for new router items, then remove stale items from {menu_links}. If called from update.php or install.php, it will also schedule a call to itself on the first real page load from menu_execute_active_handler(), because the maintenance page environment is different and leaves stale data in the menu tables.

Verwandte Themen

▾ 13 functions call menu_rebuild()

default_profile_tasks in profiles/default/default.profile
Perform any final installation tasks for this profile.
install_tasks in ./install.php
Tasks performed after the database is initialized.
menu_enable in modules/menu/menu.module
Implementation of hook_enable().
menu_execute_active_handler in includes/menu.inc
Execute the page callback associated with the current path
menu_uninstall in modules/menu/menu.install
Implementation of hook_uninstall().
node_types_rebuild in modules/node/node.module
Resets the database cache of node types, and saves all new or non-modified module-defined node types to the database.
profile_admin_overview_submit in modules/profile/profile.admin.inc
Submit handler to update changed profile field weights and categories.
profile_field_form_submit in modules/profile/profile.admin.inc
Process profile_field_form submissions.
system_themes_form_submit in modules/system/system.admin.inc
Process system_themes_form form submissions.
system_update_6021 in modules/system/system.install
Migrate the menu items from the old menu system to the new menu_links table.
system_update_6029 in modules/system/system.install
Enable the dblog module on sites that upgrade, since otherwise watchdog logging will stop unexpectedly.
update_uninstall in modules/update/update.install
Implementation of hook_uninstall().
_locale_import_po in includes/locale.inc
Parses Gettext Portable Object file information and inserts into database

Code

includes/menu.inc, line 1821

<?php
function menu_rebuild() {
  variable_del('menu_rebuild_needed');
  list($menu, $masks) = menu_router_build();
  _menu_router_save($menu, $masks);
  _menu_navigation_links_rebuild($menu);
  menu_cache_clear_all();
  // Clear the page and block caches.
  _menu_clear_page_cache();
  if (defined('MAINTENANCE_MODE')) {
    variable_set('menu_rebuild_needed', TRUE);
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen