public function FormModeManagerFormBase::buildFormModeForm in Form mode manager 8.2
Build Form Mode Manager settings form for each entity and form modes.
This method implement use abstract buildFormPerEntity &, buildFormPerFormMode to take control of element you need for each, compatible entities and form modes used by Form Mode Manager module. You can use one or all methods to applies your own logic on all, entities/modes you need without code duplication.
Parameters
array $form: An associative array containing the structure of the form.
Return value
array The structure of the form populated.
5 calls to FormModeManagerFormBase::buildFormModeForm()
- FormModeManagerForm::buildForm in src/
Form/ FormModeManagerForm.php - Form constructor.
- FormModeManagerFormBase::buildForm in src/
Form/ FormModeManagerFormBase.php - Form constructor.
- FormModeManagerLinksForm::buildForm in src/
Form/ FormModeManagerLinksForm.php - Form constructor.
- FormModeManagerRolesForm::buildForm in modules/
form_mode_user_roles_assign/ src/ Form/ FormModeManagerRolesForm.php - Form constructor.
- FormModeThemeSwitcherForm::buildForm in modules/
form_mode_theme_switcher/ src/ Form/ FormModeThemeSwitcherForm.php - Form constructor.
File
- src/
Form/ FormModeManagerFormBase.php, line 135
Class
- FormModeManagerFormBase
- Base for implementing system configuration forms for Form Mode Manager.
Namespace
Drupal\form_mode_manager\FormCode
public function buildFormModeForm(array &$form) {
$form_modes = $this->formModeManager
->getAllFormModesDefinitions($this->ignoreExcluded, $this->ignoreActiveDisplay);
if (empty($form_modes)) {
$form['empty']['#markup'] = t('Any Form modes activated in form display found.');
return $form;
}
foreach (array_keys($form_modes) as $entity_type_id) {
$this
->buildFormPerEntity($form, $form_modes, $entity_type_id);
foreach ($form_modes[$entity_type_id] as $form_mode) {
$this
->buildFormPerFormMode($form, $form_mode, $entity_type_id);
}
}
return $form;
}