You are here

public function CslStyleDeleteForm::validateForm in Bibliography & Citation 8

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

Form validation handler.

Parameters

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

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

Overrides FormBase::validateForm

File

src/Form/CslStyleDeleteForm.php, line 38

Class

CslStyleDeleteForm
Builds the form to delete CSL style entities.

Namespace

Drupal\bibcite\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  $config = $this
    ->config('bibcite.settings');
  if ($config
    ->get('default_style') == $this->entity
    ->id()) {
    $form_state
      ->setError($form, $this
      ->t('You can not delete default style.'));
  }
}