Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.49
diff -u -p -r1.49 block.admin.inc
--- modules/block/block.admin.inc	22 Aug 2009 14:34:18 -0000	1.49
+++ modules/block/block.admin.inc	23 Aug 2009 07:40:51 -0000
@@ -180,6 +180,8 @@ function _block_compare($a, $b) {
  * Menu callback; displays the block configuration form.
  */
 function block_admin_configure(&$form_state, $module = NULL, $delta = 0) {
+  drupal_add_js(drupal_get_path('module', 'block') . '/block.js');
+
   $form['module'] = array(
     '#type' => 'value',
     '#value' => $module,
@@ -220,12 +222,18 @@ function block_admin_configure(&$form_st
   if (isset($info[$delta])) {
     drupal_set_title(t("'%name' block", array('%name' => $info[$delta]['info'])), PASS_THROUGH);
   }
+  
+  // Visibility
+  $form['block_vis_settings'] = array(
+    '#type' => 'vertical_tabs',
+  );
 
   $form['page_vis_settings'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Page specific visibility settings'),
+    '#title' => t('Page visibility'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
+    '#group' => 'block_vis_settings',
   );
 
   $access = user_access('use PHP for settings');
@@ -264,9 +272,10 @@ function block_admin_configure(&$form_st
   $role_options = db_query('SELECT rid, name FROM {role} ORDER BY name')->fetchAllKeyed();
   $form['role_vis_settings'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Role specific visibility settings'),
+    '#title' => t('Role visibility'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
+    '#group' => 'block_vis_settings',
   );
   $form['role_vis_settings']['roles'] = array(
     '#type' => 'checkboxes',
@@ -283,9 +292,10 @@ function block_admin_configure(&$form_st
   ))->fetchCol();
   $form['content_type_vis_settings'] = array(
     '#type' => 'fieldset',
-    '#title' => t('Content type specific visibility settings'),
+    '#title' => t('Content type visibility'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
+    '#group' => 'block_vis_settings',
   );
   $form['content_type_vis_settings']['types'] = array(
     '#type' => 'checkboxes',
@@ -298,9 +308,10 @@ function block_admin_configure(&$form_st
   // Standard block configurations.
   $form['user_vis_settings'] = array(
     '#type' => 'fieldset',
-    '#title' => t('User specific visibility settings'),
+    '#title' => t('User visibility'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
+    '#group' => 'block_vis_settings',
   );
   $form['user_vis_settings']['custom'] = array(
     '#type' => 'radios',
Index: modules/block/block.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.js,v
retrieving revision 1.10
diff -u -p -r1.10 block.js
--- modules/block/block.js	4 Aug 2009 06:26:52 -0000	1.10
+++ modules/block/block.js	23 Aug 2009 07:40:52 -0000
@@ -1,6 +1,43 @@
 // $Id: block.js,v 1.10 2009/08/04 06:26:52 webchick Exp $
 (function ($) {
 
+Drupal.behaviors.blockVisibility = {
+  attach: function (context) {
+    // Provide the vertical tab summaries.
+    $('fieldset#edit-page-vis-settings', context).setSummary(function(context) {
+      var vals = [];
+      if ($('#edit-visibility-0', context).is(':checked')) {
+        vals.unshift(Drupal.t("Every page expect those listed."));
+      }
+      if ($('#edit-visibility-1', context).is(':checked')) {
+        vals.unshift(Drupal.t("Only the pages specified."));
+      }
+      return vals.join(', ');
+    });
+    $('fieldset#edit-role-vis-settings', context).setSummary(function(context) {
+      var vals = [];
+      $("input[type^='checkbox']:checked", context).parent().each(function() {
+        vals.push(Drupal.checkPlain($(this).text()));
+      });
+      return vals.join(', ');
+    });
+    $('fieldset#edit-content-type-vis-settings', context).setSummary(function(context) {
+      var vals = [];
+      $("input[type^='checkbox']:checked", context).parent().each(function() {
+        vals.push(Drupal.checkPlain($(this).text()));
+      });
+      return vals.join(', ');
+    });
+    $('fieldset#edit-user-vis-settings', context).setSummary(function(context) {
+      var vals = [];
+      $("input[type^='radio']:checked", context).parent().each(function() {
+        vals.push(Drupal.checkPlain($(this).text()));
+      });
+      return vals.join(', ');
+    });
+  }
+};
+
 /**
  * Move a block in the blocks table from one region to another via select list.
  *
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.362
diff -u -p -r1.362 block.module
--- modules/block/block.module	23 Aug 2009 01:05:10 -0000	1.362
+++ modules/block/block.module	23 Aug 2009 07:40:52 -0000
@@ -369,6 +369,14 @@ function _block_rehash() {
   return $blocks;
 }
 
+/**
+ * Get a box with a certain id.
+ *
+ * @param $bid
+ *   The id of the box to return.
+ * @return
+ *   The box.
+ */
 function block_box_get($bid) {
   return db_query("SELECT * FROM {box} WHERE bid = :bid", array(':bid' => $bid))->fetchAssoc();
 }
@@ -406,6 +414,16 @@ function block_box_form($edit = array())
   return $form;
 }
 
+/**
+ * Save a box with a certain id.
+ *
+ * @param $edit
+ *   Values of the fields body, info and body_format for this box.
+ * @param $delta
+ *   The id (block delta) of the box to save.
+ * @return
+ *   TRUE.
+ */
 function block_box_save($edit, $delta) {
   db_update('box')
     ->fields(array(
@@ -464,11 +482,16 @@ function block_user_validate(&$edit, $ac
 /**
  * Implement hook_form_FORM_ID_alter().
  */
-function block_form_system_themes_form_alter(&$form, &$form_state) {
+function block_form_alter(&$form, &$form_state, $form_id) {
   // This function needs to fire before the theme changes are recorded in the
   // database, otherwise it will populate the default list of blocks from the
   // new theme, which is empty.
-  array_unshift($form['#submit'], 'block_system_themes_form_submit');
+  if ($form_id == 'system_themes_form') {
+    array_unshift($form['#submit'], 'block_system_themes_form_submit');
+  }
+  elseif ($form_id == 'system_admin_theme_form') {
+    array_unshift($form['#submit'], 'block_system_admin_theme_form_submit');  
+  }
 }
 
 /**
@@ -483,6 +506,14 @@ function block_system_themes_form_submit
         }
       }
     }
+  }
+}
+
+/**
+ * Initialize blocks for admin theme.
+ */
+function block_system_admin_theme_form_submit(&$form, &$form_state) {
+  if ($form_state['values']['op'] == t('Save configuration')) {
     if ($form_state['values']['admin_theme'] && $form_state['values']['admin_theme'] !== variable_get('admin_theme', 0)) {
       // If we're changing themes, make sure the theme has its blocks initialized.
       $has_blocks = (bool) db_query_range('SELECT 1 FROM {block} WHERE theme = :theme', array(':theme' => $form_state['values']['admin_theme']), 0, 1)->fetchField();
Index: modules/block/block.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.test,v
retrieving revision 1.25
diff -u -p -r1.25 block.test
--- modules/block/block.test	3 Aug 2009 03:04:33 -0000	1.25
+++ modules/block/block.test	23 Aug 2009 07:40:53 -0000
@@ -293,7 +293,7 @@ class BlockAdminThemeTestCase extends Dr
 
     // Enable admin theme and confirm that tab is accessible.
     $edit['admin_theme'] = 'stark';
-    $this->drupalPost('admin/appearance', $edit, t('Save configuration'));
+    $this->drupalPost('admin/appearance/admin', $edit, t('Save configuration'));
     $this->drupalGet('admin/structure/block/list/stark');
     $this->assertResponse(200, t('The block admin page for the admin theme can be accessed'));
   }
