/
exhibit.install
141 lines (133 loc) · 3.95 KB
/
exhibit.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
// $Id$
//////////////////////////////////////////////////////////////////////////////
// Core API hooks
/**
* Implementation of hook_enable().
*/
function exhibit_enable() {
drupal_set_message(t('Exhibit successfully installed. Please review the available <a href="@settings">configuration settings</a>.', array('@settings' => url('admin/settings/exhibit'))));
}
/**
* Implementation of hook_install().
*/
function exhibit_install() {
drupal_install_schema('exhibit');
// Default options: Promoted to front page = No
variable_set('node_options_exhibit', array('status'));
// Default comment setting: Disabled
variable_set('comment_exhibit', '0');
}
/**
* Implementation of hook_uninstall().
*/
function exhibit_uninstall() {
drupal_uninstall_schema('exhibit');
}
//////////////////////////////////////////////////////////////////////////////
// Schema API hooks
/**
* Implementation of hook_schema().
*/
function exhibit_schema() {
return array(
'exhibit_feeds' => array(
'description' => t('Stores exhibit data feed information.'),
'fields' => array(
'fid' => array(
'description' => t("The data feed's unique ID (primary key)."),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'module' => array(
'description' => t("The module providing the data feed."),
'type' => 'varchar',
'length' => 64,
'default' => '',
),
'title' => array(
'description' => t("The data feed's title."),
'type' => 'varchar',
'length' => 255,
'default' => '',
),
'enabled' => array(
'description' => t("The data feed's enabled status (1 = enabled, 0 = disabled)"),
'type' => 'int',
'not null' => TRUE,
'default' => 1,
'size' => 'tiny',
),
'cache' => array(
'description' => t("Binary flag to indicate the data feed's caching mode. (0 = Do not cache, 1 = Cache per role, 2 = Cache per user, 4 = Cache globally)"),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
),
'type' => array(
'description' => t("The data feed's MIME type."),
'type' => 'varchar',
'length' => 64,
'default' => '',
),
'url' => array(
'description' => t("The data feed's URL."),
'type' => 'text',
),
),
'primary key' => array('fid'),
),
'exhibit_nodes' => array(
'description' => t('Stores exhibit node data.'),
'fields' => array(
'nid' => array(
'description' => t("The node's ID from {node}.nid."),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'vid' => array(
'description' => t("The node's version ID from {node}.vid."),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'feeds' => array(
'description' => t("The exhibit's data feed IDs, as a comma-separated list."),
'type' => 'varchar',
'length' => 255,
'default' => '',
),
'definition' => array(
'description' => t("The exhibit's XHTML definition."),
'type' => 'text',
'size' => 'big',
),
'facet_definition' => array(
'description' => t("The exhibit's facet definition."),
'type' => 'text',
'size' => 'big',
),
),
'primary key' => array('nid', 'vid'),
),
);
}
/**
* Adds a facet definition field to the {exhibit_nodes} table.
*/
function exhibit_update_6001() {
db_add_field($ret, 'exhibit_nodes',
'facet_definition',
array(
'description' => t("The exhibit's facet definition."),
'type' => 'text',
'size' => 'big',
)
);
return array();
}