You are here

function lightning_landing_page_install in Lightning Layout 8.2

Same name and namespace in other branches
  1. 8 modules/lightning_landing_page/lightning_landing_page.install \lightning_landing_page_install()

Implements hook_install().

File

modules/lightning_landing_page/lightning_landing_page.install, line 13
Contains installation and update routines for Lightning Landing Page.

Code

function lightning_landing_page_install() {
  if (Drupal::isConfigSyncing()) {
    return;
  }
  $display = lightning_layout_entity_get_display('node', 'landing_page', 'full');
  if (!$display instanceof LayoutEntityDisplayInterface) {
    throw new \InvalidArgumentException('Expected the ' . $display
      ->label() . ' display to support Layout Builder.');
  }
  $display
    ->setOverridable()
    ->save();
  $modules = [
    'layout_library',
    'lightning_search',
    'lightning_workflow',
    'menu_ui',
  ];
  $modules = array_filter($modules, [
    Drupal::moduleHandler(),
    'moduleExists',
  ]);
  if ($modules) {
    lightning_landing_page_modules_installed($modules);
  }
}