-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebtheme_default_content.install
executable file
·64 lines (52 loc) · 1.8 KB
/
webtheme_default_content.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
<?php
/**
* @file
* Contains install and update for Webtheme Default Content module.
*/
/**
* Implements hook_install().
*/
function webtheme_default_content_install() {
$basic_html = \Drupal::configFactory()->getEditable('filter.format.basic_html');
if (isset($basic_html)) {
$basic_html_filters = $basic_html->get('filters');
if (isset($basic_html_filters) && is_array($basic_html_filters)) {
$basic_html_filters['token_filter'] = [
'id' => 'token_filter',
'provider' => 'token_filter',
'status' => TRUE,
'weight' => 0,
'settings' => ['replace_empty' => '1'],
];
$basic_html->set('filters', $basic_html_filters)->save(TRUE);
}
}
$full_html = \Drupal::configFactory()->getEditable('filter.format.full_html');
if (isset($full_html)) {
$full_html_filters = $full_html->get('filters');
if (isset($full_html_filters) && is_array($full_html_filters)) {
$full_html_filters['token_filter'] = [
'id' => 'token_filter',
'provider' => 'token_filter',
'status' => TRUE,
'weight' => 0,
'settings' => ['replace_empty' => '1'],
];
$full_html->set('filters', $full_html_filters)->save(TRUE);
}
}
$restricted_html = \Drupal::configFactory()->getEditable('filter.format.restricted_html');
if (isset($restricted_html)) {
$restricted_html_filters = $restricted_html->get('filters');
if (isset($restricted_html_filters) && is_array($restricted_html_filters)) {
$restricted_html_filters['token_filter'] = [
'id' => 'token_filter',
'provider' => 'token_filter',
'status' => TRUE,
'weight' => 0,
'settings' => ['replace_empty' => '1'],
];
$restricted_html->set('filters', $restricted_html_filters)->save(TRUE);
}
}
}