You are here

public function ExportMultipleForm::buildForm in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_export/src/Form/ExportMultipleForm.php \Drupal\bibcite_export\Form\ExportMultipleForm::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_export/src/Form/ExportMultipleForm.php, line 111

Class

ExportMultipleForm
Export multiple reference entities.

Namespace

Drupal\bibcite_export\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $this->entityInfo = $this->tempStore
    ->get($this->currentUser
    ->id());
  $form['entities'] = [
    '#theme' => 'item_list',
    '#items' => $this->entityInfo,
  ];
  $form['format'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Export format'),
    '#options' => array_map(function ($format) {
      return $format['label'];
    }, $this->formatManager
      ->getExportDefinitions()),
    '#required' => TRUE,
  ];
  return parent::buildForm($form, $form_state);
}