You are here

function message_ui_install in Message UI 8

Implements hook_install().

File

./message_ui.install, line 11
message_ui.install

Code

function message_ui_install() {

  // Set the fields for the of the message form.
  $templates = \Drupal::entityTypeManager()
    ->getStorage('message_template')
    ->loadMultiple();

  /** @var \Drupal\message_ui\MessageUIFieldDisplayManagerServiceInterface $message_ui_field_display_manager */
  $message_ui_field_display_manager = \Drupal::service('message_ui.field_display_manager');
  foreach (array_keys($templates) as $template) {
    $message_ui_field_display_manager
      ->setFieldsDisplay($template);
  }
}