You are here

public static function ReusableBlocks::processBlockContentForm in Panopoly Magic 8.2

Process callback to insert a Custom Block form.

Parameters

array $element: The containing element.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Return value

array The containing element, with the Custom Block form inserted.

File

src/Alterations/ReusableBlocks.php, line 171

Class

ReusableBlocks
A service for altering some Layout Builder forms to allow reusable blocks.

Namespace

Drupal\panopoly_magic\Alterations

Code

public static function processBlockContentForm(array $element, FormStateInterface $form_state) {

  /** @var \Drupal\block_content\BlockContentInterface $block */
  $block = $element['#block'];
  EntityFormDisplay::collectRenderDisplay($block, 'edit')
    ->buildForm($block, $element, $form_state);
  $element['revision_log']['#access'] = FALSE;
  $element['info']['#access'] = FALSE;
  return $element;
}