summaryrefslogtreecommitdiff
path: root/modules/menu
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-05-27 20:31:13 +0000
committerDries Buytaert <dries@buytaert.net>2007-05-27 20:31:13 +0000
commita8ceb7613b808c1b6643e910f96dc7319012bf67 (patch)
tree3965e8935437879f60b6cdddc995cf27282d5567 /modules/menu
parent860947d3c87e8ebd53031ac8077d1dce24716e32 (diff)
downloadbrdo-a8ceb7613b808c1b6643e910f96dc7319012bf67.tar.gz
brdo-a8ceb7613b808c1b6643e910f96dc7319012bf67.tar.bz2
- Patch #145058 by pwolanin (and chx): re-parenting and caching for menu links.
Diffstat (limited to 'modules/menu')
-rw-r--r--modules/menu/menu.install3
-rw-r--r--modules/menu/menu.schema66
2 files changed, 8 insertions, 61 deletions
diff --git a/modules/menu/menu.install b/modules/menu/menu.install
index 8bb15c92b..6d113a849 100644
--- a/modules/menu/menu.install
+++ b/modules/menu/menu.install
@@ -7,6 +7,9 @@
function menu_install() {
// Create tables.
drupal_install_schema('menu');
+ db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('navigation', 'Navigation', 'The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.')");
+ db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('primary_links', 'Primary links', 'Primary links are often used at the theme layer to show the major sections of a site. A typical representation for primary links would be tabs along the top.')");
+ db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('secondary_links', 'Secondary links', 'Secondary links are often used for pages like legal notices, contact details, and other secondary navigation items that play a lesser role than primary links')");
}
/**
diff --git a/modules/menu/menu.schema b/modules/menu/menu.schema
index 0d1133caa..289ccf0f0 100644
--- a/modules/menu/menu.schema
+++ b/modules/menu/menu.schema
@@ -2,71 +2,15 @@
// $Id$
function menu_schema() {
- $schema['menu_router'] = array(
+ $schema['menu_custom'] = array(
'fields' => array(
- 'path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'load_functions' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'to_arg_functions' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'access_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'access_arguments' => array('type' => 'text', 'not null' => FALSE),
- 'page_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'page_arguments' => array('type' => 'text', 'not null' => FALSE),
- 'fit' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'number_parts' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'tab_parent' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'tab_root' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'title_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'title_arguments' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'type' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'block_callback' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'description' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'position' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'file' => array('type' => 'text', 'size' => 'medium')
+ 'menu_name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
+ 'description' => array('type' => 'text', 'not null' => FALSE),
),
- 'indexes' => array(
- 'fit' => array('fit'),
- 'tab_parent' => array('tab_parent')
- ),
- 'primary key' => array('path'),
+ 'primary key' => array('menu_name'),
);
- $schema['menu_links'] = array(
- 'fields' => array(
- 'menu_name' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''),
- 'mlid' => array('type' => 'serial', 'not null' => TRUE),
- 'plid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'href' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'router_path' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'hidden' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'),
- 'external' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'),
- 'has_children' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'expanded' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'small'),
- 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'depth' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'p1' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'p2' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'p3' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'p4' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'p5' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'p6' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
- 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => 'system'),
- 'link_title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''),
- 'options' => array('type' => 'text', 'not null' => FALSE)
- ),
- 'indexes' => array(
- 'expanded_children' => array('expanded', 'has_children'),
- 'menu_name_path' => array('menu_name', 'href'),
- 'parents' => array('plid', 'p1', 'p2', 'p3', 'p4', 'p5')
- ),
- 'primary key' => array('mlid'),
- );
-
- $schema['cache_menu'] = drupal_get_schema_unprocessed('system', 'cache');
-
return $schema;
}
-
-