| 1 |
<?php
|
| 2 |
// $Id: menu_stp.install,v 1.1.2.1 2007/07/24 09:45:52 ray007 Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_install().
|
| 6 |
*/
|
| 7 |
function menu_stp_install() {
|
| 8 |
// Create tables.
|
| 9 |
drupal_install_schema('menu_stp');
|
| 10 |
|
| 11 |
// make sure we have more weight than "menu"
|
| 12 |
db_query("UPDATE {system} SET weight = 10 WHERE name = 'menu_stp'");
|
| 13 |
}
|
| 14 |
|
| 15 |
/**
|
| 16 |
* Implementation of hook_schema().
|
| 17 |
*/
|
| 18 |
function menu_stp_schema() {
|
| 19 |
$schema['menu_stp_roles'] = array(
|
| 20 |
'fields' => array(
|
| 21 |
'mlid' => array(
|
| 22 |
'type' => 'int',
|
| 23 |
'not null' => TRUE,
|
| 24 |
'default' => 0,
|
| 25 |
),
|
| 26 |
'rid' => array(
|
| 27 |
'type' => 'int',
|
| 28 |
'not null' => TRUE,
|
| 29 |
'default' => 0,
|
| 30 |
),
|
| 31 |
),
|
| 32 |
'indexes' => array(
|
| 33 |
'mlid' => array('mlid'),
|
| 34 |
'rid' => array('rid'),
|
| 35 |
),
|
| 36 |
'primary key' => array('mlid', 'rid'),
|
| 37 |
);
|
| 38 |
|
| 39 |
$schema['menu_stp_menu_roles'] = array(
|
| 40 |
'fields' => array(
|
| 41 |
'menu_name' => array(
|
| 42 |
'type' => 'varchar',
|
| 43 |
'length' => 32,
|
| 44 |
'not null' => TRUE,
|
| 45 |
'default' => '',
|
| 46 |
),
|
| 47 |
'rid' => array(
|
| 48 |
'type' => 'int',
|
| 49 |
'not null' => TRUE,
|
| 50 |
'default' => 0,
|
| 51 |
),
|
| 52 |
),
|
| 53 |
'indexes' => array(
|
| 54 |
'menu_name' => array('menu_name'),
|
| 55 |
'rid' => array('rid'),
|
| 56 |
),
|
| 57 |
'primary key' => array('menu_name', 'rid'),
|
| 58 |
);
|
| 59 |
|
| 60 |
return $schema;
|
| 61 |
}
|
| 62 |
|
| 63 |
/**
|
| 64 |
* Implementation of hook_uninstall().
|
| 65 |
*/
|
| 66 |
function menu_stp_uninstall() {
|
| 67 |
// Remove tables.
|
| 68 |
drupal_uninstall_schema('menu_stp');
|
| 69 |
}
|