Newer
Older
<?php
// $Id$
/**
* Implementation of hook_install().
*/
function menu_install() {

Dries Buytaert
committed
// Create tables.
drupal_install_schema('menu');

Gábor Hojtsy
committed
$t = get_t();
db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'navigation', $t('Navigation'), $t('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.'));

Dries Buytaert
committed
db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'main-menu', $t('Main menu'), $t('The Main menu is often used by themes to show the major sections of a site.'));
db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'secondary-menu', $t('Secondary menu'), $t('The Secondary menu is often used for pages like legal notices, contact details, and other navigation items that play a lesser role than the Main menu.'));
}
/**
* Implementation of hook_uninstall().
*/
function menu_uninstall() {

Dries Buytaert
committed
// Remove tables.
drupal_uninstall_schema('menu');

Dries Buytaert
committed
/**
* Implementation of hook_schema().
*/
function menu_schema() {
$schema['menu_custom'] = array(

Dries Buytaert
committed
'description' => 'Holds definitions for top-level custom menus (for example, Main menu).',

Dries Buytaert
committed
'fields' => array(
'menu_name' => array(
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',

Dries Buytaert
committed
'description' => 'Primary Key: Unique key for menu. This is used as a block delta so length is 32.',
),
'title' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',

Dries Buytaert
committed
'description' => 'Menu title; displayed at top of block.',
),
'description' => array(
'type' => 'text',
'not null' => FALSE,

Dries Buytaert
committed
'description' => 'Menu description.',

Dries Buytaert
committed
),
'primary key' => array('menu_name'),
);
return $schema;
}