You are here

public function FormModeThemeSwitcherForm::buildFormPerEntity in Form mode manager 8.2

Build form element per compatible entities.

Parameters

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

array $form_modes: The form modes collection for given entity type.

string $entity_type_id: The entity type ID of entity.

Return value

string The name of the theme

Overrides FormModeManagerFormBase::buildFormPerEntity

File

modules/form_mode_theme_switcher/src/Form/FormModeThemeSwitcherForm.php, line 120

Class

FormModeThemeSwitcherForm
Configure Form for Form Mode Manager theme switcher settings.

Namespace

Drupal\form_mode_manager_theme_switcher\Form

Code

public function buildFormPerEntity(array &$form, array $form_modes, $entity_type_id) {
  $entity_label = $this->entityTypeManager
    ->getStorage($entity_type_id)
    ->getEntityType()
    ->getLabel();
  $form['theme_switcher_form_mode_settings'][$entity_type_id] = [
    '#type' => 'details',
    '#title' => $entity_label,
    '#description' => $this
      ->t('Allows you to configure the negotiation of the themes used by the routes using the form modes for the entity <b>@entity_type_id</b>', [
      '@entity_type_id' => $entity_label,
    ]),
    '#group' => 'vertical_tabs_per_modes',
  ];
  return $this;
}