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	14 May 2008 06:14:33 -0000
@@ -6,12 +6,14 @@
  */
 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',
+        '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',
@@ -20,40 +22,18 @@
         '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(
-        'type' => 'varchar',
-        'length' => 32,
-        'not null' => TRUE,
-        'default' => '0',
-        'description' => t('Unique ID for block within a module.'),
-      ),
-      'theme' => array(
+      'name' => array(
+        'description' => t('The human readable name of the block, as shown to the user in the block admin pages.'),
         'type' => 'varchar',
-        'length' => 64,
+        'length' => 255,
         'not null' => TRUE,
         'default' => '',
-        'description' => t('The theme under which the block settings apply.'),
-      ),
-      'status' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'size' => 'tiny',
-        'description' => t('Block enabled status. (1 = enabled, 0 = disabled)'),
-      ),
-      'weight' => array(
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-        'size' => 'tiny',
-        'description' => t('Block weight within region.'),
       ),
-      'region' => array(
-        'type' => 'varchar',
-        'length' => 64,
+      'description' => array(
+        'description' => t('Provide a more descriptive information about the block.'),
+        'type' => 'text',
         'not null' => TRUE,
         'default' => '',
-        'description' => t('Theme region within which the block is set.'),
       ),
       'custom' => array(
         'type' => 'int',
@@ -74,44 +54,118 @@
         '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('Custom title for the block. (Empty string will use block default title, <none> will remove the title, text will cause block to use specified title.)'),
+        'description' => t('Title for the block. It can be altered by other modules or modified in the block admin pages(Empty string will use block default title, <none> will remove the title, text will cause block to use specified title.)'),
       ),
-      'cache' => array(
-        'type' => 'int',
+      'title_callback' => array(
+        'description' => t('A function which will alter the title. Defaults to t()'),
+        'type' => 'varchar',
+        'length' => 255,
         '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.'),
+        'default' => '',
       ),
+      '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' => '',
+      ),      
+      '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' => '',
+      ),
+      'access_arguments' => array(
+        'description' => t('A serialized array of arguments for the access callback.'),
+        'type' => 'text',
+        'not null' => FALSE,
+      ),       
     ),
     'primary key' => array('bid'),
     'unique keys' => array(
-      'tmd' => array('theme', 'module', 'delta'),
+      'name' => array('name'),
     ),
-    'indexes' => array(
-      'list' => array('theme', 'status', 'region', 'weight', 'module'),
-    ),
-  );
 
-  $schema['blocks_roles'] = array(
-    'description' => t('Sets up access permissions for blocks based on user roles'),
+  );
+  
+  $schema['blocks_regions'] = array(
+    'description' => t('Maps blocks to themes and regions.'),
     'fields' => array(
-      'module' => array(
+      'bid' => array(
+        'description' => t('Primary Key: the block unique identifier.'),
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'theme' => array(
         'type' => 'varchar',
         'length' => 64,
         'not null' => TRUE,
-        'description' => t("The block's origin module, from {blocks}.module."),
+        'default' => '',
+        'description' => t('The theme name under which the block is active.'),
       ),
-      'delta' => 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' => 0,
+        'size' => 'tiny',
+        'description' => t('Block weight within region.'),
+      ),
+    ),
+    'primary key' => array('bid'),
+    'unique keys' => array(
+      'btr' => array('bid', 'theme', 'region')
+    ),    
+    'indexes' => array(
+      'list' => array('theme', 'region', 'weight')
+    )
+  );  
+
+  $schema['blocks_roles'] = array(
+    'description' => t('Sets up access permissions for blocks based on user roles.'),
+    'fields' => array(
+      'bid' => 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,34 +174,47 @@
         'description' => t("The user's role ID from {users_roles}.rid."),
       ),
     ),
-    'primary key' => array('module', 'delta', 'rid'),
+    'primary key' => array('bid'),
     'indexes' => array(
       'rid' => array('rid'),
     ),
   );
 
-  $schema['boxes'] = array(
+  $schema['blocks_custom'] = array(
     'description' => t('Stores contents of custom-made blocks.'),
     'fields' => array(
-      'bid' => array(
+      'bcid' => array(
         'type' => 'serial',
         'unsigned' => TRUE,
         'not null' => TRUE,
-        'description' => t("The block's {blocks}.bid."),
+        'description' => t("Primary key: The unique custom block (box) ID."),
       ),
+      '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, <none> 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',
@@ -157,14 +224,15 @@
       )
     ),
     'unique keys' => array(
-      'info' => array('info'),
+      'name' => array('name'),
     ),
-    'primary key' => array('bid'),
+    'primary key' => array('bcid'),
   );
 
   $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;
 }
 
+
