_menu_router_save

  1. drupal
    1. drupal7
Versionen
drupal7 _menu_router_save($menu, $masks)

Helper function to save data from menu_router_build() to the router table.

Verwandte Themen

▾ 1 function calls _menu_router_save()

menu_rebuild in includes/menu.inc
(Re)populate the database tables used by various menu functions.

Code

includes/menu.inc, line 2643

<?php
function _menu_router_save($menu, $masks) {
  // Delete the existing router since we have some data to replace it.
  db_delete('menu_router')->execute();

  // Prepare insert object.
  $insert = db_insert('menu_router')
    ->fields(array(
      'path',
      'load_functions',
      'to_arg_functions',
      'access_callback',
      'access_arguments',
      'page_callback',
      'page_arguments',
      'fit',
      'number_parts',
      'tab_parent',
      'tab_root',
      'title',
      'title_callback',
      'title_arguments',
      'type',
      'block_callback',
      'description',
      'position',
      'weight',
    ));

  foreach ($menu as $path => $item) {
    // Fill in insert object values.
    $insert->values(array(
      'path' => $item['path'],
      'load_functions' => $item['load_functions'],
      'to_arg_functions' => $item['to_arg_functions'],
      'access_callback' => $item['access callback'],
      'access_arguments' => serialize($item['access arguments']),
      'page_callback' => $item['page callback'],
      'page_arguments' => serialize($item['page arguments']),
      'fit' => $item['_fit'],
      'number_parts' => $item['_number_parts'],
      'tab_parent' => $item['tab_parent'],
      'tab_root' => $item['tab_root'],
      'title' => $item['title'],
      'title_callback' => $item['title callback'],
      'title_arguments' => ($item['title arguments'] ? serialize($item['title arguments']) : ''),
      'type' => $item['type'],
      'block_callback' => $item['block callback'],
      'description' => $item['description'],
      'position' => $item['position'],
      'weight' => $item['weight'],
    ));
  }
  // Execute insert object.
  $insert->execute();
  // Store the masks.
  variable_set('menu_masks', $masks);

  return $menu;
}
?>

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