You are here

public function DeleteMultiple::buildForm in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Form/DeleteMultiple.php \Drupal\bibcite_entity\Form\DeleteMultiple::buildForm()

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

modules/bibcite_entity/src/Form/DeleteMultiple.php, line 105

Class

DeleteMultiple
Delete multiple entities form.

Namespace

Drupal\bibcite_entity\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL) {
  $this->entityTypeId = $entity_type_id;
  $this->entityInfo = $this->tempStore
    ->get($this->currentUser
    ->id());
  if (empty($this->entityInfo)) {
    return new RedirectResponse($this
      ->getCancelUrl()
      ->setAbsolute()
      ->toString());
  }
  $form['entities'] = [
    '#theme' => 'item_list',
    '#items' => $this->entityInfo,
  ];
  return parent::buildForm($form, $form_state);
}