diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 75f1c60994f8eddb9fbe7eee71dac1ec9819075f..1ce2b9ef0838ace97d70a99fc7fd3844134ccd99 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -116,9 +116,7 @@ function template_preprocess_admin_block_content(&$variables) { } /** - * Prepares variables for administrative index page templates. - * - * Default template: admin-page.html.twig. + * Returns HTML for an administrative page. * * @param $variables * An associative array containing: @@ -129,24 +127,40 @@ function template_preprocess_admin_block_content(&$variables) { * * @ingroup themeable */ -function template_preprocess_admin_page(&$variables) { - $variables['system_compact_link'] = array( - '#theme' => 'system_compact_link', - ); - $variables['containers'] = array(); +function theme_admin_page($variables) { + $blocks = $variables['blocks']; + $stripe = 0; - foreach ($variables['blocks'] as $block) { - if (!empty($block['content']['#content'])) { + $container = array(); + + foreach ($blocks as $block) { + $admin_block = array( + '#theme' => 'admin_block', + '#block' => $block, + ); + if ($block_output = drupal_render($admin_block)) { if (empty($block['position'])) { - // Perform automatic striping. + // perform automatic striping. $block['position'] = ++$stripe % 2 ? 'left' : 'right'; } - $variables['containers'][$block['position']]['blocks'][] = array( - '#theme' => 'admin_block', - '#block' => $block, - ); + if (!isset($container[$block['position']])) { + $container[$block['position']] = ''; + } + $container[$block['position']] .= $block_output; } } + + $system_compact_link = array('#theme' => 'system_compact_link'); + $output = '<div class="admin clearfix">'; + $output .= drupal_render($system_compact_link); + + foreach ($container as $id => $data) { + $output .= '<div class="' . $id . ' clearfix">'; + $output .= $data; + $output .= '</div>'; + } + $output .= '</div>'; + return $output; } /** diff --git a/core/modules/system/system.module b/core/modules/system/system.module index ca908a2792dd3714e7fe3e6e399522cd857fdc29..6caca8af9a4d5986d22fffd8cb8fe06cdfa8d04f 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -196,7 +196,6 @@ function system_theme() { 'admin_page' => array( 'variables' => array('blocks' => NULL), 'file' => 'system.admin.inc', - 'template' => 'admin-page', ), 'admin_block' => array( 'variables' => array('block' => NULL), diff --git a/core/modules/system/templates/admin-page.html.twig b/core/modules/system/templates/admin-page.html.twig deleted file mode 100644 index 73cae67c16351a0d78a883347e7d7553714dacf2..0000000000000000000000000000000000000000 --- a/core/modules/system/templates/admin-page.html.twig +++ /dev/null @@ -1,26 +0,0 @@ -{# -/** - * @file - * Default theme implementation for an administrative page. - * - * Available variables: - * - system_compact_link: Themed link to toggle compact view. - * - containers: An list of administrative blocks keyed by position: left or - * right. Contains: - * - blocks: A list of blocks within a container. - * - * @see template_preprocess_admin_page() - * - * @ingroup themeable - */ -#} -<div class="admin clearfix"> - {{ system_compact_link }} - {% for position, container in containers %} - <div class="{{ position }} clearfix"> - {% for block in container.blocks %} - {{ block }} - {% endfor %} - </div> - {% endfor %} -</div>