You are here

public function CustomHTMLBlockBase::getConfigSpecificFormFields in Content Planner 8

Add additonal form elements specific to the Plugin.

Parameters

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

\Symfony\Component\HttpFoundation\Request $request: The request.

array $block_configuration: The block configuration.

Return value

mixed Gets the config form fields.

Overrides DashboardBlockBase::getConfigSpecificFormFields

File

src/Plugin/DashboardBlock/CustomHTMLBlockBase.php, line 43

Class

CustomHTMLBlockBase
The base class for block base.

Namespace

Drupal\content_planner\Plugin\DashboardBlock

Code

public function getConfigSpecificFormFields(FormStateInterface &$form_state, Request &$request, array $block_configuration) {
  $form = [];
  if (!empty($block_configuration['plugin_specific_config']['content']['value'])) {
    $default_value = $block_configuration['plugin_specific_config']['content']['value'];
  }
  else {
    $default_value = '';
  }
  $form['content'] = [
    '#type' => 'text_format',
    '#title' => t('Content'),
    '#format' => 'full_html',
    '#default_value' => $default_value,
  ];
  return $form;
}