form_mode_manager.module in Form mode manager 8.2
Same filename and directory in other branches
Contains form_mode_manager.module.
File
form_mode_manager.moduleView source
<?php
/**
* @file
* Contains form_mode_manager.module.
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\form_mode_manager\EntityTypeInfo;
use Drupal\form_mode_manager\FormAlter;
use Drupal\form_mode_manager\MenuLinksInfo;
/**
* Implements hook_entity_type_alter().
*/
function form_mode_manager_entity_type_alter(array &$entity_types) {
return \Drupal::service('class_resolver')
->getInstanceFromDefinition(EntityTypeInfo::class)
->entityTypeAlter($entity_types);
}
/**
* Implements hook_entity_type_build().
*/
function form_mode_manager_entity_type_build(array &$entity_types) {
return \Drupal::service('class_resolver')
->getInstanceFromDefinition(EntityTypeInfo::class)
->entityTypeBuild($entity_types);
}
/**
* Implements hook_entity_operation().
*/
function form_mode_manager_entity_operation(EntityInterface $entity) {
return \Drupal::service('class_resolver')
->getInstanceFromDefinition(EntityTypeInfo::class)
->entityOperation($entity);
}
/**
* Implements hook_entity_operation_alter().
*/
function form_mode_manager_entity_operation_alter(array &$operations, EntityInterface $entity) {
return \Drupal::service('class_resolver')
->getInstanceFromDefinition(EntityTypeInfo::class)
->entityOperationAlter($operations, $entity);
}
/**
* Implements hook_contextual_links_alter().
*/
function form_mode_manager_contextual_links_alter(array &$links, $group, array $route_parameters) {
return \Drupal::service('class_resolver')
->getInstanceFromDefinition(MenuLinksInfo::class)
->contextualLinksAlter($links, $group, $route_parameters);
}
/**
* Implements hook_form_alter().
*/
function form_mode_manager_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
return \Drupal::service('class_resolver')
->getInstanceFromDefinition(FormAlter::class)
->formAlter($form, $form_state, $form_id);
}
Functions
Name![]() |
Description |
---|---|
form_mode_manager_contextual_links_alter | Implements hook_contextual_links_alter(). |
form_mode_manager_entity_operation | Implements hook_entity_operation(). |
form_mode_manager_entity_operation_alter | Implements hook_entity_operation_alter(). |
form_mode_manager_entity_type_alter | Implements hook_entity_type_alter(). |
form_mode_manager_entity_type_build | Implements hook_entity_type_build(). |
form_mode_manager_form_alter | Implements hook_form_alter(). |