#967734 by das-peter and intoxination: Upgrade node_get_types() in wizard.
[project/panels.git] / panels.install
1 <?php
2 // $Id$
3
4 /**
5 * Test requirements for installation and running.
6 */
7 function panels_requirements($phase) {
8 $function = "panels_requirements_$phase";
9 return function_exists($function) ? $function() : array();
10 }
11
12 /**
13 * Check install-time requirements.
14 */
15 function panels_requirements_install() {
16 $requirements = array();
17 $t = get_t();
18 // Assume that if the user is running an installation profile that both
19 // Panels and CTools are the same release.
20 if (!(defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install')) {
21 // apparently the install process doesn't include .module files,
22 // so we need to force the issue in order for our versioning
23 // check to work.
24 if (!defined('PANELS_REQUIRED_CTOOLS_API')) {
25 include_once drupal_get_path('module', 'panels') . '/panels.module';
26 }
27
28 // In theory we should check module_exists, but Drupal's gating should
29 // actually prevent us from getting here otherwise.
30 if (!defined('CTOOLS_API_VERSION')) {
31 include_once drupal_get_path('module', 'ctools') . '/ctools.module';
32 }
33 if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
34 $requirements['panels_ctools'] = array(
35 'title' => $t('CTools API Version'),
36 'value' => CTOOLS_API_VERSION,
37 'severity' => REQUIREMENT_ERROR,
38 'description' => t('The CTools API version is too old for Panels. Panels needs at least %version.', array('%version' => PANELS_REQUIRED_CTOOLS_API))
39 );
40 }
41 }
42 return $requirements;
43 }
44
45 /**
46 * Implementation of hook_schema().
47 */
48 function panels_schema() {
49 // This should always point to our 'current' schema. This makes it relatively easy
50 // to keep a record of schema as we make changes to it.
51 return panels_schema_3();
52 }
53
54 /**
55 * Schema from the D6 version.
56 */
57 function panels_schema_3() {
58 // Schema 3 is now locked. If you need to make changes, please create
59 // schema 4 and add them.
60 $schema = array();
61
62 $schema['panels_display'] = array(
63 'export' => array(
64 'object' => 'panels_display',
65 'bulk export' => FALSE,
66 'export callback' => 'panels_export_display',
67 'can disable' => FALSE,
68 'identifier' => 'display',
69 ),
70 'fields' => array(
71 'did' => array(
72 'type' => 'serial',
73 'not null' => TRUE,
74 'no export' => TRUE,
75 ),
76 'layout' => array(
77 'type' => 'varchar',
78 'length' => '32',
79 'default' => '',
80 ),
81 'layout_settings' => array(
82 'type' => 'text',
83 'size' => 'big',
84 'serialize' => TRUE,
85 'object default' => array(),
86 'initial ' => array(),
87 ),
88 'panel_settings' => array(
89 'type' => 'text',
90 'size' => 'big',
91 'serialize' => TRUE,
92 'object default' => array(),
93 'initial ' => array(),
94 ),
95 'cache' => array(
96 'type' => 'text',
97 'serialize' => TRUE,
98 'object default' => array(),
99 'initial ' => array(),
100 ),
101 'title' => array(
102 'type' => 'varchar',
103 'length' => '255',
104 'default' => '',
105 ),
106 'hide_title' => array(
107 'type' => 'int',
108 'size' => 'tiny',
109 'default' => 0,
110 'no export' => TRUE,
111 ),
112 'title_pane' => array(
113 'type' => 'int',
114 'default' => 0,
115 'no export' => TRUE,
116 ),
117 ),
118 'primary key' => array('did'),
119 );
120
121 $schema['panels_pane'] = array(
122 'export' => array(
123 'can disable' => FALSE,
124 'identifier' => 'pane',
125 'bulk export' => FALSE,
126 ),
127 'fields' => array(
128 'pid' => array(
129 'type' => 'serial',
130 'not null' => TRUE,
131 ),
132 'did' => array(
133 'type' => 'int',
134 'not null' => TRUE,
135 'default' => 0,
136 'no export' => TRUE,
137 ),
138 'panel' => array(
139 'type' => 'varchar',
140 'length' => '32',
141 'default' => '',
142 ),
143 'type' => array(
144 'type' => 'varchar',
145 'length' => '32',
146 'default' => '',
147 ),
148 'subtype' => array(
149 'type' => 'varchar',
150 'length' => '64',
151 'default' => '',
152 ),
153 'shown' => array(
154 'type' => 'int',
155 'size' => 'tiny',
156 'default' => 1,
157 ),
158 'access' => array(
159 'type' => 'text',
160 'size' => 'big',
161 'serialize' => TRUE,
162 'object default' => array(),
163 'initial ' => array(),
164 ),
165 'configuration' => array(
166 'type' => 'text',
167 'size' => 'big',
168 'serialize' => TRUE,
169 'object default' => array(),
170 'initial ' => array(),
171 ),
172 'cache' => array(
173 'type' => 'text',
174 'size' => 'big',
175 'serialize' => TRUE,
176 'object default' => array(),
177 'initial ' => array(),
178 ),
179 'style' => array(
180 'type' => 'text',
181 'size' => 'big',
182 'serialize' => TRUE,
183 'object default' => array(),
184 'initial ' => array(),
185 ),
186 'css' => array(
187 'type' => 'text',
188 'size' => 'big',
189 'serialize' => TRUE,
190 'object default' => array(),
191 'initial ' => array(),
192 ),
193 'extras' => array(
194 'type' => 'text',
195 'size' => 'big',
196 'serialize' => TRUE,
197 'object default' => array(),
198 'initial ' => array(),
199 ),
200 'position' => array(
201 'type' => 'int',
202 'size' => 'small',
203 'default' => 0,
204 ),
205 ),
206 'primary key' => array('pid'),
207 'indexes' => array(
208 'did_idx' => array('did')
209 ),
210 );
211
212 $schema['panels_renderer_pipeline'] = array(
213 'description' => 'Contains renderer pipelines for Panels. Each pipeline contains one or more renderers and access rules to select which renderer gets used.',
214 'export' => array(
215 'identifier' => 'pipeline',
216 'bulk export' => TRUE,
217 'primary key' => 'rpid',
218 'api' => array(
219 'owner' => 'panels',
220 'api' => 'pipelines',
221 'minimum_version' => 1,
222 'current_version' => 1,
223 ),
224 ),
225 'fields' => array(
226 'rpid' => array(
227 'type' => 'serial',
228 'description' => 'A database primary key to ensure uniqueness.',
229 'not null' => TRUE,
230 'no export' => TRUE,
231 ),
232 'name' => array(
233 'type' => 'varchar',
234 'length' => '255',
235 'description' => 'Unique ID for this content. Used to identify it programmatically.',
236 ),
237 'admin_title' => array(
238 'type' => 'varchar',
239 'length' => '255',
240 'description' => 'Administrative title for this pipeline.',
241 ),
242 'admin_description' => array(
243 'type' => 'text',
244 'size' => 'big',
245 'description' => 'Administrative description for this pipeline.',
246 'object default' => '',
247 ),
248 'weight' => array(
249 'type' => 'int',
250 'size' => 'small',
251 'default' => 0,
252 ),
253 'settings' => array(
254 'type' => 'text',
255 'size' => 'big',
256 'description' => 'Serialized settings for the actual pipeline. The contents of this field are up to the plugin that uses it.',
257 'serialize' => TRUE,
258 'object default' => array(),
259 ),
260 ),
261 'primary key' => array('rpid'),
262 );
263
264 $schema['panels_layout'] = array(
265 'description' => 'Contains exportable customized layouts for this site.',
266 'export' => array(
267 'identifier' => 'layout',
268 'bulk export' => TRUE,
269 'primary key' => 'lid',
270 'api' => array(
271 'owner' => 'panels',
272 'api' => 'layouts',
273 'minimum_version' => 1,
274 'current_version' => 1,
275 ),
276 ),
277 'fields' => array(
278 'lid' => array(
279 'type' => 'serial',
280 'description' => 'A database primary key to ensure uniqueness.',
281 'not null' => TRUE,
282 'no export' => TRUE,
283 ),
284 'name' => array(
285 'type' => 'varchar',
286 'length' => '255',
287 'description' => 'Unique ID for this content. Used to identify it programmatically.',
288 ),
289 'admin_title' => array(
290 'type' => 'varchar',
291 'length' => '255',
292 'description' => 'Administrative title for this layout.',
293 ),
294 'admin_description' => array(
295 'type' => 'text',
296 'size' => 'big',
297 'description' => 'Administrative description for this layout.',
298 'object default' => '',
299 ),
300 'category' => array(
301 'type' => 'varchar',
302 'length' => '255',
303 'description' => 'Administrative category for this layout.',
304 ),
305 'plugin' => array(
306 'type' => 'varchar',
307 'length' => '255',
308 'description' => 'The layout plugin that owns this layout.',
309 ),
310 'settings' => array(
311 'type' => 'text',
312 'size' => 'big',
313 'description' => 'Serialized settings for the actual layout. The contents of this field are up to the plugin that uses it.',
314 'serialize' => TRUE,
315 'object default' => array(),
316 ),
317 ),
318 'primary key' => array('lid'),
319 );
320
321 return $schema;
322 }
323