Index: modules/system/system.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.api.php,v
retrieving revision 1.193
diff -u -p -r1.193 system.api.php
--- modules/system/system.api.php	11 Sep 2010 14:35:13 -0000	1.193
+++ modules/system/system.api.php	11 Sep 2010 21:05:25 -0000
@@ -1639,6 +1639,33 @@ function hook_system_info_alter(&$info, 
 }
 
 /**
+ * Perform alterations on the list of available regions of a theme.
+ *
+ * This hook is invoked from system_region_list() and allows you to alter the
+ * available regions of a theme. Contrary to hook_system_info_alter(), this
+ * hook is invoked on every page request and its results are only statically
+ * cached for the current request.
+ *
+ * @param &$list
+ *   The list of available regions of a theme, as built by system_region_list().
+ * @param $theme_key
+ *   The name of the theme.
+ * @param $show
+ *   Whether system_region_list() is about to return all or only visible
+ *   regions. Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes
+ *   hidden regions.
+ *
+ * @see hook_system_info_alter()
+ */
+function hook_system_region_list_alter(&$list, $theme_key, $show) {
+  // A hypothetical 'sidebar_visible' field instance on the 'page' node type
+  // controls the 'sidebar' region.
+  if (($node = menu_get_object()) && $node->type == 'page' && !$node->sidebar_visible[LANGUAGE_NONE][0]['value']) {
+    unset($list[$theme_key][$show]['sidebar']);
+  }
+}
+
+/**
  * Define user permissions.
  *
  * This hook can supply permissions that the module defines, so that they
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.960
diff -u -p -r1.960 system.module
--- modules/system/system.module	11 Sep 2010 06:03:12 -0000	1.960
+++ modules/system/system.module	11 Sep 2010 19:16:45 -0000
@@ -2617,6 +2617,7 @@ function system_find_base_themes($themes
  * @param $show
  *   Possible values: REGIONS_ALL or REGIONS_VISIBLE. Visible excludes hidden
  *   regions.
+ *
  * @return
  *   An array of regions in the form $region['name'] = 'description'.
  */
@@ -2636,6 +2637,8 @@ function system_region_list($theme_key, 
         $list[$theme_key][$show][$name] = $label;
       }
     }
+    // Allow modules to alter the region list.
+    drupal_alter('system_region_list', $list, $theme_key, $show);
   }
   return $list[$theme_key][$show];
 }
