summaryrefslogtreecommitdiffstats
path: root/panels_page/panels_page.install
blob: b5c0413dd0ff87a0250f0820c4a38bb9dece1c3a (plain)
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<?php
// $Id$

/**
 * Install the panels tables
 */
function panels_page_schema() {
  return panels_page_schema_1();
}

/**
 * Schema version 1 for Panels in D6.
 */
function panels_page_schema_1() {
  $schema = array();

  $schema['panels_page'] = array(
    'description' => t('Holds the configuration data for panels pages.'),
    'fields' => array(
      'pid' => array(
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'did' => array(
        'type' => 'int',
        'default' => NULL,
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 128,
      ),
      'access' => array(
        'type' => 'varchar',
        'length' => 128,
        'storage_type' => 'implode',
      ),
      'path' => array(
        'type' => 'varchar',
        'length' => 128,
      ),
      'load_flags' => array(
        'description' => t('Bitval-as-integer metadata used in determining panel_page behavior at runtime.'),
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'css_id' => array(
        'type' => 'varchar',
        'length' => 128,
      ),
      'css' => array(
        'type' => 'text',
        'size' => 'big',
      ),
      'arguments' => array(
        'type' => 'text',
        'size' => 'big',
        'storage_type' => 'serialize',
      ),
      'displays' => array(
        'type' => 'text',
        'size' => 'big',
        'storage_type' => 'serialize',
      ),
      'contexts' => array(
        'type' => 'text',
        'size' => 'big',
        'storage_type' => 'serialize',
      ),
      'relationships' => array(
        'type' => 'text',
        'size' => 'big',
        'storage_type' => 'serialize',
      ),
      'no_blocks' => array(
        'type' => 'int',
        'size' => 'tiny',
        'default' => 0,
      ),
      'switcher_options' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => FALSE,
        'storage_type' => 'serialize',
      ),
      'switcher_name' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'switcher_type' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'menu' => array(
        'type' => 'int',
        'size' => 'tiny',
        'default' => 0,
      ),
      'menu_tab' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => FALSE,
      ),
      'menu_tab_weight' => array(
        'type' => 'int',
        'size' => 'tiny',
      ),
      'menu_title' => array(
        'type' => 'varchar',
        'length' => 255,
      ),
      'menu_tab_default' => array(
        'type' => 'int',
        'size' => 'small',
      ),
      'menu_tab_default_parent_type' => array(
        'type' => 'varchar',
        'length' => 10,
      ),
      'menu_parent_title' => array(
        'type' => 'varchar',
        'length' => 255,
      ),
      'menu_parent_tab_weight' => array(
        'type' => 'int',
        'size' => 'tiny',
      ),
    ),
    'primary key' => array('pid'),
    'unique keys' => array(
      'name' => array('name'),
    ),
    'indexes' => array(
      'path_idx' => array('path'),
      'did_idx' => array('did'),
    ),
  );
  // Straight copy from the menu schema; duping it for storage purposes.
  $schema['panels_page_router_store'] = array(
    'description' => t('Maps paths to various callbacks (access, page and title)'),
    'fields' => array(
      'path' => array(
        'description' => t('The Drupal path this entry describes.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'load_functions' => array(
        '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.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'to_arg_functions' => array(
        '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.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'access_callback' => array(
        'description' => t('The callback which determines the access to this router path. Defaults to user_access.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'access_arguments' => array(
        'description' => t('A serialized array of arguments for the access callback.'),
        'type' => 'text',
        'not null' => FALSE,
      ),
      'page_callback' => array(
        'description' => t('The name of the function that renders the page.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_arguments' => array(
        'description' => t('A serialized array of arguments for the page callback.'),
        'type' => 'text',
        'not null' => FALSE,
      ),
      'fit' => array(
        'description' => t('A numeric representation of how specific the path is.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'number_parts' => array(
        'description' => t('Number of parts in this router path.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'small',
      ),
      'tab_parent' => array(
        'description' => t('Only for local tasks (tabs) - the router path of the parent page (which may also be a local task).'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'tab_root' => array(
        '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.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'title' => array(
        'description' => t('The title for the current page, or the title for the tab if this is a local task.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'title_callback' => array(
        'description' => t('A function which will alter the title. Defaults to t()'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'title_arguments' => array(
        '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.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'type' => array(
        'description' => t('Numeric representation of the type of the menu item, like MENU_LOCAL_TASK.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'block_callback' => array(
        'description' => t('Name of a function used to render the block on the system administration page for this item.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'description' => t('A description of this item.'),
        'type' => 'text',
        'not null' => TRUE,
      ),
      'position' => array(
        'description' => t('The position of the block (left or right) on the system administration page for this item.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'weight' => array(
        'description' => t('Weight of the element. Lighter weights are higher up, heavier weights go down.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'file' => array(
        'description' => t('The file to include for this element, usually the page callback function lives in this file.'),
        'type' => 'text',
        'size' => 'medium',
      ),
    ),
    'indexes' => array(
      'fit_idx' => array('fit'),
      'number_parts_idx' => array('number_parts'),
      ),
    'primary key' => array('path'),
    );
  return $schema;
}

function panels_page_install() {
  db_query("UPDATE {system} SET weight = 15 WHERE name = 'panels_page'");
  drupal_install_schema('panels_page');
}

function panels_page_uninstall() {
  drupal_uninstall_schema('panels_page');
}