You are here

public function CslStyleFileForm::form in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x src/Form/CslStyleFileForm.php \Drupal\bibcite\Form\CslStyleFileForm::form()

Gets the actual form array to be built.

Overrides CslStyleForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

File

src/Form/CslStyleFileForm.php, line 16

Class

CslStyleFileForm
Form for installing bibcite_csl_style entity from file.

Namespace

Drupal\bibcite\Form

Code

public function form(array $form, FormStateInterface $form_state) {
  $form = parent::form($form, $form_state);

  /*
   * CSL text will be extracted from file.
   */
  unset($form['csl']);
  $form['file'] = [
    '#type' => 'file',
    '#title' => $this
      ->t('File'),
    '#description' => $this
      ->t('Allowed types: @extensions.', [
      '@extensions' => 'csl, xml',
    ]),
  ];
  return $form;
}