This repository has been archived by the owner on Mar 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fgp.install
68 lines (62 loc) · 1.5 KB
/
fgp.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
64
65
66
67
68
<?php
/**
* @file
* Install and uninstall functions for the FGP installation profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function fgp_install() {
_fgp_setup_themes();
_fgp_setup_branding();
_fgp_setup_base_configurations();
}
/**
* Setup base site configurations.
*/
function _fgp_setup_base_configurations() {
// Ensure the translation fields are created in the database.
\Drupal::service('entity.definition_update_manager')->applyUpdates();
}
/**
* Set up the default branding.
*/
function _fgp_setup_branding() {
// Set the path to the logo, favicon and README file based on install
// directory.
$fgp_path = drupal_get_path('profile', 'fgp');
\Drupal::configFactory()
->getEditable('system.theme.global')
->set('logo', [
'path' => $fgp_path . '/fgp.svg',
'url' => '',
'use_default' => FALSE,
])
->set('favicon', [
'mimetype' => 'image/vnd.microsoft.icon',
'path' => $fgp_path . '/favicon.ico',
'url' => '',
'use_default' => FALSE,
])
->save(TRUE);
}
/**
* Setup the themes.
*/
function _fgp_setup_themes() {
// Set the default and admin theme.
\Drupal::configFactory()
->getEditable('system.theme')
->set('default', 'fgp_bootstrap')
->set('admin', 'seven')
->save(TRUE);
// Enable the admin theme.
\Drupal::configFactory()
->getEditable('node.settings')
->set('use_admin_theme', TRUE)
->save(TRUE);
}