You are here

function varbase_page_install in Varbase Core 8.5

Same name and namespace in other branches
  1. 8.8 modules/varbase_page/varbase_page.install \varbase_page_install()
  2. 8.4 modules/varbase_page/varbase_page.install \varbase_page_install()
  3. 8.6 modules/varbase_page/varbase_page.install \varbase_page_install()
  4. 8.7 modules/varbase_page/varbase_page.install \varbase_page_install()
  5. 9.0.x modules/varbase_page/varbase_page.install \varbase_page_install()

Implements hook_install().

File

modules/varbase_page/varbase_page.install, line 13
Contains install and update for Varbase page module.

Code

function varbase_page_install() {

  // Activate configurations to work with enable_multilingual.
  if (\Drupal::moduleHandler()
    ->moduleExists('varbase_internationalization')) {
    $module_path = Drupal::service('module_handler')
      ->getModule('varbase_page')
      ->getPath() . '/config/optional/';
    $config_path = $module_path . 'language.content_settings.node.page.yml';
    $config_content = file_get_contents($config_path);
    $config_data = (array) Yaml::parse($config_content);
    $config_factory = \Drupal::configFactory()
      ->getEditable('language.content_settings.node.page');
    $config_factory
      ->setData($config_data)
      ->save(TRUE);
  }
}