-
Earl Miles authoredEarl Miles authored
delegator.install 4.77 KiB
<?php
// $Id$
/**
* @file
* Installation routines for delegator module.
*/
/**
* Implementation of hook_schema().
*/
function delegator_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 delegator_schema_1();
}
/**
* Schema version 1 for Panels in D6.
*/
function delegator_schema_1() {
$schema = array();
$schema['delegator_handlers'] = array(
'export' => array(
'identifier' => 'handler',
),
'fields' => array(
'did' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => t('Primary ID field for the table. Not used for anything except internal lookups.'),
'no export' => TRUE,
),
'name' => array(
'type' => 'varchar',
'length' => '255',
'description' => t('Unique ID for this task handler. Used to identify it programmatically.'),
),
'task' => array(
'type' => 'varchar',
'length' => '64',
'description' => t('ID of the task this handler is for.'),
),
'subtask' => array(
'type' => 'varchar',
'length' => '64',
'description' => t('ID of the subtask this handler is for.'),
'not null' => TRUE,
'default' => '',
),
'handler' => array(
'type' => 'varchar',
'length' => '64',
'description' => t('ID of the task handler being used.'),
),
'weight' => array(
'type' => 'int',
'description' => t('The order in which this handler appears. Lower numbers go first.'),
),
'conf' => array(
'type' => 'text',
'size' => 'big',
'description' => t('Serialized configuration of the handler, if needed.'),
'not null' => TRUE,
'serialize' => TRUE,
),
),
'primary key' => array('did'),
'unique keys' => array(
'name' => array('name'),
),
);
$schema['delegator_weights'] = array(
'description' => t('Contains override weights for delegator handlers that are in code.'),
'fields' => array(
'name' => array(
'type' => 'varchar',
'length' => '255',
'description' => t('Unique ID for this task handler. Used to identify it programmatically.'),
'not null' => TRUE,
'default' => '',
),
'weight' => array(
'type' => 'int',
'description' => t('The order in which this handler appears. Lower numbers go first.'),
),
),
'primary key' => array('name'),
'indexes' => array(
'weights' => array('name', 'weight'),
),
);
$schema['delegator_pages'] = array(
'description' => t('Contains page subtasks for implementing pages with arbitrary tasks.'),
'export' => array(
'identifier' => 'page',
),
'fields' => array(
'pid' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => t('Primary ID field for the table. Not used for anything except internal lookups.'),
'no export' => TRUE,
),
'name' => array(
'type' => 'varchar',
'length' => '255',
'description' => t('Unique ID for this subtask. Used to identify it programmatically.'),
),
'admin_title' => array(
'type' => 'varchar',
'length' => '255',
'description' => t('Human readable title for this page subtask.'),
),
'path' => array(
'type' => 'varchar',
'length' => '255',
'description' => t('The menu path that will invoke this task.'),
),
'access' => array(
'type' => 'text',
'size' => 'big',
'description' => t('Access configuration for this path.'),
'not null' => TRUE,
'serialize' => TRUE,
),
'multiple' => array(
'type' => 'int',
'size' => 'tiny',
'description' => t('True if the UI is set up to allow multiple handlers per page.'),
'default' => 0,
),
'menu' => array(
'type' => 'text',
'size' => 'big',
'description' => t('Serialized configuration of Drupal menu visibility settings for this item.'),
'not null' => TRUE,
'serialize' => TRUE,
),
'arguments' => array(
'type' => 'text',
'size' => 'big',
'description' => t('Configuration of arguments for this menu item.'),
'not null' => TRUE,
'serialize' => TRUE,
),
),
'primary key' => array('pid'),
'unique keys' => array(
'name' => array('name'),
),
);
return $schema;
}
/**
* Implementation of hook_install().
*/
function delegator_install() {
drupal_install_schema('delegator');
}
/**
* Implementation of hook_uninstall().
*/
function delegator_uninstall() {
drupal_uninstall_schema('delegator');
}