Spike PHPCoverage Details: menu.install

Line #FrequencySource Line
1 <?php
2 // $Id: menu.install,v 1.11 2008/03/14 08:54:31 dries Exp $
3 
4 /**
5  * Implementation of hook_install().
6  */
7 function menu_install() {
8   // Create tables.
91  drupal_install_schema('menu');
10 
111  $t = get_t();
121  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.'));
131  db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'primary-links', $t('Primary links'), $t('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.'));
141  db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'secondary-links', $t('Secondary links'), $t('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.'));
15 }
16 
17 /**
18  * Implementation of hook_uninstall().
19  */
20 function menu_uninstall() {
21   // Remove tables.
22   drupal_uninstall_schema('menu');
23   menu_rebuild();
24 }
25 
26 /**
27  * Implementation of hook_schema().
28  */
29 function menu_schema() {
30   $schema['menu_custom'] = array(
311    'description' => t('Holds definitions for top-level custom menus (for example, Primary Links).'),
32     'fields' => array(
33       'menu_name' => array(
34         'type' => 'varchar',
35         'length' => 32,
36         'not null' => TRUE,
37         'default' => '',
38         'description' => t('Primary Key: Unique key for menu. This is used as a block delta so length is 32.'),
39       ),
40       'title' => array(
41         'type' => 'varchar',
42         'length' => 255,
43         'not null' => TRUE,
44         'default' => '',
45         'description' => t('Menu title; displayed at top of block.'),
46       ),
47       'description' => array(
48         'type' => 'text',
49         'not null' => FALSE,
50         'description' => t('Menu description.'),
51       ),
52     ),
53     'primary key' => array('menu_name'),
54   );
55 
561  return $schema;
57 }
58