Merging DRUPAL-6--2 back into HEAD before branching to DRUPAL-6--3.
[project/panels.git] / panels_page / panels_page.install
1 <?php
2 // $Id$
3
4 /**
5 * Install the panels tables
6 */
7 function panels_page_schema() {
8 return panels_page_schema_1();
9 }
10
11 /**
12 * Schema version 1 for Panels in D6.
13 */
14 function panels_page_schema_1() {
15 $schema = array();
16
17 $schema['panels_page'] = array(
18 'description' => t('Holds the configuration data for panels pages.'),
19 'fields' => array(
20 'pid' => array(
21 'type' => 'serial',
22 'not null' => TRUE,
23 ),
24 'name' => array(
25 'type' => 'varchar',
26 'length' => 128,
27 'not null' => TRUE,
28 'default' => '',
29 ),
30 'did' => array(
31 'type' => 'int',
32 'default' => NULL,
33 ),
34 'title' => array(
35 'type' => 'varchar',
36 'length' => 128,
37 ),
38 'access' => array(
39 'type' => 'varchar',
40 'length' => 128,
41 'storage_type' => 'implode',
42 ),
43 'path' => array(
44 'type' => 'varchar',
45 'length' => 128,
46 ),
47 'load_flags' => array(
48 'description' => t('Bitval-as-integer metadata used in determining panel_page behavior at runtime.'),
49 'type' => 'int',
50 'size' => 'tiny',
51 'not null' => TRUE,
52 'default' => 0,
53 ),
54 'css_id' => array(
55 'type' => 'varchar',
56 'length' => 128,
57 ),
58 'css' => array(
59 'type' => 'text',
60 'size' => 'big',
61 ),
62 'arguments' => array(
63 'type' => 'text',
64 'size' => 'big',
65 'storage_type' => 'serialize',
66 ),
67 'displays' => array(
68 'type' => 'text',
69 'size' => 'big',
70 'storage_type' => 'serialize',
71 ),
72 'contexts' => array(
73 'type' => 'text',
74 'size' => 'big',
75 'storage_type' => 'serialize',
76 ),
77 'relationships' => array(
78 'type' => 'text',
79 'size' => 'big',
80 'storage_type' => 'serialize',
81 ),
82 'no_blocks' => array(
83 'type' => 'int',
84 'size' => 'tiny',
85 'default' => 0,
86 ),
87 'switcher_options' => array(
88 'type' => 'text',
89 'size' => 'big',
90 'not null' => FALSE,
91 'storage_type' => 'serialize',
92 ),
93 'switcher_name' => array(
94 'type' => 'varchar',
95 'length' => 128,
96 'not null' => FALSE,
97 ),
98 'switcher_type' => array(
99 'type' => 'varchar',
100 'length' => 128,
101 'not null' => FALSE,
102 ),
103 'menu' => array(
104 'type' => 'int',
105 'size' => 'tiny',
106 'default' => 0,
107 ),
108 'menu_tab' => array(
109 'type' => 'int',
110 'size' => 'tiny',
111 'not null' => FALSE,
112 ),
113 'menu_tab_weight' => array(
114 'type' => 'int',
115 'size' => 'tiny',
116 ),
117 'menu_title' => array(
118 'type' => 'varchar',
119 'length' => 255,
120 ),
121 'menu_tab_default' => array(
122 'type' => 'int',
123 'size' => 'small',
124 ),
125 'menu_tab_default_parent_type' => array(
126 'type' => 'varchar',
127 'length' => 10,
128 ),
129 'menu_parent_title' => array(
130 'type' => 'varchar',
131 'length' => 255,
132 ),
133 'menu_parent_tab_weight' => array(
134 'type' => 'int',
135 'size' => 'tiny',
136 ),
137 ),
138 'primary key' => array('pid'),
139 'unique keys' => array(
140 'name' => array('name'),
141 ),
142 'indexes' => array(
143 'path_idx' => array('path'),
144 'did_idx' => array('did'),
145 ),
146 );
147 // Straight copy from the menu schema; duping it for storage purposes.
148 $schema['panels_page_router_store'] = array(
149 'description' => t('Maps paths to various callbacks (access, page and title)'),
150 'fields' => array(
151 'path' => array(
152 'description' => t('The Drupal path this entry describes.'),
153 'type' => 'varchar',
154 'length' => 255,
155 'not null' => TRUE,
156 'default' => '',
157 ),
158 'load_functions' => array(
159 'description' => t('A serialized array of function names (like node_load) to be called to load an object corresponding to a part of the current path.'),
160 'type' => 'varchar',
161 'length' => 255,
162 'not null' => TRUE,
163 'default' => '',
164 ),
165 'to_arg_functions' => array(
166 'description' => t('A serialized array of function names (like user_uid_optional_to_arg) to be called to replace a part of the router path with another string.'),
167 'type' => 'varchar',
168 'length' => 255,
169 'not null' => TRUE,
170 'default' => '',
171 ),
172 'access_callback' => array(
173 'description' => t('The callback which determines the access to this router path. Defaults to user_access.'),
174 'type' => 'varchar',
175 'length' => 255,
176 'not null' => TRUE,
177 'default' => '',
178 ),
179 'access_arguments' => array(
180 'description' => t('A serialized array of arguments for the access callback.'),
181 'type' => 'text',
182 'not null' => FALSE,
183 ),
184 'page_callback' => array(
185 'description' => t('The name of the function that renders the page.'),
186 'type' => 'varchar',
187 'length' => 255,
188 'not null' => TRUE,
189 'default' => '',
190 ),
191 'page_arguments' => array(
192 'description' => t('A serialized array of arguments for the page callback.'),
193 'type' => 'text',
194 'not null' => FALSE,
195 ),
196 'fit' => array(
197 'description' => t('A numeric representation of how specific the path is.'),
198 'type' => 'int',
199 'not null' => TRUE,
200 'default' => 0,
201 ),
202 'number_parts' => array(
203 'description' => t('Number of parts in this router path.'),
204 'type' => 'int',
205 'not null' => TRUE,
206 'default' => 0,
207 'size' => 'small',
208 ),
209 'tab_parent' => array(
210 'description' => t('Only for local tasks (tabs) - the router path of the parent page (which may also be a local task).'),
211 'type' => 'varchar',
212 'length' => 255,
213 'not null' => TRUE,
214 'default' => '',
215 ),
216 'tab_root' => array(
217 'description' => t('Router path of the closest non-tab parent page. For pages that are not local tasks, this will be the same as the path.'),
218 'type' => 'varchar',
219 'length' => 255,
220 'not null' => TRUE,
221 'default' => '',
222 ),
223 'title' => array(
224 'description' => t('The title for the current page, or the title for the tab if this is a local task.'),
225 'type' => 'varchar',
226 'length' => 255,
227 'not null' => TRUE,
228 'default' => '',
229 ),
230 'title_callback' => array(
231 'description' => t('A function which will alter the title. Defaults to t()'),
232 'type' => 'varchar',
233 'length' => 255,
234 'not null' => TRUE,
235 'default' => '',
236 ),
237 'title_arguments' => array(
238 'description' => t('A serialized array of arguments for the title callback. If empty, the title will be used as the sole argument for the title callback.'),
239 'type' => 'varchar',
240 'length' => 255,
241 'not null' => TRUE,
242 'default' => '',
243 ),
244 'type' => array(
245 'description' => t('Numeric representation of the type of the menu item, like MENU_LOCAL_TASK.'),
246 'type' => 'int',
247 'not null' => TRUE,
248 'default' => 0,
249 ),
250 'block_callback' => array(
251 'description' => t('Name of a function used to render the block on the system administration page for this item.'),
252 'type' => 'varchar',
253 'length' => 255,
254 'not null' => TRUE,
255 'default' => '',
256 ),
257 'description' => array(
258 'description' => t('A description of this item.'),
259 'type' => 'text',
260 'not null' => TRUE,
261 ),
262 'position' => array(
263 'description' => t('The position of the block (left or right) on the system administration page for this item.'),
264 'type' => 'varchar',
265 'length' => 255,
266 'not null' => TRUE,
267 'default' => '',
268 ),
269 'weight' => array(
270 'description' => t('Weight of the element. Lighter weights are higher up, heavier weights go down.'),
271 'type' => 'int',
272 'not null' => TRUE,
273 'default' => 0,
274 ),
275 'file' => array(
276 'description' => t('The file to include for this element, usually the page callback function lives in this file.'),
277 'type' => 'text',
278 'size' => 'medium',
279 ),
280 ),
281 'indexes' => array(
282 'fit_idx' => array('fit'),
283 'number_parts_idx' => array('number_parts'),
284 ),
285 'primary key' => array('path'),
286 );
287 return $schema;
288 }
289
290 function panels_page_install() {
291 db_query("UPDATE {system} SET weight = 15 WHERE name = 'panels_page'");
292 drupal_install_schema('panels_page');
293 }
294
295 function panels_page_uninstall() {
296 drupal_uninstall_schema('panels_page');
297 }
298