-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtac_lite.install
72 lines (66 loc) · 1.51 KB
/
tac_lite.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* @file
* Installation functions for tac_lite.
* TODO: All updates need proper error handling and responses
*/
/**
* Implementation of hook_install().
*
* Ensure that tac_lite hooks are invoked after taxonomy module hooks.
*/
function tac_lite_install() {
module_set_weight('tac_lite', 10);
}
/**
* Implements hook_uninstall().
*
* Clean up tac_lite variables.
*/
function tac_lite_uninstall() {
/*
for ($i = 1; $i <= variable_get('tac_lite_schemes', 1); $i++) {
variable_del('tac_lite_config_scheme_' . $i);
variable_del('tac_lite_grants_scheme_' . $i);
}
variable_del('tac_lite_schemes');
variable_del('tac_lite_categories');
*/
}
function tac_lite_schema() {
$schema = array();
$schema['tac_lite_user'] = array(
'fields' => array(
'scheme' => array(
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'uid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'tid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('scheme', 'uid', 'tid'),
'foreign keys' => array(
'user' => array(
'table' => 'users',
'columns' => array('uid' => 'uid'),
),
'term' => array(
'table' => 'taxonomy_term_data',
'columns' => array('tid' => 'tid'),
),
),
);
return $schema;
}