public function ParagraphBlocksPanelsIpeBaseManager::hookFormPanelsIpeBlockPluginFormAlter in Paragraph blocks 8
Change the title on the add/edit form.
Parameters
array &$form: The form.
\Drupal\hcp_paragraphs\FormStateInterface $form_state: The form state.
See also
File
- src/
ParagraphBlocksPanelsIpeBaseManager.php, line 59
Class
- ParagraphBlocksPanelsIpeBaseManager
- Handles panels IPE hooks to rename paragraph blocks.
Namespace
Drupal\paragraph_blocksCode
public function hookFormPanelsIpeBlockPluginFormAlter(array &$form, FormStateInterface $form_state) {
$title = $this
->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;
}
}