function layout_test_page

Page callback for layout testing.

1 string reference to 'layout_test_page'
layout_test_menu in drupal/core/modules/layout/tests/layout_test.module
Implementation of hook_menu().

File

drupal/core/modules/layout/tests/layout_test.module, line 24
Layout testing module.

Code

function layout_test_page() {

  // Hack to enable and apply the theme to this page and manually invoke its
  // layout plugin and render it.
  global $theme;
  $theme = 'layout_test_theme';
  theme_enable(array(
    $theme,
  ));
  $display = entity_load('display', 'test_twocol');
  $layout = $display
    ->getLayoutInstance();

  // @todo This tests that the layout can render its regions, but does not test
  //   block rendering: http://drupal.org/node/1812720.
  // Add sample content in the regions that is looked for in the tests.
  $regions = $layout
    ->getRegions();
  foreach ($regions as $region => $info) {
    $regions[$region] = '<h3>' . $info['label'] . '</h3>';
  }
  return $layout
    ->renderLayout(FALSE, $regions);
}