You are here

function paragraph_blocks_form_panels_ipe_block_plugin_form_alter in Paragraph blocks 8

Same name and namespace in other branches
  1. 8.2 paragraph_blocks.module \paragraph_blocks_form_panels_ipe_block_plugin_form_alter()
  2. 3.x paragraph_blocks.module \paragraph_blocks_form_panels_ipe_block_plugin_form_alter()

Implements hook_form_FORM_ID_alter().

File

./paragraph_blocks.module, line 73
Contains paragraph_blocks.module.

Code

function paragraph_blocks_form_panels_ipe_block_plugin_form_alter(&$form, FormStateInterface $form_state) {

  // Get the paragraph blocks entity manager.

  /** @var \Drupal\paragraph_blocks\ParagraphBlocksEntityManager $paragraph_blocks_entity_manager */
  $paragraph_blocks_entity_manager = \Drupal::service('paragraph_blocks.entity_manager');

  // Get the title of the plugin.
  $title = $paragraph_blocks_entity_manager
    ->getTitle($form['plugin_id']['#value']);
  if (!empty($title)) {
    $section =& $form['flipper']['front']['settings'];
    $section['admin_label']['#type'] = 'hidden';
    $section['label']['#type'] = 'hidden';
    $section['label']['#required'] = FALSE;
    $section['label_display']['#type'] = 'hidden';
    $section['label_display']['#value'] = 0;
    $section['label']['#value'] = $title;
  }
}