forked from ymcatwincities/openy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopeny.install
62 lines (54 loc) · 1.4 KB
/
openy.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
* @file
* Install and uninstall functions for the OpenY installation profile.
*/
/**
* Implements hook_install().
*
* Performs actions to set up the site for this profile.
*
* @see system_install()
*/
function openy_install() {
// Set the default and admin theme.
\Drupal::configFactory()
->getEditable('system.theme')
->set('default', 'openy_rose')
->set('admin', 'seven')
->save(TRUE);
// Enable the admin theme.
\Drupal::configFactory()->getEditable('node.settings')->set('use_admin_theme', TRUE)->save(TRUE);
}
/**
* Upgrade from 8.x-0.2 version.
*/
function openy_update_8001() {
if (\Drupal::service('module_handler')->moduleExists('openy_migrate')) {
// Enable modules.
\Drupal::service('module_installer')->install([
'openy_demo_ncamp',
], TRUE);
// Run openy_demo_ncamp migration.
$importer = \Drupal::service('openy_migrate.importer');
$importer->import('openy_demo_node_camp');
$importer->import('openy_demo_node_landing');
}
}
/**
* Enable Alerts.
*/
function openy_update_8002() {
if (\Drupal::service('module_handler')->moduleExists('openy_node_alert')) {
return;
}
// Enable module.
\Drupal::service('module_installer')->install(['openy_node_alert']);
}
/**
* Enable config_import module.
*/
function openy_update_8003() {
// Enable module.
\Drupal::service('module_installer')->install(['config_import']);
}