You are here

public function DeleteStyles::buildForm in Block Style Plugins 8.2

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

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

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

src/Form/DeleteStyles.php, line 98

Class

DeleteStyles
Provides a form to delete a block style.

Namespace

Drupal\block_style_plugins\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL, $delta = NULL, $uuid = NULL, $plugin_id = NULL) {
  $this->sectionStorage = $section_storage;
  $this->delta = $delta;
  $this->uuid = $uuid;
  $this->pluginId = $plugin_id;
  $form = parent::buildForm($form, $form_state);
  $form['actions']['cancel'] = $this
    ->buildCancelLink();
  $form['#attributes']['data-layout-builder-target-highlight-id'] = $this
    ->blockUpdateHighlightId($this->uuid);
  if ($this
    ->isAjax()) {
    $form['actions']['submit']['#ajax']['callback'] = '::ajaxSubmit';
  }
  return $form;
}