View source
<?php
function delta_install() {
drupal_install_schema('delta');
}
function delta_uninstall() {
drupal_uninstall_schema('delta');
db_query("DELETE FROM {menu_links} WHERE module = 'delta'");
db_query("DELETE FROM {menu_links} WHERE link_path = 'admin/build/delta-theme-settings'");
menu_cache_clear_all();
variable_del('delta_themes');
}
function delta_schema() {
$schema['delta_theme_settings'] = array(
'description' => t('Stores theme-settings templates that allow overriding the theme settings used based on various contexts.'),
'fields' => array(
'tid' => array(
'description' => t('Theme Settings Template ID'),
'type' => 'serial',
'not null' => TRUE,
),
'name' => array(
'description' => t('Friendly name for this template'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'theme' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'data' => array(
'description' => t('Serialized data which is a copy of the theme settings array stored in the system table based on these overrides'),
'type' => 'text',
'not null' => TRUE,
),
),
'primary key' => array(
'tid',
),
);
$schema['delta_theme_overrides'] = array(
'description' => t('Override criteria for when to display an alternate theme settings template.'),
'fields' => array(
'did' => array(
'description' => t('Delta ID'),
'type' => 'serial',
'not null' => TRUE,
),
'tid' => array(
'description' => t('Template ID'),
'type' => 'int',
'not null' => TRUE,
),
'system_name' => array(
'description' => t('usable system name'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'name' => array(
'description' => t('readable pretty name'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'value' => array(
'description' => t('the stored serialized array of theme-settings'),
'type' => 'text',
'not null' => TRUE,
),
'weight' => array(
'description' => t('the priority weight of the override. Allows multiple overrides to apply to same content, then determines which takes priority.'),
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'theme' => array(
'description' => t('TODO: please describe this field!'),
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
),
'primary key' => array(
'did',
),
);
return $schema;
}