-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme-settings.php
76 lines (67 loc) · 3.21 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
<?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'),
'#open' => true,
];
$form['palm_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_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_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_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_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_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'),
];
$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
];
}