Index: modules/block/block.install =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.install,v retrieving revision 1.10 diff -u -r1.10 block.install --- modules/block/block.install 16 Apr 2008 11:35:51 -0000 1.10 +++ modules/block/block.install 15 May 2008 11:32:10 -0000 @@ -6,112 +6,173 @@ */ function block_schema() { $schema['blocks'] = array( - 'description' => t('Stores block settings, such as region and visibility settings.'), + 'description' => t('Stores block\'s info and callbacks defined by enabled modules.'), 'fields' => array( - 'bid' => array( - 'type' => 'serial', + 'block_id' => array( + 'description' => t('Primary Key: the block unique identifier'), + 'type' => 'varchar', + 'length' => 255, 'not null' => TRUE, - 'description' => t('Primary Key: Unique block ID.'), + 'default' => '', ), 'module' => array( 'type' => 'varchar', - 'length' => 64, + 'length' => 255, 'not null' => TRUE, 'default' => '', 'description' => t("The module from which the block originates; for example, 'user' for the Who's Online block, and 'block' for any custom blocks."), ), - 'delta' => array( + 'block_name' => array( + 'description' => t('The human readable name of the block, as shown to the user in the block admin pages.'), 'type' => 'varchar', - 'length' => 32, + 'length' => 255, 'not null' => TRUE, - 'default' => '0', - 'description' => t('Unique ID for block within a module.'), + 'default' => '', ), - 'theme' => array( + 'description' => array( + 'description' => t('Provide a more descriptive information about the block.'), 'type' => 'varchar', - 'length' => 64, + 'length' => 255, 'not null' => TRUE, 'default' => '', - 'description' => t('The theme under which the block settings apply.'), ), - 'status' => array( + 'user_visibilty' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny', - 'description' => t('Block enabled status. (1 = enabled, 0 = disabled)'), + 'description' => t('Flag to indicate how users may control visibility of the block. (0 = Users cannot control, 1 = On by default, but can be hidden, 2 = Hidden by default, but can be shown)'), ), - 'weight' => array( + 'page_visibility' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny', - 'description' => t('Block weight within region.'), + 'description' => t('Flag to indicate how to show blocks on pages. (0 = Show on all pages except listed pages, 1 = Show only on listed pages, 2 = Use custom PHP code to determine visibility)'), ), - 'region' => array( + 'pages' => array( + 'type' => 'text', + 'not null' => TRUE, + 'description' => t('Contents of the "Pages" block; contains either a list of paths on which to include/exclude the block or PHP code, depending on "visibility" setting.'), + ), + 'cache' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 1, + 'size' => 'tiny', + 'description' => t('Binary flag to indicate block cache mode. (-1: Do not cache, 1: Cache per role, 2: Cache per user, 4: Cache per page, 8: Block cache global) See BLOCK_CACHE_* constants in block.module for more detailed information.'), + ), + 'title' => array( 'type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '', - 'description' => t('Theme region within which the block is set.'), + 'description' => t('Title for the block provided by modules through hook_blocks.)'), ), - 'custom' => array( - 'type' => 'int', + 'custom_title' => array( + 'type' => 'varchar', + 'length' => 64, 'not null' => TRUE, - 'default' => 0, - 'size' => 'tiny', - 'description' => t('Flag to indicate how users may control visibility of the block. (0 = Users cannot control, 1 = On by default, but can be hidden, 2 = Hidden by default, but can be shown)'), + 'default' => '', + 'description' => t('A custom title for the block that can be provided in the block admin pages (Empty string will use block default title, will remove the title, text will cause block to use specified custom title.)'), + ), + 'title_callback' => array( + 'description' => t('A function which will alter the title. Defaults to t()'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', ), - 'visibility' => array( - 'type' => 'int', + 'title_arguments' => array( + 'description' => t('A serialized array of arguments for the title callback. If empty, the title will be used as the sole argument for the title callback.'), + 'type' => 'varchar', + 'length' => 255, 'not null' => TRUE, - 'default' => 0, - 'size' => 'tiny', - 'description' => t('Flag to indicate how to show blocks on pages. (0 = Show on all pages except listed pages, 1 = Show only on listed pages, 2 = Use custom PHP code to determine visibility)'), + 'default' => '', + ), + 'block_callback' => array( + 'description' => t('Name of a function used to render the block on the system administration page for this item.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + 'default' => '', + ), + 'block_arguments' => array( + 'description' => t('A serialized array of arguments for the block callback.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'access_callback' => array( + 'description' => t('The callback which determines the access to this block. Defaults to user_access.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', ), - 'pages' => array( + 'access_arguments' => array( + 'description' => t('A serialized array of arguments for the access callback.'), 'type' => 'text', + 'not null' => FALSE, + ), + ), + 'primary key' => array('block_id'), + 'unique keys' => array( + 'name' => array('block_name'), + ), + ); + + $schema['blocks_regions'] = array( + 'description' => t('Maps blocks to themes and regions.'), + 'fields' => array( + 'block_id' => array( + 'description' => t('Primary Key: the block unique identifier.'), + 'type' => 'varchar', + 'length' => 255, 'not null' => TRUE, - 'description' => t('Contents of the "Pages" block; contains either a list of paths on which to include/exclude the block or PHP code, depending on "visibility" setting.'), + 'default' => '', ), - 'title' => array( + 'theme' => array( 'type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '', - 'description' => t('Custom title for the block. (Empty string will use block default title, will remove the title, text will cause block to use specified title.)'), + 'description' => t('The theme name under which the block is active.'), ), - 'cache' => array( + 'region' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + 'description' => t('Theme region within which the block is set.'), + ), + 'weight' => array( 'type' => 'int', 'not null' => TRUE, - 'default' => 1, + 'default' => 0, 'size' => 'tiny', - 'description' => t('Binary flag to indicate block cache mode. (-1: Do not cache, 1: Cache per role, 2: Cache per user, 4: Cache per page, 8: Block cache global) See BLOCK_CACHE_* constants in block.module for more detailed information.'), + 'description' => t('Block weight within region.'), ), ), - 'primary key' => array('bid'), + 'primary key' => array('block_id'), 'unique keys' => array( - 'tmd' => array('theme', 'module', 'delta'), - ), + 'btr' => array('block_id', 'theme', 'region') + ), 'indexes' => array( - 'list' => array('theme', 'status', 'region', 'weight', 'module'), - ), - ); + 'list' => array('theme', 'region', 'weight') + ) + ); $schema['blocks_roles'] = array( - 'description' => t('Sets up access permissions for blocks based on user roles'), + 'description' => t('Sets up access permissions for blocks based on user roles.'), 'fields' => array( - 'module' => array( - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - 'description' => t("The block's origin module, from {blocks}.module."), - ), - 'delta' => array( + 'block_id' => array( + 'description' => t('Primary Key: the block unique identifier'), 'type' => 'varchar', - 'length' => 32, + 'length' => 255, 'not null' => TRUE, - 'description' => t("The block's unique delta within module, from {blocks}.delta."), + 'default' => '', ), 'rid' => array( 'type' => 'int', @@ -120,7 +181,7 @@ 'description' => t("The user's role ID from {users_roles}.rid."), ), ), - 'primary key' => array('module', 'delta', 'rid'), + 'primary key' => array('block_id', 'rid'), 'indexes' => array( 'rid' => array('rid'), ), @@ -133,21 +194,34 @@ 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, - 'description' => t("The block's {blocks}.bid."), + 'description' => t("Primary key: The unique custom block (box) ID."), ), + 'block_name' => array( + 'description' => t('The human readable name of the block, as shown to the user in the block admin pages.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'description' => array( + 'description' => t('Provide a more descriptive information about the block.'), + 'type' => 'text', + 'not null' => TRUE, + 'default' => '', + ), + 'title' => array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + 'description' => t('Custom title for the block. (Empty string will use block default title, will remove the title, text will cause block to use specified title.)'), + ), 'body' => array( 'type' => 'text', 'not null' => FALSE, 'size' => 'big', 'description' => t('Block contents.'), ), - 'info' => array( - 'type' => 'varchar', - 'length' => 128, - 'not null' => TRUE, - 'default' => '', - 'description' => t('Block description.'), - ), 'format' => array( 'type' => 'int', 'size' => 'small', @@ -156,15 +230,16 @@ 'description' => t("Block body's {filter_formats}.format; for example, 1 = Filtered HTML."), ) ), + 'primary key' => array('bid'), 'unique keys' => array( - 'info' => array('info'), + 'name' => array('block_name'), ), - 'primary key' => array('bid'), ); $schema['cache_block'] = drupal_get_schema_unprocessed('system', 'cache'); - $schema['cache_block']['description'] = t('Cache table for the Block module to store already built blocks, identified by module, delta, and various contexts which may change the block, such as theme, locale, and caching mode defined for the block.'); + $schema['cache_block']['description'] = t('Cache table for the Block module to store already built blocks, identified by the block unique ID, and various contexts which may change the block, such as theme, locale, and caching mode defined for the block.'); return $schema; } +