-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme-settings.php
176 lines (160 loc) · 5.75 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
/**
* @file
* Theme settings.
*/
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter().
*/
function jcc_storybook_form_system_theme_settings_alter(&$form, FormStateInterface $form_state, $form_id = NULL) {
// Work-around for a core bug affecting admin themes. See issue #943212.
if (isset($form_id)) {
return;
}
$form['theme'] = [
'#type' => 'details',
'#title' => t('Theme settings'),
'#collapsed' => TRUE,
];
$form['theme']['scheme'] = [
'#type' => "select",
'#title' => t('Scheme'),
'#options' => [
'base' => t('Base'),
'local' => t('Local'),
'pro' => t('Pro'),
],
'#default_value' => theme_get_setting('scheme'),
'#description' => t('A scheme sets the general look and feel of the site. You still have the same building blocks from the component library, but global styles such as color, spacing, etc., can vary according to the selected scheme.'),
];
$form['theme']['header_footer_variant'] = [
'#type' => 'select',
'#title' => t('Header/Footer Variant'),
'#options' => [
'default' => t('Default'),
'alt' => t('Alt'),
],
'#default_value' => theme_get_setting('header_footer_variant'),
'#description' => t(
'Set the patternlab variant for the <a target="_blank" href=":header">header</a> and <a target="_blank" href=":footer">footer</a>.',
[
':header' => 'http://patternlab.courts.ca.gov/2.x/public/?p=viewall-organisms-header',
':footer' => 'http://patternlab.courts.ca.gov/2.x/public/?p=viewall-organisms-footer',
]
),
];
$form['theme']['site_name_first'] = [
'#type' => 'textfield',
'#title' => t("Site Name: First"),
'#placeholder' => t("Superior Court of California"),
'#default_value' => theme_get_setting('site_name_first'),
'#description' => t('Site name is split into two parts to improve presentation on small screens.'),
];
$form['theme']['site_name_second'] = [
'#type' => 'textfield',
'#title' => t("Site Name: Second"),
'#placeholder' => t("County of ..."),
'#default_value' => theme_get_setting('site_name_second'),
'#description' => t('Site name is split into two parts to improve presentation on small screens.'),
];
$form['theme']['hat_shoe_text'] = [
'#type' => 'textfield',
'#title' => t("Hat/Shoe Text"),
'#placeholder' => t("Judicial Branch of California"),
'#default_value' => theme_get_setting('hat_shoe_text'),
'#description' => t("A link that shows at the very top and bottom."),
];
$form['theme']['hat_shoe_url'] = [
'#type' => 'url',
'#title' => t("Hat/Shoe URL"),
'#placeholder' => "https://www.courts.ca.gov",
'#default_value' => theme_get_setting('hat_shoe_url'),
'#description' => t("A link that shows at the very top and bottom."),
];
$form['theme']['site_name_second'] = [
'#type' => 'textfield',
'#title' => t("Site Name: Second"),
'#placeholder' => t("County of ..."),
'#default_value' => theme_get_setting('site_name_second'),
'#description' => t('Site name is split into two parts to improve presentation on small screens.'),
];
$form['social'] = [
'#type' => 'details',
'#title' => t('Social Links'),
'#collapsed' => TRUE,
];
$form['social']['email'] = [
'#type' => 'textfield',
'#title' => t('Email'),
'#default_value' => theme_get_setting('email'),
'#placeholder' => 'https://newsroom.courts.ca.gov/alerts',
];
$form['social']['facebook'] = [
'#type' => 'textfield',
'#title' => t('Facebook'),
'#default_value' => theme_get_setting('facebook'),
'#placeholder' => 'https://www.facebook.com/[name]/',
];
$form['social']['flickr'] = [
'#type' => 'textfield',
'#title' => t('Flickr'),
'#default_value' => theme_get_setting('flickr'),
'#placeholder' => 'https://www.flickr.com/photos/[name]/sets/',
];
$form['social']['linkedin'] = [
'#type' => 'textfield',
'#title' => t('LinkedIn'),
'#default_value' => theme_get_setting('linkedin'),
'#placeholder' => 'https://www.linkedin.com/company/[name]/',
];
$form['social']['rss'] = [
'#type' => 'textfield',
'#title' => t('RSS'),
'#default_value' => theme_get_setting('rss'),
'#placeholder' => 'https://newsroom.courts.ca.gov/rss',
];
$form['social']['twitter'] = [
'#type' => 'textfield',
'#title' => t('Twitter'),
'#default_value' => theme_get_setting('twitter'),
'#placeholder' => 'https://twitter.com/[name]',
];
$form['social']['youtube'] = [
'#type' => 'textfield',
'#title' => t('YouTube'),
'#default_value' => theme_get_setting('youtube'),
'#placeholder' => 'https://www.youtube.com/user/[name]',
];
$form['global'] = [
'#type' => 'details',
'#title' => t('Global settings'),
'#collapsed' => TRUE,
];
$form['global']['hide_translation'] = [
'#type' => 'checkbox',
'#title' => t('Hide translation'),
'#default_value' => theme_get_setting('hide_translation'),
'#description' => t("Hide translation dropdown from header."),
];
// BEGIN: Special header body/feature.
$form['special'] = [
'#type' => 'details',
'#title' => t('Special'),
'#collapsed' => TRUE,
];
$header_body_value = '';
$header_body_format = 'full_html';
$header_body = theme_get_setting('header_body');
if (isset($header_body)) {
$header_body_value = $header_body['value'];
$header_body_format = $header_body['format'];
}
$form['special']['header_body'] = [
'#type' => 'text_format',
'#title' => 'Homepage Header Body',
'#description' => t('For inserting special content or features into the homepage header area (e.g. Granicus live cast embed).'),
'#default_value' => $header_body_value,
'#format' => $header_body_format,
];
}