administration_language_negotiation.install in Administration Language Negotiation 8
Same filename and directory in other branches
File
administration_language_negotiation.installView 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
Name | Description |
---|---|
administration_language_negotiation_uninstall | Implements hook_uninstall(). |
administration_language_negotiation_update_8100 | Remove default_language config. |
administration_language_negotiation_update_8101 | Set admin_routes setting to false. |