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

Line #Times calledCode
1
<?php
2
// $Id: menu.install,v 1.12 2008/06/25 09:12:25 dries Exp $
3
4
/**
5
 * Implementation of hook_install().
6
 */
780
function menu_install() {
8
  // Create tables.
962
  drupal_install_schema('menu');
10
1162
  $t = get_t();
1262
  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.'));
1362
  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. A typical
representation of the Main menu would be tabs along the top.'));
1462
  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.'));
1562
}
16
17
/**
18
 * Implementation of hook_uninstall().
19
 */
2080
function menu_uninstall() {
21
  // Remove tables.
220
  drupal_uninstall_schema('menu');
230
  menu_rebuild();
240
}
25
26
/**
27
 * Implementation of hook_schema().
28
 */
2980
function menu_schema() {
3077
  $schema['menu_custom'] = array(
3177
    'description' => t('Holds definitions for top-level custom menus (for
example, Main menu).'),
32
    'fields' => array(
33
      'menu_name' => array(
3477
        'type' => 'varchar',
3577
        'length' => 32,
3677
        'not null' => TRUE,
3777
        'default' => '',
3877
        'description' => t('Primary Key: Unique key for menu. This is used
as a block delta so length is 32.'),
3977
      ),
40
      'title' => array(
4177
        'type' => 'varchar',
4277
        'length' => 255,
4377
        'not null' => TRUE,
4477
        'default' => '',
4577
        'description' => t('Menu title; displayed at top of block.'),
4677
      ),
47
      'description' => array(
4877
        'type' => 'text',
4977
        'not null' => FALSE,
5077
        'description' => t('Menu description.'),
5177
      ),
5277
    ),
5377
    'primary key' => array('menu_name'),
54
  );
55
5677
  return $schema;
570
}
58
5980