You are here

function social_core_modules_installed in Open Social 8.8

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_core/social_core.module \social_core_modules_installed()
  2. 8.7 modules/social_features/social_core/social_core.module \social_core_modules_installed()
  3. 10.3.x modules/social_features/social_core/social_core.module \social_core_modules_installed()
  4. 10.0.x modules/social_features/social_core/social_core.module \social_core_modules_installed()
  5. 10.1.x modules/social_features/social_core/social_core.module \social_core_modules_installed()
  6. 10.2.x modules/social_features/social_core/social_core.module \social_core_modules_installed()

Implements hook_modules_installed().

File

modules/social_features/social_core/social_core.module, line 45
The Social core module.

Code

function social_core_modules_installed($modules) {

  // If either social_group_flexible_group or social_landing_page gets enabled
  // and the other is already enabled, we should import the the configuration
  // for the optional view mode by enabling social_flexible_group_featured.
  if (in_array('social_group_flexible_group', $modules, TRUE) && \Drupal::moduleHandler()
    ->moduleExists('social_landing_page') || in_array('social_landing_page', $modules, TRUE) && \Drupal::moduleHandler()
    ->moduleExists('social_group_flexible_group')) {
    \Drupal::service('module_installer')
      ->install([
      'social_flexible_group_featured',
    ]);
  }

  // If either social_book or social_landing_page gets enabled and
  // the other is already enabled, we should import the the configuration
  // for the optional view mode by enabling social_book_featured.
  if (in_array('social_book', $modules, TRUE) && \Drupal::moduleHandler()
    ->moduleExists('social_landing_page') || in_array('social_landing_page', $modules, TRUE) && \Drupal::moduleHandler()
    ->moduleExists('social_book')) {
    \Drupal::service('module_installer')
      ->install([
      'social_book_featured',
    ]);
  }
}