Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.293 diff -u -p -r1.293 block.module --- modules/block/block.module 18 Dec 2007 16:38:21 -0000 1.293 +++ modules/block/block.module 19 Dec 2007 18:47:05 -0000 @@ -158,21 +158,27 @@ function block_menu() { ); $default = variable_get('theme_default', 'garland'); foreach (list_themes() as $key => $theme) { - // only show enabled themes - if ($theme->status) { - $items['admin/build/block/list/'. $key] = array( - 'title' => check_plain($theme->info['name']), - 'page arguments' => array($key), - 'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, - 'weight' => $key == $default ? -10 : 0, - 'file' => 'block.admin.inc', - ); - } + $items['admin/build/block/list/'. $key] = array( + 'title' => check_plain($theme->info['name']), + 'page arguments' => array($key), + 'type' => $key == $default ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK, + 'weight' => $key == $default ? -10 : 0, + 'file' => 'block.admin.inc', + 'access callback' => '_block_themes_access', + 'access arguments' => array($theme), + ); } return $items; } /** + * Menu item access callback - only admin or enabled themes can be accessed + */ +function _block_themes_access($theme) { + return user_access('administer blocks') && ($theme->status || $theme->name == variable_get('admin_theme', '0')); +} + +/** * Implementation of hook_block(). * * Generates the administrator-defined blocks for display.