Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.80
diff -u -r1.80 block.admin.inc
--- modules/block/block.admin.inc	13 May 2010 07:53:02 -0000	1.80
+++ modules/block/block.admin.inc	19 Jun 2010 05:49:11 -0000
@@ -270,10 +270,10 @@
   );
 
   $access = user_access('use PHP for settings');
-  if (isset($block->visibility) && $block->visibility == 2 && !$access) {
+  if (isset($block->visibility) && $block->visibility == BLOCK_VISIBILITY_PHP && !$access) {
     $form['visibility']['path']['visibility'] = array(
       '#type' => 'value',
-      '#value' => 2,
+      '#value' => BLOCK_VISIBILITY_PHP,
     );
     $form['visibility']['path']['pages'] = array(
       '#type' => 'value',
@@ -282,13 +282,13 @@
   }
   else {
     $options = array(
-      t('All pages except those listed'),
-      t('Only the listed pages'),
+      BLOCK_VISIBILITY_NOTLISTED => t('All pages except those listed'),
+      BLOCK_VISIBILITY_LISTED => t('Only the listed pages'),
     );
     $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
 
     if (module_exists('php') && $access) {
-      $options[] = t('Pages on which this PHP code returns <code>TRUE</code> (experts only)');
+      $options += array(BLOCK_VISIBILITY_PHP => t('Pages on which this PHP code returns <code>TRUE</code> (experts only)'));
       $title = t('Pages or PHP code');
       $description .= ' ' . t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', array('%php' => '<?php ?>'));
     }
@@ -299,7 +299,7 @@
       '#type' => 'radios',
       '#title' => t('Show block on specific pages'),
       '#options' => $options,
-      '#default_value' => isset($block->visibility) ? $block->visibility : 0,
+      '#default_value' => isset($block->visibility) ? $block->visibility : BLOCK_VISIBILITY_NOTLISTED,
     );
     $form['visibility']['path']['pages'] = array(
       '#type' => 'textarea',
@@ -344,12 +344,12 @@
     '#type' => 'radios',
     '#title' => t('Customizable per user'),
     '#options' => array(
-      t('Not customizable'),
-      t('Customizable, visible by default'),
-      t('Customizable, hidden by default'),
+      BLOCK_CUSTOM_FIXED => t('Not customizable'),
+      BLOCK_CUSTOM_ENABLED => t('Customizable, visible by default'),
+      BLOCK_CUSTOM_DISABLED => t('Customizable, hidden by default'),
     ),
     '#description' => t('Allow individual users to customize the visibility of this block in their account settings.'),
-    '#default_value' => isset($block->custom) ? $block->custom : 0,
+    '#default_value' => isset($block->custom) ? $block->custom : BLOCK_CUSTOM_FIXED,
   );
 
   $form['actions'] = array('#type' => 'actions');
Index: modules/block/block.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.install,v
retrieving revision 1.41
diff -u -r1.41 block.install
--- modules/block/block.install	19 May 2010 19:14:43 -0000	1.41
+++ modules/block/block.install	19 Jun 2010 05:49:12 -0000
@@ -91,7 +91,7 @@
         'not null' => TRUE,
         'default' => 1,
         'size' => 'tiny',
-        'description' => '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' => 'Binary flag to indicate block cache mode. (-2: Custom cache, -1: Do not cache, 1: Cache per role, 2: Cache per user, 4: Cache per page, 8: Block cache global) See DRUPAL_CACHE_* constants in ../includes/common.inc for more detailed information.',
       ),
     ),
     'primary key' => array('bid'),
@@ -249,7 +249,7 @@
       'weight' => 0,
       'region' => 'help',
       'pages' => '',
-      'cache' => 1,
+      'cache' => DRUPAL_CACHE_PER_ROLE,
     ));
     // Add new system generated main page content block.
     $insert->values(array(
@@ -260,7 +260,7 @@
       'weight' => 0,
       'region' => 'content',
       'pages' => '',
-      'cache' => -1,
+      'cache' => DRUPAL_NO_CACHE,
     ));
   }
   $insert->execute();
@@ -296,9 +296,9 @@
         'status' => 1,
         'weight' => 5,
         'region' => 'help',
-        'visibility' => 1,
+        'visibility' => BLOCK_VISIBILITY_LISTED,
         'pages' => 'contact',
-        'cache' => -1,
+        'cache' => DRUPAL_NO_CACHE,
       ));
     }
     drupal_set_message('The contact form information setting was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the site-wide contact page. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right.');
@@ -319,9 +319,9 @@
         'status' => 1,
         'weight' => 5,
         'region' => 'help',
-        'visibility' => 1,
+        'visibility' => BLOCK_VISIBILITY_LISTED,
         'pages' => 'user/register',
-        'cache' => -1,
+        'cache' => DRUPAL_NO_CACHE,
       ));
     }
     drupal_set_message('The user registration guidelines were migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the user registration page. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right.');
@@ -342,9 +342,9 @@
         'status' => 1,
         'weight' => 0,
         'region' => 'highlight',
-        'visibility' => 1,
+        'visibility' => BLOCK_VISIBILITY_LISTED,
         'pages' => '<front>',
-        'cache' => -1,
+        'cache' => DRUPAL_NO_CACHE,
       ));
     }
     drupal_set_message('The site mission was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to only show on the front page in the highlighted content region. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right. If your theme does not have a highlighted content region, you might need to <a href="' . url('admin/structure/block') . '">relocate the block</a>.');
@@ -370,7 +370,7 @@
         'weight' => -10,
         'region' => 'footer',
         'pages' => '',
-        'cache' => -1,
+        'cache' => DRUPAL_NO_CACHE,
       ));
     }
     drupal_set_message('The footer message was migrated to <a href="' . url('admin/structure/block/manage/block/' . $bid . '/configure') . '">a custom block</a> and set up to appear in the footer. The block was set to use the default text format, which might differ from the HTML based format used before. Check the block and ensure that the output is right. If your theme does not have a footer region, you might need to <a href="' . url('admin/structure/block') . '">relocate the block</a>.');
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.424
diff -u -r1.424 block.module
--- modules/block/block.module	17 Jun 2010 13:16:57 -0000	1.424
+++ modules/block/block.module	19 Jun 2010 05:49:13 -0000
@@ -12,6 +12,36 @@
 define('BLOCK_REGION_NONE', -1);
 
 /**
+ * Users cannot control whether or not they see this block.
+ */
+define('BLOCK_CUSTOM_FIXED', 0);
+
+/**
+ *  Show this block by default, but let individual users hide it.
+ */
+define('BLOCK_CUSTOM_ENABLED', 1);
+
+/**
+ * Hide this block by default but let individual users show it.
+ */
+define('BLOCK_CUSTOM_DISABLED', 2);
+
+/**
+ * Show this block on every page except the listed pages.
+ */
+define('BLOCK_VISIBILITY_NOTLISTED', 0);
+
+/**
+ * Show this block on only the listed pages.
+ */
+define('BLOCK_VISIBILITY_LISTED', 1);
+
+/**
+ * Show this block if the associated PHP code returns TRUE.
+ */
+define('BLOCK_VISIBILITY_PHP', 2);
+
+/**
  * Implements hook_help().
  */
 function block_help($path, $arg) {
@@ -700,12 +730,12 @@
     }
 
     // Use the user's block visibility setting, if necessary.
-    if ($block->custom != 0) {
+    if ($block->custom != BLOCK_CUSTOM_FIXED) {
       if ($user->uid && isset($user->block[$block->module][$block->delta])) {
         $enabled = $user->block[$block->module][$block->delta];
       }
       else {
-        $enabled = ($block->custom == 1);
+        $enabled = ($block->custom == BLOCK_CUSTOM_ENABLED);
       }
     }
     else {
@@ -721,7 +751,7 @@
       // Convert path to lowercase. This allows comparison of the same path
       // with different case. Ex: /Page, /page, /PAGE.
       $pages = drupal_strtolower($block->pages);
-      if ($block->visibility < 2) {
+      if ($block->visibility < BLOCK_VISIBILITY_PHP) {
         // Convert the Drupal path to lowercase
         $path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
         // Compare the lowercase internal and lowercase path alias (if any).
@@ -729,9 +759,10 @@
         if ($path != $_GET['q']) {
           $page_match = $page_match || drupal_match_path($_GET['q'], $pages);
         }
-        // When $block->visibility has a value of 0, the block is displayed on
-        // all pages except those listed in $block->pages. When set to 1, it
-        // is displayed only on those pages listed in $block->pages.
+        // When $block->visibility has a value of 0 (BLOCK_VISIBILITY_NOTLISTED),
+        // the block is displayed on all pages except those listed in $block->pages.
+        // When set to 1 (BLOCK_VISIBILITY_LISTED), it is displayed only on those
+        // pages listed in $block->pages.
         $page_match = !($block->visibility xor $page_match);
       }
       elseif (module_exists('php')) {
