You are here

protected function DashboardBlockConfigForm::buildBasicFields in Content Planner 8

Build Basic fields which are the same for every Dashboard Block Plugin.

1 call to DashboardBlockConfigForm::buildBasicFields()
DashboardBlockConfigForm::buildForm in src/Form/DashboardBlockConfigForm.php
Form constructor.

File

src/Form/DashboardBlockConfigForm.php, line 112

Class

DashboardBlockConfigForm
Defines a form that configures forms module settings.

Namespace

Drupal\content_planner\Form

Code

protected function buildBasicFields(array &$form, FormStateInterface &$form_state, Request &$request, $block_configuration) {
  $form['title'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Title'),
    '#maxlength' => 255,
    '#default_value' => isset($block_configuration['title']) ? $block_configuration['title'] : '',
    '#description' => $this
      ->t("If this field is blank, the Plugin's default name will be used."),
  ];
  $form['weight'] = [
    '#type' => 'weight',
    '#title' => $this
      ->t('Weight'),
    '#default_value' => isset($block_configuration['weight']) ? $block_configuration['weight'] : 0,
    '#delta' => 10,
  ];
}