You are here

administration_language_negotiation.install in Administration Language Negotiation 8

Same filename and directory in other branches
  1. 7 administration_language_negotiation.install

File

administration_language_negotiation.install
View source
<?php

/**
 * @file
 * Module installation code.
 */
declare (strict_types=1);
use Drupal\administration_language_negotiation\Plugin\LanguageNegotiation\LanguageNegotiationAdministrationLanguage;

/**
 * Implements hook_uninstall().
 */
function administration_language_negotiation_uninstall() {
  $config = \Drupal::configFactory()
    ->getEditable('language.types');
  $language_types = \Drupal::languageManager()
    ->getLanguageTypes();
  foreach ($language_types as $type) {
    $config
      ->clear('negotiation.' . $type . '.enabled.' . LanguageNegotiationAdministrationLanguage::METHOD_ID);
  }
  $config
    ->save();
}

/**
 * Remove default_language config.
 */
function administration_language_negotiation_update_8100() {
  $config = \Drupal::configFactory()
    ->getEditable('administration_language_negotiation.negotiation');
  $config
    ->clear('default_language');
  $config
    ->save();
}

/**
 * Set admin_routes setting to false.
 */
function administration_language_negotiation_update_8101() {
  $config = \Drupal::configFactory()
    ->getEditable('administration_language_negotiation.negotiation');
  $config
    ->set('admin_routes', FALSE);
  $config
    ->save();
}

Functions