-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy paththeme-settings.php
130 lines (128 loc) · 4.51 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
<?php
/**
* @file
* Provides specific settings for the d8_materialize theme.
*/
/**
* Implements hook_form_system_theme_settings_alter().
*/
function d8_materialize_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL) {
$colors = array(
'materialize-red' => 'materialize-red',
'red' => 'red',
'pink' => 'pink',
'purple' => 'purple',
'deep-purple' => 'deep-purple',
'indigo' => 'indigo',
'blue' => 'blue',
'light-blue' => 'light-blue',
'cyan' => 'cyan',
'teal' => 'teal',
'green' => 'green',
'light-green' => 'light-green',
'lime' => 'lime',
'yellow' => 'yellow',
'amber' => 'amber',
'orange' => 'orange',
'deep-orange' => 'deep-orange',
'brown' => 'brown',
'blue-grey' => 'blue-grey',
'grey' => 'grey',
);
$intensity = array(
"lighten-5" => "lighten-5",
"lighten-4" => "lighten-4",
"lighten-3" => "lighten-3",
"lighten-2" => "lighten-2",
"lighten-1" => "lighten-1",
"base" => "base",
"darken-1" => "darken-1",
"darken-2" => "darken-2",
"darken-3" => "darken-3",
"darken-4" => "darken-4",
);
$form['primary'] = array(
'#type' => 'details',
'#title' => \Drupal::translation()->translate('Primary color schema selector'),
'#wight' => -10,
'#open' => TRUE,
);
$form['primary']['primary_color'] = array(
'#type' => 'select',
'#title' => \Drupal::translation()->translate('Primary color selector'),
'#default_value' => theme_get_setting('primary_color'),
'#description' => \Drupal::translation()->translate('Please select the primary color'),
'#options' => $colors,
'#weight' => -10,
);
$form['primary']['primary_color_intensity'] = array(
'#type' => 'select',
'#title' => \Drupal::translation()->translate('Primary color intensity selector'),
'#default_value' => theme_get_setting('primary_color_intensity'),
'#description' => \Drupal::translation()->translate('Select the intensity of the primary color'),
'#options' => $intensity,
'#weight' => -10,
);
$form['secondary'] = array(
'#type' => 'details',
'#title' => \Drupal::translation()->translate('Secondary color schema selector'),
'#wight' => -10,
'#open' => TRUE,
);
$form['secondary']['secondary_color'] = array(
'#type' => 'select',
'#title' => \Drupal::translation()->translate('Secondary color selector'),
'#default_value' => theme_get_setting('secondary_color'),
'#description' => \Drupal::translation()->translate('Please select the secondary color'),
'#options' => $colors,
'#weight' => -10,
);
$form['secondary']['secondary_color_intensity'] = array(
'#type' => 'select',
'#title' => \Drupal::translation()->translate('Secondary color intensity selector'),
'#default_value' => theme_get_setting('secondary_color_intensity'),
'#description' => \Drupal::translation()->translate('Select the intensity of the secondary color'),
'#options' => $intensity,
'#weight' => -10,
);
$form['form_color'] = array(
'#type' => 'details',
'#title' => \Drupal::translation()->translate('Form color schema selector'),
'#wight' => -10,
'#open' => TRUE,
);
$form['form_color']['form_color'] = array(
'#type' => 'select',
'#title' => \Drupal::translation()->translate('Form color selector'),
'#default_value' => theme_get_setting('form_color'),
'#description' => \Drupal::translation()->translate('Please select the form elements color'),
'#options' => $colors,
'#weight' => -10,
);
$form['form_color']['form_color_intensity'] = array(
'#type' => 'select',
'#title' => \Drupal::translation()->translate('Form color intensity selector'),
'#default_value' => theme_get_setting('form_color_intensity'),
'#description' => \Drupal::translation()->translate('Select the intensity of the form elements color'),
'#options' => $intensity,
'#weight' => -10,
);
$template_options = array(
'default' => 'default',
'single_page' => 'single_page',
'blog' => 'blog',
);
$form['page_twig_template'] = array(
'#type' => 'details',
'#title' => \Drupal::translation()->translate('Chose template'),
'#wight' => -9,
'#open' => TRUE,
);
$form['page_twig_template']['d8_template'] = array(
'#type' => 'select',
'#title' => \Drupal::translation()->translate('Form color selector'),
'#default_value' => theme_get_setting('d8_template'),
'#description' => \Drupal::translation()->translate('Please select the form elements color'),
'#options' => $template_options,
);
}