diff --git a/core/modules/layout/layout.module b/core/modules/layout/layout.module index 2876f48..8c0f29d 100644 --- a/core/modules/layout/layout.module +++ b/core/modules/layout/layout.module @@ -36,7 +36,7 @@ function layout_menu() { * otherwise. */ function layout_user_access($key) { - return (user_access('administer layouts') && layout_manager()->getDefinition($key)); + return (user_access('administer layouts') && Drupal::service('plugin.manager.layout')->getDefinition($key)); } /** @@ -52,23 +52,13 @@ function layout_permission() { } /** - * Get the layout plugin manager instance. - * - * @return Drupal\layout\Plugin\Type\LayoutManager - * The layout plugin manager instance. - */ -function layout_manager() { - return Drupal::service('plugin.manager.layout'); -} - -/** * Implements hook_theme(). * * Expose all layouts as theme items, so themes can override layout markup. */ function layout_theme($existing, $type, $theme, $path) { $items = array(); - foreach (layout_manager()->getDefinitions() as $name => $layout) { + foreach (Drupal::service('plugin.manager.layout')->getDefinitions() as $name => $layout) { $items[$layout['theme']] = array( 'variables' => array('content' => NULL), 'path' => $layout['path'], diff --git a/core/modules/layout/lib/Drupal/layout/Tests/LayoutDerivativesTest.php b/core/modules/layout/lib/Drupal/layout/Tests/LayoutDerivativesTest.php index 4ef5f65..62fe20a 100644 --- a/core/modules/layout/lib/Drupal/layout/Tests/LayoutDerivativesTest.php +++ b/core/modules/layout/lib/Drupal/layout/Tests/LayoutDerivativesTest.php @@ -33,7 +33,7 @@ public static function getInfo() { * Tests for module/theme layout derivatives. */ function testDerivatives() { - $manager = \Drupal::service('plugin.manager.layout'); + $manager = $this->container->get('plugin.manager.layout'); $definitions = $manager->getDefinitions(); $this->assertTrue(is_array($definitions), 'Definitions found.');