views_system.install in Views System 7.4
Same filename and directory in other branches
Install, update and uninstall functions for the views_system module.
File
views_system.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the views_system module.
*/
/**
* Implements hook_schema().
*/
function views_system_schema() {
$schema['views_system'] = array(
'description' => "Information from the module's and theme's .info file.",
'fields' => array(
'admin_theme' => array(
'description' => 'Boolean indicating whether or not this theme is the administration theme.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'base_theme' => array(
'description' => 'The base theme of this theme.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'configure' => array(
'description' => "The path of this module's (main) configuration page.",
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'core' => array(
'description' => 'The version of Drupal that this item is for.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'datestamp' => array(
'description' => 'The release date of this item.',
'type' => 'int',
'not null' => FALSE,
'default' => NULL,
),
'default_theme' => array(
'description' => 'Boolean indicating whether or not this theme is the default theme.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'dependencies' => array(
'description' => 'A list of other modules that this module requires.',
'type' => 'blob',
'not null' => FALSE,
),
'description' => array(
'description' => 'The brief description of this item.',
'type' => 'blob',
'not null' => FALSE,
),
'engine' => array(
'description' => 'The engine of this theme.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'features' => array(
'description' => 'A list of available features of this theme.',
'type' => 'blob',
'not null' => FALSE,
),
'filename' => array(
'description' => 'The filename of the primary file for this item; e.g. node.module.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'files' => array(
'description' => 'A list of files of this item.',
'type' => 'blob',
'not null' => FALSE,
),
'label' => array(
'description' => 'The human readable name of this item.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'mtime' => array(
'description' => 'The info file modification time of this item.',
'type' => 'int',
'not null' => FALSE,
'default' => NULL,
),
'operations' => array(
'description' => 'Operation links for this item.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'origin' => array(
'description' => 'The origin of this item, either core, contributed, or custom.',
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
),
'package' => array(
'description' => 'The name of the package this module belongs to.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'pathname' => array(
'description' => 'The path of the primary file for this item, relative to the Drupal root; e.g. modules/node/node.module.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'php' => array(
'description' => 'The minimum PHP version that this item requires.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'project' => array(
'description' => 'The name of the project this item belongs to.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'project_status_url' => array(
'description' => 'The URL to check for updates for this custom item.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'regions' => array(
'description' => 'A list of regions of this theme.',
'type' => 'blob',
'not null' => FALSE,
),
'regions_hidden' => array(
'description' => 'A list of hidden regions of this theme.',
'type' => 'blob',
'not null' => FALSE,
),
'required' => array(
'description' => 'Boolean indicating whether or not this item is absolutely required.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'required_by' => array(
'description' => 'A full list of other items that depends on this item.',
'type' => 'blob',
'not null' => FALSE,
),
'requires' => array(
'description' => 'A full list of other items that this item requires.',
'type' => 'blob',
'not null' => FALSE,
),
'screenshot' => array(
'description' => 'The thumbnail image of this theme.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'scripts' => array(
'description' => 'A list of JavaScript files of this item.',
'type' => 'blob',
'not null' => FALSE,
),
'settings' => array(
'description' => 'A list of settings of this theme.',
'type' => 'blob',
'not null' => FALSE,
),
'stylesheets' => array(
'description' => 'A list of stylesheets of this item.',
'type' => 'blob',
'not null' => FALSE,
),
'type' => array(
'description' => 'The type of the item, either module, theme, or theme_engine.',
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
),
'version' => array(
'description' => 'The version of this item.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'visible' => array(
'description' => 'Boolean indicating whether or not this item is visible on the modules and themes page.',
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
),
'primary key' => array(
'pathname',
),
'indexes' => array(
'origin_type_visible' => array(
'origin',
'type',
'visible',
),
),
);
return $schema;
}
/**
* Implements hook_enable().
*/
function views_system_enable() {
views_system_rebuild_module_data();
views_system_rebuild_theme_data();
}
/**
* Helper function to rebuild database table 'views_system'.
*/
function views_system_rebuild_schema() {
if (db_table_exists('views_system')) {
db_drop_table('views_system');
}
$schema = views_system_schema();
db_create_table('views_system', $schema['views_system']);
views_system_rebuild_module_data();
views_system_rebuild_theme_data();
}
/**
* Add column 'type' to database table 'views_system'.
*/
function views_system_update_7400() {
views_system_rebuild_schema();
}
/**
* Add columns 'pathname' and 'operations' to database table 'views_system'.
*/
function views_system_update_7401() {
views_system_rebuild_schema();
}
Functions
Name![]() |
Description |
---|---|
views_system_enable | Implements hook_enable(). |
views_system_rebuild_schema | Helper function to rebuild database table 'views_system'. |
views_system_schema | Implements hook_schema(). |
views_system_update_7400 | Add column 'type' to database table 'views_system'. |
views_system_update_7401 | Add columns 'pathname' and 'operations' to database table 'views_system'. |