degov-8.x-2.0/modules/degov_common/degov_common.install
modules/degov_common/degov_common.install
<?php
/**
* Implements hook_install().
*/
function degov_common_install() {
// Set the first day of the week to Monday.
\Drupal::configFactory()->getEditable('system.date')->set('first_day', 1)->save();
\Drupal::configFactory()->getEditable('degov_common.default_settings')
->set('netiquette_url', '/netiquette')
->set('privacy_url', '/datenschutzhinweise')
->save();
}
/**
* Implement hook_uninstall().
*/
function degov_common_uninstall() {
\Drupal::configFactory()->getEditable('degov_common.default_settings')->delete();
}
function degov_common_update_8016() {
$query = \Drupal::database()->delete('key_value');
$query->condition('collection', 'system.schema');
$query->condition('name', 'degov_paragraph_webformular');
$query->execute();
\Drupal::configFactory()->getEditable('core.entity_form_display.paragraph.webformular.default')->delete();
\Drupal::configFactory()->getEditable('core.entity_view_display.paragraph.webformular.default')->delete();
\Drupal::configFactory()->getEditable('core.entity_view_display.paragraph.webformular.preview')->delete();
\Drupal::configFactory()->getEditable('field.field.paragraph.webformular.field_sub_title')->delete();
\Drupal::configFactory()->getEditable('field.field.paragraph.webformular.field_title')->delete();
\Drupal::configFactory()->getEditable('field.field.paragraph.webformular.field_webform_form')->delete();
\Drupal::configFactory()->getEditable('paragraphs.paragraphs_type.webformular')->delete();
\Drupal::configFactory()->getEditable('paragraphs.paragraphs_type.webform')->delete();
\Drupal::configFactory()->getEditable('paragraphs.paragraphs_type.webform_form')->delete();
\Drupal::configFactory()->getEditable('field.storage.paragraph.field_webform_form')->delete();
\Drupal::service('module_installer')->install(['degov_paragraph_webform']);
}
/**
* Added default URL settings for configuration
*/
function degov_common_update_8017() {
\Drupal::configFactory()->getEditable('degov_common.default_settings')
->set('netiquette_url', '/netiquette')
->set('privacy_url', '/datenschutzhinweise')
->save();
}
/**
* Installs the degov_theming module for decoupling degov_common module's theming functionality.
*/
function degov_common_update_8018() {
\Drupal::service('module_installer')->install(['degov_theming']);
}