diff core/modules/layout_builder/src/Controller/ChooseSectionController.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/core/modules/layout_builder/src/Controller/ChooseSectionController.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/layout_builder/src/Controller/ChooseSectionController.php	Thu May 09 15:34:47 2019 +0100
@@ -8,6 +8,7 @@
 use Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\Url;
+use Drupal\layout_builder\LayoutBuilderHighlightTrait;
 use Drupal\layout_builder\SectionStorageInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -15,10 +16,12 @@
  * Defines a controller to choose a new section.
  *
  * @internal
+ *   Controller classes are internal.
  */
 class ChooseSectionController implements ContainerInjectionInterface {
 
   use AjaxHelperTrait;
+  use LayoutBuilderHighlightTrait;
   use StringTranslationTrait;
 
   /**
@@ -59,8 +62,6 @@
    *   The render array.
    */
   public function build(SectionStorageInterface $section_storage, $delta) {
-    $output['#title'] = $this->t('Choose a layout');
-
     $items = [];
     $definitions = $this->layoutManager->getFilteredDefinitions('layout_builder', [], ['section_storage' => $section_storage]);
     foreach ($definitions as $plugin_id => $definition) {
@@ -98,6 +99,7 @@
         'class' => [
           'layout-selection',
         ],
+        'data-layout-builder-target-highlight-id' => $this->sectionAddHighlightId($delta),
       ],
     ];