You are here

private function FormModeManagerDisplayEditForm::formModesUpdated in Form mode manager 8

Same name and namespace in other branches
  1. 8.2 src/Form/FormModeManagerDisplayEditForm.php \Drupal\form_mode_manager\Form\FormModeManagerDisplayEditForm::formModesUpdated()

Determine whenever a formMode(s) has added/deleted onto entityTypes.

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

bool True if this entityFormDisplay do rebuild routes.

1 call to FormModeManagerDisplayEditForm::formModesUpdated()
FormModeManagerDisplayEditForm::submitForm in src/Form/FormModeManagerDisplayEditForm.php
Add more precise cache/routes invalidation when we are sure these, form-mode as added/deleted onto entities.

File

src/Form/FormModeManagerDisplayEditForm.php, line 110

Class

FormModeManagerDisplayEditForm
Form Mode Manager enhancements for edit form of the EntityFormDisplay.

Namespace

Drupal\form_mode_manager\Form

Code

private function formModesUpdated(array $form, FormStateInterface $form_state) {
  if (!isset($form['modes'])) {
    return FALSE;
  }
  if ($this
    ->isNewFormMode($this
    ->defaultDisplayModes($form), $this
    ->submittedDisplayModes($form_state))) {
    return TRUE;
  }
  if ($this
    ->updateDisplayModes($form, $form_state)) {
    return TRUE;
  }
  return FALSE;
}