-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathog_forum.install
68 lines (62 loc) · 1.5 KB
/
og_forum.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
<?php
/**
* $Id$
* @package OG_Forum
*/
/**
* Implementation of hook_install().
*/
function og_forum_install() {
// Create tables.
drupal_install_schema('og_forum');
}
/**
* Implementation of hook_schema().
*/
function og_forum_schema() {
$schema['og_term'] = array(
'fields' => array(
'tid' => array(
'type' => 'int',
'disp-width' => '10',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => '0'),
'nid' => array(
'type' => 'int',
'disp-width' => '10',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => '0'
),
'public' => array(
'type' => 'int',
'disp-width' => '1',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => '0'
),
),
'primary key' => array('tid','nid')
);
db_query("UPDATE {system} SET weight = %d WHERE name = '%s'", 2, 'og_forum');
$vid = variable_get('forum_nav_vocabulary', '');
db_query("UPDATE {vocabulary} SET weight = %d WHERE vid = %d", -10, $vid);
return $schema;
}
/**
* Implementation of hook_uninstall().
*/
function og_forum_uninstall() {
drupal_uninstall_schema('og_forum');
// Delete variables
$variables = array(
'forum_default_name', 'forum_default_container_yn', 'forum_default_container',
'forum_allow_public', 'forum_all_public', 'forum_auto_public',
'forum_limit',
'og_forum_display_group_forum_link',
);
foreach ($variables as $variable) {
variable_del($variable);
}
}