Newer
Older
Earl Miles
committed
<?php
// $Id$
/**
* Test requirements for installation and running.
*/
function panels_requirements($phase) {
$function = "panels_requirements_$phase";
return function_exists($function) ? $function() : array();
}
/**
* Check install-time requirements.
*/
function panels_requirements_install() {
$requirements = array();
$t = get_t();
// Assume that if the user is running an installation profile that both
// Panels and CTools are the same release.
if (!(defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install')) {
// apparently the install process doesn't include .module files,
// so we need to force the issue in order for our versioning
// check to work.
if (!defined('PANELS_REQUIRED_CTOOLS_API')) {
include_once drupal_get_path('module', 'panels') . '/panels.module';
}
// In theory we should check module_exists, but Drupal's gating should
// actually prevent us from getting here otherwise.
if (!defined('CTOOLS_API_VERSION')) {
include_once drupal_get_path('module', 'ctools') . '/ctools.module';
}
if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) {
$requirements['panels_ctools'] = array(
'title' => $t('CTools API Version'),
'value' => CTOOLS_API_VERSION,
'severity' => REQUIREMENT_ERROR,
'description' => t('The CTools API version is too old for Panels. Panels needs at least %version.', array('%version' => PANELS_REQUIRED_CTOOLS_API))
);
}
}
return $requirements;
}
Earl Miles
committed
/**
Earl Miles
committed
* Implementation of hook_schema().
Earl Miles
committed
*/
Earl Miles
committed
function panels_schema() {
// This should always point to our 'current' schema. This makes it relatively easy
// to keep a record of schema as we make changes to it.
return panels_schema_3();
}
/**
*/
function panels_schema_3() {
// Schema 3 is now locked. If you need to make changes, please create
// schema 4 and add them.
Earl Miles
committed
$schema = array();
$schema['panels_display'] = array(
'export' => array(
'object' => 'panels_display',
'bulk export' => FALSE,
'export callback' => 'panels_export_display',
'can disable' => FALSE,
'identifier' => 'display',
),
Earl Miles
committed
'fields' => array(
'did' => array(
'type' => 'serial',
'not null' => TRUE,
'no export' => TRUE,
Earl Miles
committed
),
'layout' => array(
'type' => 'varchar',
'length' => '32',
'default' => '',
Earl Miles
committed
),
'layout_settings' => array(
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'panel_settings' => array(
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'cache' => array(
'type' => 'text',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'title' => array(
'type' => 'varchar',
'length' => '255',
'default' => '',
Earl Miles
committed
),
'hide_title' => array(
'type' => 'int',
'size' => 'tiny',
'default' => 0,
'no export' => TRUE,
Earl Miles
committed
),
'title_pane' => array(
'type' => 'int',
'default' => 0,
'no export' => TRUE,
),
Earl Miles
committed
),
'primary key' => array('did'),
);
$schema['panels_pane'] = array(
'export' => array(
'can disable' => FALSE,
'identifier' => 'pane',
'bulk export' => FALSE,
),
Earl Miles
committed
'fields' => array(
'pid' => array(
'type' => 'serial',
'not null' => TRUE,
),
'did' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'no export' => TRUE,
Earl Miles
committed
),
'panel' => array(
'type' => 'varchar',
'length' => '32',
'default' => '',
Earl Miles
committed
),
'type' => array(
'type' => 'varchar',
'length' => '32',
'default' => '',
Earl Miles
committed
),
'subtype' => array(
'type' => 'varchar',
'length' => '64',
'default' => '',
Earl Miles
committed
),
'shown' => array(
'type' => 'int',
'size' => 'tiny',
'default' => 1,
),
'access' => array(
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'configuration' => array(
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'cache' => array(
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'style' => array(
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'css' => array(
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'extras' => array(
Earl Miles
committed
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'object default' => array(),
'initial ' => array(),
Earl Miles
committed
),
'position' => array(
Earl Miles
committed
'type' => 'int',
'size' => 'small',
'default' => 0,
Earl Miles
committed
),
),
'primary key' => array('pid'),
Earl Miles
committed
'indexes' => array(
'did_idx' => array('did')
Earl Miles
committed
),
Earl Miles
committed
);
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
$schema['panels_renderer_pipeline'] = array(
'description' => 'Contains renderer pipelines for Panels. Each pipeline contains one or more renderers and access rules to select which renderer gets used.',
'export' => array(
'identifier' => 'pipeline',
'bulk export' => TRUE,
'primary key' => 'rpid',
'api' => array(
'owner' => 'panels',
'api' => 'pipelines',
'minimum_version' => 1,
'current_version' => 1,
),
),
'fields' => array(
'rpid' => array(
'type' => 'serial',
'description' => 'A database primary key to ensure uniqueness.',
'not null' => TRUE,
'no export' => TRUE,
),
'name' => array(
'type' => 'varchar',
'length' => '255',
'description' => 'Unique ID for this content. Used to identify it programmatically.',
),
'admin_title' => array(
'type' => 'varchar',
'length' => '255',
'description' => 'Administrative title for this pipeline.',
),
'admin_description' => array(
'type' => 'text',
'size' => 'big',
'description' => 'Administrative description for this pipeline.',
'object default' => '',
),
'weight' => array(
'type' => 'int',
'size' => 'small',
'default' => 0,
),
'settings' => array(
'type' => 'text',
'size' => 'big',
'description' => 'Serialized settings for the actual pipeline. The contents of this field are up to the plugin that uses it.',
'serialize' => TRUE,
'object default' => array(),
),
),
'primary key' => array('rpid'),
);
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
$schema['panels_layout'] = array(
'description' => 'Contains exportable customized layouts for this site.',
'export' => array(
'identifier' => 'layout',
'bulk export' => TRUE,
'primary key' => 'lid',
'api' => array(
'owner' => 'panels',
'api' => 'layouts',
'minimum_version' => 1,
'current_version' => 1,
),
),
'fields' => array(
'lid' => array(
'type' => 'serial',
'description' => 'A database primary key to ensure uniqueness.',
'not null' => TRUE,
'no export' => TRUE,
),
'name' => array(
'type' => 'varchar',
'length' => '255',
'description' => 'Unique ID for this content. Used to identify it programmatically.',
),
'admin_title' => array(
'type' => 'varchar',
'length' => '255',
'description' => 'Administrative title for this layout.',
),
'admin_description' => array(
'type' => 'text',
'size' => 'big',
'description' => 'Administrative description for this layout.',
'object default' => '',
),
'category' => array(
'type' => 'varchar',
'length' => '255',
'description' => 'Administrative category for this layout.',
),
'plugin' => array(
'type' => 'varchar',
'length' => '255',
'description' => 'The layout plugin that owns this layout.',
),
'settings' => array(
'type' => 'text',
'size' => 'big',
'description' => 'Serialized settings for the actual layout. The contents of this field are up to the plugin that uses it.',
'serialize' => TRUE,
'object default' => array(),
),
),
'primary key' => array('lid'),
);