You are here

function layout_builder_at_form_alter in Layout Builder Asymmetric Translation 8.2

Implements hook_form_alter().

File

./layout_builder_at.module, line 83
Provides hook implementations for Layout Builder Asymmetric Translation.

Code

function layout_builder_at_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  if (isset($form[OverridesSectionStorage::FIELD_NAME]) && isset($form[OverridesSectionStorage::FIELD_NAME]['widget']['#layout_builder_at_access']) && $form[OverridesSectionStorage::FIELD_NAME]['widget']['#layout_builder_at_access']) {
    $form[OverridesSectionStorage::FIELD_NAME]['#access'] = TRUE;
    $form[OverridesSectionStorage::FIELD_NAME]['widget']['value']['#title'] = t('Copy blocks into translation');
    $form[OverridesSectionStorage::FIELD_NAME]['widget']['value']['#title_display'] = 'after';
  }
}