-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme-settings.php
144 lines (131 loc) · 6.38 KB
/
theme-settings.php
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
use Drupal\node\Entity\NodeType;
function palm_form_system_theme_settings_alter(
&$form,
\Drupal\Core\Form\FormStateInterface &$form_state,
$form_id = null
) {
// Work-around for a core bug affecting admin themes. See issue #943212.
if (isset($form_id)) {
return;
}
$options[] = t('-- please choose --');
foreach (NodeType::loadMultiple() as $key => $type) {
$options[$type->get('type')] = $type->get('name');
}
$form['palm_settings'] = [
'#type' => 'details',
'#title' => t('advanced theme settings'),
'#description' => t('Administrate settings for the palm theme'),
'#open' => true,
];
$form['palm_settings']['palm_initial_nodetypes'] = [
'#type' => 'select',
'#title' => t('Initial letter'),
'#multiple' => true,
'#options' => $options,
'#description' => t('Please select, which of your nodetypes should start with an intitial letter.'),
'#default_value' => theme_get_setting('palm_initial_nodetypes'),
'#size' => 10
];
$form['palm_footer_settings'] = [
'#type' => 'details',
'#title' => t('footer settings'),
'#description' => t('Administrate settings for the footer.'),
'#open' => true,
];
$form['palm_footer_settings']['palm_footer_link'] = [
'#type' => 'textfield',
'#title' => t('Node ID for footer link'),
'#description' => t('Please provide a Node ID for the link at the bottom of the page around "Karl Barth".'),
'#default_value' => theme_get_setting('palm_footer_link'),
'#size' => 10,
];
$form['palm_footer_settings']['palm_footer_link_title'] = [
'#type' => 'textfield',
'#title' => t('title for footer link'),
'#description' => t('Please provide a title for the link at the bottom of the page around "Karl Barth".'),
'#default_value' => theme_get_setting('palm_footer_link_title'),
];
$form['palm_footer_settings']['palm_footer_cancellation_button_link'] = [
'#type' => 'textfield',
'#title' => t('URL for the cancellation button link'),
'#description' => t('Please provide the url of the cancellation form.'),
'#default_value' => theme_get_setting('palm_footer_cancellation_button_link'),
];
$form['palm_footer_settings']['palm_footer_cancellation_button_link_title'] = [
'#type' => 'textfield',
'#title' => t('title for cancellation button link'),
'#description' => t('Please provide a title for the cancellation button in the footer.'),
'#default_value' => theme_get_setting('palm_footer_cancellation_button_link_title'),
];
$form['palm_promo_settings'] = [
'#type' => 'details',
'#title' => t('promo settings'),
'#description' => t('Administrate settings promo elements such as the promo button or the promo banner.'),
'#open' => true,
];
$form['palm_promo_settings']['palm_header_promo_button_link'] = [
'#type' => 'textfield',
'#title' => t('URL for the promo button link'),
'#description' => t('Please provide the url of the promo link. Leave empty to disable the promo button.'),
'#default_value' => theme_get_setting('palm_header_promo_button_link'),
];
$form['palm_promo_settings']['palm_header_promo_button_link_title'] = [
'#type' => 'textfield',
'#title' => t('title for promo button link'),
'#description' => t('Please provide a title for the promo button in the footer.'),
'#default_value' => theme_get_setting('palm_header_promo_button_link_title'),
];
//settings for the promo banner on the bottom of the page
$form['palm_promo_settings']['palm_promo_banner_state'] = [
'#type' => 'select',
'#title' => t('State for promo banner'),
'#description' => t('Please provide a state for the promo banner.'),
'#default_value' => theme_get_setting('palm_promo_banner_state'),
'#options' => [0 => t('inactive'), 1 => t('active')],
];
$form['palm_promo_settings']['palm_promo_banner_theme'] = [
'#type' => 'select',
'#title' => t('Theme for promo banner'),
'#description' => t(
'Please provide a theme for the promo banner. This will switch from the usual logo to other ones.'
),
'#default_value' => theme_get_setting('palm_promo_banner_theme'),
'#options' => ['standard' => t('standard'), 'winter' => t('winter')],
];
$form['palm_promo_settings']['palm_promo_banner_title'] = [
'#type' => 'textfield',
'#title' => t('title for promo banner'),
'#description' => t('Please provide a title for the promo banner.'),
'#default_value' => theme_get_setting('palm_promo_banner_title'),
];
$form['palm_promo_settings']['palm_promo_banner_claim'] = [
'#type' => 'textfield',
'#title' => t('Claim for promo banner'),
'#description' => t('Please provide a claim for the promo banner.'),
'#default_value' => theme_get_setting('palm_promo_banner_claim'),
];
$form['palm_promo_settings']['palm_promo_banner_description'] = [
'#type' => 'textfield',
'#title' => t('Description for promo banner'),
'#description' => t('Please provide a description for the promo banner.'),
'#default_value' => theme_get_setting('palm_promo_banner_description'),
];
$form['palm_promo_settings']['palm_promo_banner_link'] = [
'#type' => 'textfield',
'#title' => t('Link for promo banner'),
'#description' => t(
'Please provide a link for the promo banner. It should be either a full URL or relative starting with a /.'
),
'#default_value' => theme_get_setting('palm_promo_banner_link'),
];
$form['palm_promo_settings']['palm_promo_banner_image_url'] = [
'#type' => 'textfield',
'#title' => t('Image url for promo banner'),
'#description' => t(
'Please provide a url for the promo banner image. It should be relative starting with a /.'
),
'#default_value' => theme_get_setting('palm_promo_banner_image_url'),
];
}