source: sipes/cord/modules/menu/menu.install @ 8a8efa8

stableversion-3.0
Last change on this file since 8a8efa8 was b354002, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio del cord

  • Propiedad mode establecida a 100755
File size: 2.1 KB
Línea 
1<?php
2
3/**
4 * Implementation of hook_install().
5 */
6function menu_install() {
7  // Create tables.
8  drupal_install_schema('menu');
9 
10  $t = get_t();
11  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.'));
12  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.'));
13  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'));
14}
15
16/**
17 * Implementation of hook_uninstall().
18 */
19function menu_uninstall() {
20  // Remove tables.
21  drupal_uninstall_schema('menu');
22  menu_rebuild();
23}
24
25/**
26 * Implementation of hook_schema().
27 */
28function menu_schema() {
29  $schema['menu_custom'] = array(
30    'description' => 'Holds definitions for top-level custom menus (for example, Primary Links).',
31    'fields' => array(
32      'menu_name' => array(
33        'type' => 'varchar',
34        'length' => 32,
35        'not null' => TRUE,
36        'default' => '',
37        'description' => 'Primary Key: Unique key for menu. This is used as a block delta so length is 32.',
38      ),
39      'title' => array(
40        'type' => 'varchar',
41        'length' => 255,
42        'not null' => TRUE,
43        'default' => '',
44        'description' => 'Menu title; displayed at top of block.',
45      ),
46      'description' => array(
47        'type' => 'text',
48        'not null' => FALSE,
49        'description' => 'Menu description.',
50      ),
51    ),
52    'primary key' => array('menu_name'),
53  );
54
55  return $schema;
56}
57
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.