diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc index f94ce25..0b0edd4 100644 --- a/core/modules/block/block.admin.inc +++ b/core/modules/block/block.admin.inc @@ -8,16 +8,6 @@ use Drupal\block\Plugin\Core\Entity\Block; /** - * Page callback: Attaches CSS for the block region demo. - * - * @see block_menu() - */ -function block_admin_demo($theme = NULL) { - drupal_add_css(drupal_get_path('module', 'block') . '/block.admin.css'); - return ''; -} - -/** * Page callback: Shows the block administration page. * * @param string $theme diff --git a/core/modules/block/block.module b/core/modules/block/block.module index d94ec3b..6c9d41f 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -170,19 +170,16 @@ function block_menu() { 'access arguments' => array($key), 'file' => 'block.admin.inc', ); - $items['admin/structure/block/demo/' . $key] = array( - 'title' => check_plain($theme->info['name']), - 'page callback' => 'block_admin_demo', - 'page arguments' => array($key), - 'type' => MENU_CALLBACK, - 'access callback' => '_block_themes_access', - 'access arguments' => array($key), - 'theme callback' => '_block_custom_theme', - 'theme arguments' => array($key), - 'file' => 'block.admin.inc', - ); } } + if (isset($theme)) { + $items['admin/structure/block/demo/%'] = array( + 'route_name' => 'block_admin_demo', + 'type' => MENU_CALLBACK, + 'theme callback' => '_block_custom_theme', + 'theme arguments' => array(4), + ); + } return $items; } @@ -191,7 +188,6 @@ function block_menu() { * * Path: * - admin/structure/block/list/% (for each theme) - * - admin/structure/block/demo/% (for each theme) * * @param $theme * Either the name of a theme or a full theme object. @@ -236,7 +232,7 @@ function block_page_build(&$page) { $all_regions = system_region_list($theme); $item = menu_get_item(); - if ($item['path'] != 'admin/structure/block/demo/' . $theme) { + if ($item['path'] != 'admin/structure/block/demo/%') { // Load all region content assigned via blocks. foreach (array_keys($all_regions) as $region) { // Assign blocks to region. @@ -256,26 +252,23 @@ function block_page_build(&$page) { } else { // Append region description if we are rendering the regions demo page. - $item = menu_get_item(); - if ($item['path'] == 'admin/structure/block/demo/' . $theme) { - $visible_regions = array_keys(system_region_list($theme, REGIONS_VISIBLE)); - foreach ($visible_regions as $region) { - $description = '