? 504448-after-with-perm.png
? 504448-after-without-perm.png
? 504448-before.png
? docs
? modules/syndication
? sites/all/modules/admin_menu
? sites/all/modules/cck
? sites/all/modules/coder
? sites/all/modules/cvs_deploy
? sites/all/modules/demo
? sites/all/modules/devel
? sites/all/modules/drush
? sites/all/modules/google_analytics
? sites/all/modules/mollom
? sites/all/modules/path_redirect
? sites/all/modules/pbs
? sites/all/modules/plugin_manager
? sites/all/modules/robotstxt
? sites/all/modules/sandbox
Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.45
diff -u -p -r1.45 block.admin.inc
--- modules/block/block.admin.inc	14 Jul 2009 10:22:17 -0000	1.45
+++ modules/block/block.admin.inc	14 Jul 2009 20:40:02 -0000
@@ -197,39 +197,37 @@ function block_admin_configure(&$form_st
     drupal_set_title(t("'%name' block", array('%name' => $info[$delta]['info'])), PASS_THROUGH);
   }
 
+  // Add JavaScript to hide the pages fieldset of the show always option is set.
+  drupal_add_js(drupal_get_path('module', 'block') . '/block.js');
+  drupal_add_js(array('block' => array('visibilityPageAlways' => BLOCK_VISIBILITY_PAGE_ALWAYS)), 'setting');
+
   $form['page_vis_settings'] = array(
     '#type' => 'fieldset',
     '#title' => t('Page specific visibility settings'),
     '#collapsible' => TRUE,
     '#collapsed' => TRUE,
   );
+  $form['page_vis_settings']['visibility'] = array(
+    '#type' => 'radios',
+    '#title' => t('Show this block'),
+    '#options' => array(
+      BLOCK_VISIBILITY_PAGE_ALWAYS => t('on every page.'),
+      BLOCK_VISIBILITY_PAGE_EXCLUDE => t('on every page except those specified below.'),
+      BLOCK_VISIBILITY_PAGE_INCLUDE => t('on only the pages specified below.'),
+    ),
+    '#default_value' => $edit['visibility'],
+    '#access' => user_access('use PHP for settings') || $edit['visibility'] != BLOCK_VISIBILITY_PAGE_PHP,
+  );
+  $form['page_vis_settings']['pages'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Pages'),
+    '#default_value' => $edit['pages'],
+    '#description' => t("Enter one page per line as Drupal paths. 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>')),
+  );
 
-  $access = user_access('use PHP for settings');
-  if ($edit['visibility'] == 2 && !$access) {
-    $form['page_vis_settings'] = array();
-    $form['page_vis_settings']['visibility'] = array('#type' => 'value', '#value' => 2);
-    $form['page_vis_settings']['pages'] = array('#type' => 'value', '#value' => $edit['pages']);
-  }
-  else {
-    $options = array(t('Every page except those specified below.'), t('Only the pages specified below.'));
-    $description = t("Enter one page per line as Drupal paths. 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('Show if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).');
-      $description .= ' ' . t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '<?php ?>'));
-    }
-    $form['page_vis_settings']['visibility'] = array(
-      '#type' => 'radios',
-      '#title' => t('Show block on specific pages'),
-      '#options' => $options,
-      '#default_value' => $edit['visibility'],
-    );
-    $form['page_vis_settings']['pages'] = array(
-      '#type' => 'textarea',
-      '#title' => t('Pages'),
-      '#default_value' => $edit['pages'],
-      '#description' => $description,
-    );
+  if (module_exists('php') && user_access('use PHP for settings')) {
+    $form['page_vis_settings']['visibility']['#options'][BLOCK_VISIBILITY_PAGE_PHP] = t('if the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).');
+    $form['page_vis_settings']['pages']['#description'] .= ' ' . t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can break your Drupal site.', array('%php' => '<?php ?>'));
   }
 
   // Role-based visibility settings.
@@ -392,12 +390,12 @@ function block_add_block_form_submit($fo
         'visibility' => (int) $form_state['values']['visibility'],
         'pages' => trim($form_state['values']['pages']),
         'custom' => (int) $form_state['values']['custom'],
-        'title' => $form_state['values']['title'], 
+        'title' => $form_state['values']['title'],
         'module' => $form_state['values']['module'],
-        'theme' => $theme->name, 
+        'theme' => $theme->name,
         'status' => 0,
         'weight' => 0,
-        'delta' => $delta, 
+        'delta' => $delta,
         'cache' => BLOCK_NO_CACHE,
       ));
     }
Index: modules/block/block.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.js,v
retrieving revision 1.9
diff -u -p -r1.9 block.js
--- modules/block/block.js	21 May 2009 21:12:22 -0000	1.9
+++ modules/block/block.js	14 Jul 2009 20:40:02 -0000
@@ -10,6 +10,9 @@
 Drupal.behaviors.blockDrag = {
   attach: function (context, settings) {
     var table = $('table#blocks');
+    if (!$('table#blocks').size()) {
+      return;
+    }
     var tableDrag = Drupal.tableDrag.blocks; // Get the blocks tableDrag object.
 
     // Add a handler for when a row is swapped, update empty regions.
@@ -105,4 +108,20 @@ Drupal.behaviors.blockDrag = {
   }
 };
 
+/**
+ * Show all of the picture-related form elements at admin/settings/user
+ * depending on whether user pictures are enabled or not.
+ */
+Drupal.behaviors.blockVisibilitySettings = {
+  attach: function (context, settings) {
+    $("input[name='visibility']:not(.block-processed)", context).each(function () {
+      $(this).change(function (event) {
+        $('div.pages-wrapper', context).toggle($(this).val() != Drupal.settings.block.visibilityPageAlways);
+      });
+      $(this).addClass('block-processed');
+    });
+    $('div.pages-wrapper', context).toggle($("input[name='visibility'][checked]").val() != Drupal.settings.block.visibilityPageAlways);
+  }
+};
+
 })(jQuery);
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.349
diff -u -p -r1.349 block.module
--- modules/block/block.module	14 Jul 2009 10:22:17 -0000	1.349
+++ modules/block/block.module	14 Jul 2009 20:40:12 -0000
@@ -60,6 +60,11 @@ define('BLOCK_CACHE_PER_PAGE', 0x0004);
  */
 define('BLOCK_CACHE_GLOBAL', 0x0008);
 
+define('BLOCK_VISIBILITY_PAGE_ALWAYS', 3);
+define('BLOCK_VISIBILITY_PAGE_PHP', 2);
+define('BLOCK_VISIBILITY_PAGE_EXCLUDE', 0);
+define('BLOCK_VISIBILITY_PAGE_INCLUDE', 1);
+
 /**
  * Implement hook_help().
  */
