public function buildForm(array
$form, FormStateInterface
$form_state, SectionStorageInterface
$section_storage = NULL
) { $this->sectionStorage =
$section_storage;
$form = parent::
buildForm($form,
$form_state);
$form['#attributes'
]['class'
][] = 'layout-builder-form';
// @todo \Drupal\layout_builder\Field\LayoutSectionItemList::defaultAccess()
// restricts all access to the field, explicitly allow access here until
// https://www.drupal.org/node/2942975 is resolved.
$form[OverridesSectionStorage::FIELD_NAME
]['#access'
] = TRUE;
$form['layout_builder_message'
] =
$this->
buildMessage($section_storage->
getContextValue('entity'
),
$section_storage);
return $form;
} /**
* Renders a message to display at the top of the layout builder.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity whose layout is being edited.
* @param \Drupal\layout_builder\OverridesSectionStorageInterface $section_storage
* The current section storage.
*
* @return array
* A renderable array containing the message.
*/