-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcsgov.install
40 lines (33 loc) · 1.01 KB
/
csgov.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
<?php
/**
* @file
* Install, update and uninstall functions for the CSGov installation profile.
*/
use Drupal\user\Entity\User;
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function csgov_install() {
// Assign user 1 the "administrator" role.
$user = User::load(1);
$user->addRole('administrator');
$user->save();
// Set the default theme.
\Drupal::configFactory()->getEditable('system.theme')
->set('default', 'csgov_theme')
->save();
// Enable additional themes, including the admin theme if not already enabled.
\Drupal::service('theme_installer')->install(['csgov_admin'], TRUE);
// Set the 'csgov_admin' theme as the default administration theme.
\Drupal::configFactory()->getEditable('system.theme')
->set('admin', 'csgov_admin')
->save();
// Use the admin theme for content creation and editing.
\Drupal::configFactory()->getEditable('node.settings')
->set('use_admin_theme', TRUE)
->save();
}