Index: modules/block/block.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.api.php,v retrieving revision 1.13 diff -u -p -r1.13 block.api.php --- modules/block/block.api.php 13 Aug 2010 12:25:14 -0000 1.13 +++ modules/block/block.api.php 12 Oct 2010 01:21:08 -0000 @@ -57,6 +57,11 @@ * - DRUPAL_CACHE_GLOBAL: The block is the same for every user on every * page where it is visible. * - DRUPAL_NO_CACHE: The block should not get cached. + * - 'properties': (optional) Array of additional metadata to add to the + * block. Common properties include: + * - 'administrative': Boolean which categorizes this block as usable in + * an administrative context. This might include blocks which help an + * admin approve/deny comments, or view recently created user accounts. * - 'weight': (optional) Initial value for the ordering weight of this block. * Most modules do not provide an initial value, and any value provided can * be modified by a user on the block configuration screen. Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.904 diff -u -p -r1.904 comment.module --- modules/comment/comment.module 5 Oct 2010 06:17:28 -0000 1.904 +++ modules/comment/comment.module 12 Oct 2010 01:21:08 -0000 @@ -402,6 +402,7 @@ function comment_permission() { */ function comment_block_info() { $blocks['recent']['info'] = t('Recent comments'); + $blocks['recent']['properties']['administrative'] = TRUE; return $blocks; } Index: modules/dashboard/dashboard.admin.js =================================================================== RCS file: modules/dashboard/dashboard.admin.js diff -N modules/dashboard/dashboard.admin.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ modules/dashboard/dashboard.admin.js 12 Oct 2010 01:21:08 -0000 @@ -0,0 +1,171 @@ +// $Id$ + +Drupal.behaviors.dashboardAdmin = {}; + +Drupal.behaviors.dashboardAdmin.attach = function (context, settings) { + var $ = jQuery; + var theme = settings.dashboardTheme; + var regions = settings.dashboardRegions; + var $checkbox = $('#edit-dashboard-availability').once('dashboard-admin'); + var $select = $('#edit-regions-' + theme); + if ($checkbox.length && $select.length) { + // When the user changes the administrative theme regions dropdown, update + // the dashboard checkbox, and vice versa. + var handler = new Drupal.dashboardAdminHandler($checkbox, $select, regions); + handler.initialize(); + } +}; + +/** + * Constructor for the Drupal.dashboardAdminHandler class. + * + * Keeps the administrative theme regions dropdown and the dashboard checkbox + * in sync. + * + * @param {jQuery} $checkbox + * A jQuery object representing the dashboard checkbox. + * @param {jQuery} $select + * A jQuery object representing the select dropdown for the administrative + * theme's regions. + * @param {array} regions + * An array of dashboard region names. + */ +Drupal.dashboardAdminHandler = function ($checkbox, $select, regions) { + this.$checkbox = $checkbox; + this.$select = $select; + this.initializeDashboardRegions(regions); + this.dashboardMain = 'dashboard_main'; + + this.initialCheckboxValue = $checkbox.is(':checked'); + this.initialSelectValue = $select.val(); + this.blockRegionNone = $select.find('option:first').val(); +}; + +/** + * Initializes the dashboardAdminHandler object. + * + * Determines the initial values for the dashboard region and the content + * region, and binds a change handler to the checkbox and the select dropdown. + */ +Drupal.dashboardAdminHandler.prototype.initialize = function () { + var $ = jQuery; + + // Keep track of the original value of the region dropdown, so we can restore + // it when the checkbox value changes. + if (this.isDashboardRegion(this.initialSelectValue)) { + this.dashboardRegion = this.initialSelectValue; + this.contentRegion = this.blockRegionNone; + } + else { + this.dashboardRegion = this.dashboardMain; + this.contentRegion = this.initialSelectValue; + } + + // Limit the available options in the select dropdown to those that make + // sense with the current value of the checkbox. + if (this.initialCheckboxValue) { + this.constrainOptions('dashboard'); + } + else { + this.constrainOptions('content'); + } + + // Bind event handlers to the checkbox and the select dropdown so we can + // keep each up to date when the other changes. + this.$checkbox.bind('change', $.proxy(this, 'checkboxHandler')); + this.$select.bind('change', $.proxy(this, 'selectHandler')); +}; + +/** + * Updates the select dropdown when the user clicks the checkbox. + */ +Drupal.dashboardAdminHandler.prototype.checkboxHandler = function () { + var checked = this.$checkbox.is(':checked'); + if (checked) { + this.$select.val(this.dashboardRegion); + this.constrainOptions('dashboard'); + } + else { + this.$select.val(this.contentRegion); + this.constrainOptions('content'); + } +}; + +/** + * Updates the checkbox when the user changes the selected region. + */ +Drupal.dashboardAdminHandler.prototype.selectHandler = function () { + var region = this.$select.val(); + // If the user chose "None" as the region, record that as their new region + // preference. + if (region == this.blockRegionNone) { + var checked = this.$checkbox.attr('checked'); + if (checked) { + this.dashboardRegion = this.blockRegionNone; + } + else { + this.contentRegion = this.blockRegionNone; + } + } + else if (this.isDashboardRegion(region)) { + this.dashboardRegion = region; + this.$checkbox.attr('checked', 'checked'); + } + else { + this.contentRegion = region; + this.$checkbox.attr('checked', ''); + } +}; + +/** + * Determines whether a given region is on the dashboard. + */ +Drupal.dashboardAdminHandler.prototype.isDashboardRegion = function (regionName) { + return this.dashboardRegions[regionName] || false; +}; + +/** + * Initializes the object with the list of dashboard region names. + * + * @param {Array} regions + * An array of dashboard region names. + */ +Drupal.dashboardAdminHandler.prototype.initializeDashboardRegions = function (regions) { + var regionNames = {}; + var i; + for (i = 0; i < regions.length; i++) { + regionNames[regions[i]] = regions[i]; + } + this.dashboardRegions = regionNames; +}; + +/** + * Limits the available region options to dashboard- or content-only. + */ +Drupal.dashboardAdminHandler.prototype.constrainOptions = function (regionType) { + var $ = jQuery; + var i, $option; + + // Disable all the regions, leaving "None" enabled. + var $options = $('option', this.$select); + $options.filter('[value!=' + this.blockRegionNone + ']').attr('disabled', 'disabled'); + + if (regionType == 'dashboard') { + // Re-enable the dashboard regions. + for (i = 0; i < $options.length; i++) { + $option = $($options[i]); + if (this.isDashboardRegion($option.val())) { + $option.attr('disabled', ''); + } + } + } + else { + // Re-enable the content regions. + for (i = 0; i < $options.length; i++) { + $option = $($options[i]); + if (!this.isDashboardRegion($option.val())) { + $option.attr('disabled', ''); + } + } + } +}; Index: modules/dashboard/dashboard.module =================================================================== RCS file: /cvs/drupal/drupal/modules/dashboard/dashboard.module,v retrieving revision 1.39 diff -u -p -r1.39 dashboard.module --- modules/dashboard/dashboard.module 3 Oct 2010 00:14:57 -0000 1.39 +++ modules/dashboard/dashboard.module 12 Oct 2010 01:21:09 -0000 @@ -19,7 +19,7 @@ function dashboard_help($path, $arg) { $output .= ''; return $output; - case 'admin/structure/dashboard': + case 'admin/dashboard/configure': // @todo This assumes the current page is being displayed using the same // theme that the dashboard is displayed in. $output = '

' . t('Rearrange blocks for display on the dashboard. Disabling a block makes it available on the main blocks administration page.', array('@dashboard-url' => url('admin/dashboard'), '@blocks-url' => url("admin/structure/block/list/{$GLOBALS['theme_key']}"))) . '

'; @@ -31,12 +31,6 @@ function dashboard_help($path, $arg) { * Implements hook_menu(). */ function dashboard_menu() { - $items['admin/structure/dashboard'] = array( - 'title' => 'Dashboard', - 'description' => 'Configure which blocks can be shown on the dashboard.', - 'page callback' => 'dashboard_admin_blocks', - 'access arguments' => array('administer blocks'), - ); $items['admin/dashboard'] = array( 'title' => 'Dashboard', 'description' => 'View and customize your dashboard.', @@ -46,6 +40,13 @@ function dashboard_menu() { // the top corner of the window as a convenient "home link". 'weight' => -15, ); + $items['admin/dashboard/configure'] = array( + 'title' => 'Configure available dashboard blocks', + 'description' => 'Configure which blocks can be shown on the dashboard.', + 'page callback' => 'dashboard_admin_blocks', + 'access arguments' => array('administer blocks'), + 'type' => MENU_VISIBLE_IN_BREADCRUMB, + ); $items['admin/dashboard/customize'] = array( 'title' => 'Customize dashboard', 'description' => 'Customize your dashboard.', @@ -185,6 +186,33 @@ function dashboard_system_info_alter(&$i } /** + * Implements hook_block_info_alter(). + * + * Saves a list of blocks to be available to the dashboard by default, which + * are defined with $block['properties']['administrative'] = TRUE. + */ +function dashboard_block_info_alter(&$blocks, $theme, $code_blocks) { + if (!$theme = variable_get('admin_theme')) { + global $theme_key; + $theme = $theme_key; + } + $available_blocks = variable_get('dashboard_available_blocks', array()); + + foreach ($blocks as $module => &$module_blocks) { + foreach ($module_blocks as $delta => &$block) { + if ($block['theme'] != $theme) { + // Only process for the admin theme, which displays the dashboard. + continue; + } + if (!empty($code_blocks[$module][$delta]['properties']['administrative']) && !isset($available_blocks[$module][$delta])) { + $available_blocks[$module][$delta] = TRUE; + } + } + } + variable_set('dashboard_available_blocks', $available_blocks); +} + +/** * Implements hook_theme(). */ function dashboard_theme() { @@ -250,7 +278,7 @@ function dashboard_admin($launch_customi ); $build = array( '#theme' => 'dashboard_admin', - '#message' => t('To customize the dashboard page, move blocks to the dashboard regions on the Dashboard administration page, or enable JavaScript on this page to use the drag-and-drop interface.', array('@dashboard' => url('admin/structure/dashboard'))), + '#message' => t('To customize the dashboard page, move blocks to the dashboard regions on the Dashboard administration page, or enable JavaScript on this page to use the drag-and-drop interface.', array('@dashboard' => url('admin/dashboard/configure'))), '#access' => user_access('administer blocks'), '#attached' => array( 'js' => array( @@ -277,18 +305,19 @@ function dashboard_admin($launch_customi function dashboard_admin_blocks() { global $theme_key; drupal_theme_initialize(); - drupal_set_title(t('Configure available dashboard blocks')); module_load_include('inc', 'block', 'block.admin'); // Prepare the blocks for the current theme, and remove those that are - // currently displayed in non-dashboard regions. + // currently displayed in non-dashboard regions, or are not marked as + // available through hook_block_info() or the block configure form. // @todo This assumes the current page is being displayed using the same // theme that the dashboard is displayed in. $blocks = block_admin_display_prepare_blocks($theme_key); $dashboard_regions = dashboard_region_descriptions(); $regions_to_remove = array_diff_key(system_region_list($theme_key, REGIONS_VISIBLE), $dashboard_regions); + $available_blocks = variable_get('dashboard_available_blocks', array()); foreach ($blocks as $id => $block) { - if (isset($regions_to_remove[$block['region']])) { + if (isset($regions_to_remove[$block['region']]) || (empty($available_blocks[$block['module']][$block['delta']]) && !in_array($block['region'], dashboard_regions()))) { unset($blocks[$id]); } } @@ -330,10 +359,10 @@ function dashboard_form_dashboard_admin_ // dashboard blocks administration page. foreach ($form['blocks'] as &$block) { if (isset($block['configure']['#href'])) { - $block['configure']['#options']['query']['destination'] = 'admin/structure/dashboard'; + $block['configure']['#options']['query']['destination'] = 'admin/dashboard/configure'; } if (isset($block['delete']['#href'])) { - $block['delete']['#options']['query']['destination'] = 'admin/structure/dashboard'; + $block['delete']['#options']['query']['destination'] = 'admin/dashboard/configure'; } } } @@ -356,6 +385,68 @@ function dashboard_form_block_admin_conf $region['#options'] = array_diff_key($region['#options'], $dashboard_regions); } } + + // Provide a block setting to control dashboard availability. + $available_blocks = variable_get('dashboard_available_blocks', array()); + $form['settings']['dashboard_availability'] = array( + '#type' => 'checkbox', + '#title' => t('Available on dashboard'), + '#default_value' => !empty($available_blocks[$form['module']['#value']][$form['delta']['#value']]), + ); + + $form['#attached']['js'][] = drupal_get_path('module', 'dashboard') . '/dashboard.admin.js'; + $form['#attached']['js'][] = array( + 'data' => array( + 'dashboardTheme' => $theme_key, + 'dashboardRegions' => dashboard_regions(), + ), + 'type' => 'setting', + ); + $form['#validate'][] = 'dashboard_form_block_admin_configure_validate'; + $form['#submit'] = array_merge(array('dashboard_form_block_admin_configure_submit'), $form['#submit']); +} + +/** + * Form validation handler for block configuration form. + */ +function dashboard_form_block_admin_configure_validate($form, &$form_state) { + global $theme_key; + drupal_theme_initialize(); + + // Ensure that the dashboard availability flag is only settable if the block + // hasn't been assigned to a non-dashboard region. + $selected_region = $form_state['values']['regions'][$theme_key]; + $changed = ($form['settings']['dashboard_availability']['#default_value'] != $form_state['values']['dashboard_availability']); + if ($form_state['values']['dashboard_availability'] && $changed && $selected_region != BLOCK_REGION_NONE && !in_array($selected_region, dashboard_regions())) { + form_set_error('regions][' . $theme_key, t('The block must be removed from a region on the @theme theme to enable it on the dashboard.', array('@theme' => $form['regions'][$theme_key]['#title']))); + } +} + +/** + * Form submission handler for block configuration form. + */ +function dashboard_form_block_admin_configure_submit($form, &$form_state) { + global $theme_key; + drupal_theme_initialize(); + + // Cause the block to be added/removed from the dashboard based on the + // dashboard availability setting, if the state has changed. + if ($form['settings']['dashboard_availability']['#default_value'] != $form_state['values']['dashboard_availability']) { + $region = &$form_state['values']['regions'][$theme_key]; + $available_blocks = variable_get('dashboard_available_blocks', array()); + $available_blocks[$form_state['values']['module']][$form_state['values']['delta']] = $form_state['values']['dashboard_availability']; + variable_set('dashboard_available_blocks', $available_blocks); + if ($form_state['values']['dashboard_availability']) { + // Add the block to the dashboard if not already assigned to a region. + if ($region == BLOCK_REGION_NONE) { + $region = 'dashboard_main'; + drupal_set_message(t('Block added to the dashboard.')); + } + } + elseif (in_array($region, dashboard_regions())) { + $region = BLOCK_REGION_NONE; + } + } } /** @@ -445,9 +536,11 @@ function dashboard_show_disabled() { // Blocks are not necessarily initialized at this point. $blocks = _block_rehash(); - // Limit the list to disabled blocks for the current theme. + // Limit the list to disabled blocks for the current theme which are marked + // as available through hook_block_info() or the block configure form. + $available_blocks = variable_get('dashboard_available_blocks', array()); foreach ($blocks as $key => $block) { - if ($block['theme'] != $theme_key || (!empty($block['status']) && !empty($block['region']))) { + if ($block['theme'] != $theme_key || (!empty($block['status']) && !empty($block['region'])) || empty($available_blocks[$block['module']][$block['delta']])) { unset($blocks[$key]); } } @@ -598,7 +691,7 @@ function theme_dashboard_region($variabl */ function theme_dashboard_disabled_blocks($variables) { extract($variables); - $output = '

' . t('Drag and drop these blocks to the columns below. Changes are automatically saved. More options are available on the configuration page.', array('@dashboard-url' => url('admin/structure/dashboard'))) . '

'; + $output = '

' . t('Drag and drop these blocks to the columns below. Changes are automatically saved. More options are available on the configuration page.', array('@dashboard-url' => url('admin/dashboard/configure'))) . '

'; $output .= '
'; foreach ($blocks as $block) { $output .= theme('dashboard_disabled_block', array('block' => $block)); Index: modules/dashboard/dashboard.test =================================================================== RCS file: /cvs/drupal/drupal/modules/dashboard/dashboard.test,v retrieving revision 1.5 diff -u -p -r1.5 dashboard.test --- modules/dashboard/dashboard.test 14 Sep 2010 21:51:01 -0000 1.5 +++ modules/dashboard/dashboard.test 12 Oct 2010 01:21:09 -0000 @@ -42,7 +42,7 @@ class DashboardBlocksTestCase extends Dr $custom_block['info'] = $this->randomName(8); $custom_block['title'] = $this->randomName(8); $custom_block['body[value]'] = $this->randomName(32); - $custom_block['regions[stark]'] = 'dashboard_main'; + $custom_block['dashboard_availability'] = TRUE; $this->drupalPost('admin/structure/block/add', $custom_block, t('Save block')); // Ensure admin access. @@ -65,7 +65,7 @@ class DashboardBlocksTestCase extends Dr $dashboard_regions = dashboard_region_descriptions(); // Ensure blocks can be placed in dashboard regions. - $this->drupalGet('admin/structure/dashboard'); + $this->drupalGet('admin/dashboard/configure'); foreach ($dashboard_regions as $region => $description) { $elements = $this->xpath('//option[@value=:region]', array(':region' => $region)); $this->assertTrue(!empty($elements), t('%region is an available choice on the dashboard block configuration page.', array('%region' => $region))); @@ -79,4 +79,115 @@ class DashboardBlocksTestCase extends Dr $this->assertTrue(empty($elements), t('%region is not an available choice on the block configuration page.', array('%region' => $region))); } } + + /** + * Test that defining a block with ['properties']['administrative'] = TRUE + * adds it as an available block for the dashboard. + */ + function testBlockAvailability() { + global $theme_key; + $this->drupalGet('admin/structure/dashboard'); + // "Recent comments" should be available in the dashboard block admin UI. + $this->assertText(t('Recent comments'), t('Block defined as "administrative" found in the dashboard block admin UI.')); + // "Syndicate" should not show up in the UI since it is not defined + // as "administrative". + $this->assertNoText(t('Syndicate'), t('Blocks not defined as "administrative" are excluded from dashboard UI by default.')); + + // Now test admin/dashboard/drawer in the same way. + $this->drupalGet('admin/dashboard/drawer'); + $this->assertText(t('Recent comments'), t('Drawer of disabled blocks includes the one defined as "administrative".')); + $this->assertNoText(t('Syndicate'), t('Drawer of disabled blocks excludes blocks not defined as "administrative".')); + + // Manipulate availability checkbox and reverse it: make "Recent comments" + // unavailable to the dashboard and make "Syndicate" available. + $values = array(); + $values['dashboard_availability'] = FALSE; + $this->drupalPost('admin/structure/block/manage/comment/recent/configure', $values, t('Save block')); + $this->drupalGet('admin/structure/block/manage/comment/recent/configure'); + $elements = $this->xpath('//input[@id=:id]', array(':id' => 'edit-dashboard-availability')); + $this->assertTrue(!empty($elements[0]) && empty($elements[0]['checked']), t('Dashboard availability disabled for "Recent comments".')); + $values['dashboard_availability'] = TRUE; + $this->drupalPost('admin/structure/block/manage/node/syndicate/configure', $values, t('Save block')); + $this->drupalGet('admin/structure/block/manage/node/syndicate/configure'); + $elements = $this->xpath('//input[@id=:id]', array(':id' => 'edit-dashboard-availability')); + $this->assertTrue(!empty($elements[0]) && !empty($elements[0]['checked']), t('Dashboard availability enabled for "Syndicate".')); + + $this->drupalGet('admin/structure/dashboard'); + $this->assertNoText(t('Recent comments'), t('Block dashboard availability can be overridden.')); + $this->assertText(t('Syndicate'), t('Block dashboard availability overridden for a block not defined as "administrative".')); + + // Now test admin/dashboard/drawer in the same way. + $this->drupalGet('admin/dashboard/drawer'); + $this->assertNoText(t('Recent comments'), t('Drawer of disabled blocks excludes blocks defined as "administrative" but overridden through the block UI.')); + $values = array(); + $values['blocks[node_syndicate][region]'] = BLOCK_REGION_NONE; + $this->drupalPost('admin/structure/dashboard', $values, t('Save blocks')); + $this->assertText(t('Syndicate'), t('Drawer of disabled blocks includes blocks not defined as "administrative" but overridden through the UI.')); + } + + /** + * Test that a block can be added and removed from the dashboard via the + * "Available on dashboard" checkbox. Also test the validation error if the + * block is already assigned to a region. + */ + function testDashboardEnableCheckbox() { + // Attempt to put "System help" block on the dashboard. This should fail + // since the block is already assigned to a non-dashboard region of the + // admin theme. + $this->drupalGet('admin/structure/block/manage/system/help/configure'); + $elements = $this->xpath('//input[@id=:id]', array(':id' => 'edit-dashboard-availability')); + $this->assertTrue(!empty($elements[0]) && empty($elements[0]['checked']), t('Dashboard availability checkbox is present and unchecked.')); + $values = array(); + $values['dashboard_availability'] = TRUE; + $this->drupalPost('admin/structure/block/manage/system/help/configure', $values, t('Save block')); + $this->assertText(t('The block must be removed from a region on the @theme theme to enable it on the dashboard.', array('@theme' => 'Stark')), t('Dashboard availability setting not selectable when the block is already in a non-dashboard region for the admin theme.')); + + // Unassign the region, and now we should see a success message. + $values['regions[stark]'] = BLOCK_REGION_NONE; + $this->drupalPost('admin/structure/block/manage/system/help/configure', $values, t('Save block')); + $this->assertText(t('Block added to the dashboard.'), t('Validation error is fixed by unassigning the region.')); + + // Ensure that the block shows up on the dashboard. + $this->drupalGet('admin/dashboard'); + $this->assertText(t('System help'), t('Block is now on the dashboard.')); + $this->drupalGet('admin/structure/dashboard'); + $this->assertText(t('System help'), t('Block displays in dashboard block UI.')); + + // Now remove the block from the dashboard via the checkbox. + $values = array(); + $values['dashboard_availability'] = FALSE; + $this->drupalPost('admin/structure/block/manage/system/help/configure', $values, t('Save block')); + $this->drupalGet('admin/dashboard'); + $this->assertNoText(t('System help'), t('Block was removed from the dashboard via the dashboard availability setting.')); + + // Test a block defined as "administrative" but not initially on + // the dashboard. + $this->drupalGet('admin/dashboard'); + $this->assertNoText(t('Recent comments'), t('Block is not on the dashboard.')); + $this->drupalGet('admin/dashboard/drawer'); + $this->assertText(t('Recent comments'), t('Block is in drawer of disabled blocks.')); + + $this->drupalGet('admin/structure/block/manage/comment/recent/configure'); + $elements = $this->xpath('//input[@id=:id]', array(':id' => 'edit-dashboard-availability')); + $this->assertTrue(!empty($elements[0]) && !empty($elements[0]['checked']), t('Dashboard availability enabled for "Recent comments".')); + + // Save the "Who's online" block, which should be available to the + // dashboard by default, but not enabled. Change the title, but leave the + // dashboard availability checkbox unchanged. The block should not be + // automatically added to the dashboard unless the user consciously + // changes the checkbox. + $this->drupalGet('admin/structure/block/manage/user/online/configure'); + $elements = $this->xpath('//input[@id=:id]', array(':id' => 'edit-dashboard-availability')); + $this->assertTrue(!empty($elements[0]) && !empty($elements[0]['checked']), t('Dashboard availability checkbox is checked.')); + $this->drupalGet('admin/dashboard'); + $this->assertNoText(t('Who\'s online'), t('Block is not on the dashboard.')); + $values = array(); + $values['title'] = t('My block'); + $this->drupalPost('admin/structure/block/manage/user/online/configure', $values, t('Save block')); + $this->assertNoText(t('Block added to the dashboard.'), t('Block was not automatically added to dashboard.')); + $this->drupalGet('admin/dashboard'); + $this->assertNoText(t('My block'), t('Block is not on the dashboard.')); + $this->drupalGet('admin/dashboard/drawer'); + $this->assertText(t('My block'), t('Block is in drawer of disabled blocks.')); + } } Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1306 diff -u -p -r1.1306 node.module --- modules/node/node.module 11 Oct 2010 21:00:33 -0000 1.1306 +++ modules/node/node.module 12 Oct 2010 01:21:09 -0000 @@ -2071,6 +2071,7 @@ function node_block_info() { $blocks['syndicate']['cache'] = DRUPAL_NO_CACHE; $blocks['recent']['info'] = t('Recent content'); + $blocks['recent']['properties']['administrative'] = TRUE; return $blocks; } Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.364 diff -u -p -r1.364 search.module --- modules/search/search.module 9 Oct 2010 03:24:46 -0000 1.364 +++ modules/search/search.module 12 Oct 2010 01:21:10 -0000 @@ -143,6 +143,8 @@ function search_block_info() { $blocks['form']['info'] = t('Search form'); // Not worth caching. $blocks['form']['cache'] = DRUPAL_NO_CACHE; + $blocks['form']['properties']['administrative'] = TRUE; + return $blocks; } Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.1208 diff -u -p -r1.1208 user.module --- modules/user/user.module 11 Oct 2010 19:43:23 -0000 1.1208 +++ modules/user/user.module 12 Oct 2010 01:21:10 -0000 @@ -1273,10 +1273,13 @@ function user_block_info() { $blocks['login']['cache'] = DRUPAL_NO_CACHE; $blocks['new']['info'] = t('Who\'s new'); + $blocks['new']['properties']['administrative'] = TRUE; // Too dynamic to cache. $blocks['online']['info'] = t('Who\'s online'); $blocks['online']['cache'] = DRUPAL_NO_CACHE; + $blocks['online']['properties']['administrative'] = TRUE; + return $blocks; }