-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtide.install
63 lines (58 loc) · 1.89 KB
/
tide.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
63
<?php
/**
* @file
* Install and uninstall functions for the Tide profile installation profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for Tide profile Profile.
*
* @see system_install()
*/
function tide_install() {
// Don't do anything else during config sync.
if (\Drupal::isConfigSyncing()) {
return;
}
// Set the default and admin theme to Claro. It is important to set themes
// only to enabled ones (and we are enabling Claro in profile dependencies).
\Drupal::configFactory()
->getEditable('system.theme')
->set('default', 'claro')
->set('admin', 'claro')
->save(TRUE);
// Set the path to the logo and favicon files based on install directory.
$profile_path = \Drupal::service('extension.list.profile')->getPath('tide');
\Drupal::configFactory()
->getEditable('system.theme.global')
->set('logo', [
'path' => $profile_path . '/logo.png',
'url' => '',
'use_default' => FALSE,
])
->set('favicon', [
'mimetype' => 'image/vnd.microsoft.icon',
'path' => $profile_path . '/favicon.ico',
'url' => '',
'use_default' => FALSE,
])
->save(TRUE);
// Workaround for redis module: it must be enabled before configuration can
// be bootstrapped. We are already using installation phase to exclude redis
// configuration in /bay/settings.php and to install the module itself.
if (file_exists(DRUPAL_ROOT . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'contrib' . DIRECTORY_SEPARATOR . 'redis')) {
\Drupal::service('module_installer')->install(['redis']);
}
// These viewes are replaced by custom views provided by tide_site.
$view_ids = [
'content',
'moderated_content',
];
foreach ($view_ids as $view_id) {
$view = \Drupal::entityTypeManager()->getStorage('view')->load($view_id);
if ($view) {
$view->setStatus(FALSE)->save();
}
}
}