Code coverage for /20081101/modules/menu/menu.install

Line #Times calledCode
1
<?php
2
// $Id: menu.install,v 1.13 2008/09/18 10:44:19 dries Exp $
3
4
/**
5
 * Implementation of hook_install().
6
 */
712
function menu_install() {
8
  // Create tables.
9134
  drupal_install_schema('menu');
10
11134
  $t = get_t();
12134
  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.'));
13134
  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.'));
14134
  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.'));
15134
}
16
17
/**
18
 * Implementation of hook_uninstall().
19
 */
2012
function menu_uninstall() {
21
  // Remove tables.
220
  drupal_uninstall_schema('menu');
230
  menu_rebuild();
240
}
25
26
/**
27
 * Implementation of hook_schema().
28
 */
2912
function menu_schema() {
30134
  $schema['menu_custom'] = array(
31134
    'description' => t('Holds definitions for top-level custom menus (for
example, Main menu).'),
32
    'fields' => array(
33
      'menu_name' => array(
34134
        'type' => 'varchar',
35134
        'length' => 32,
36134
        'not null' => TRUE,
37134
        'default' => '',
38134
        'description' => t('Primary Key: Unique key for menu. This is used
as a block delta so length is 32.'),
39134
      ),
40
      'title' => array(
41134
        'type' => 'varchar',
42134
        'length' => 255,
43134
        'not null' => TRUE,
44134
        'default' => '',
45134
        'description' => t('Menu title; displayed at top of block.'),
46134
      ),
47
      'description' => array(
48134
        'type' => 'text',
49134
        'not null' => FALSE,
50134
        'description' => t('Menu description.'),
51134
      ),
52134
    ),
53134
    'primary key' => array('menu_name'),
54
  );
55
56134
  return $schema;
570
}
58
5912