-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme-settings.php
More file actions
100 lines (90 loc) · 2.89 KB
/
theme-settings.php
File metadata and controls
100 lines (90 loc) · 2.89 KB
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
<?php
/**
* @file
* Theme settings functionality.
*/
/**
* Implements hook_form_FORM_ID_alter().
*/
function fds_base_theme_form_system_theme_settings_alter(&$form, $form_state, $form_id = NULL) {
// Vertical tabs.
$form['options'] = array(
'#type' => 'vertical_tabs',
'#default_tab' => 'main',
'#weight' => '-20',
'#prefix' => '<h2><small>' . t('FDS settings') . '</small></h2>',
'#title' => t('FDS settings'),
);
/*
|--------------------------------------------------------------------------
| Header.
|--------------------------------------------------------------------------
*/
// Fieldset.
$form['options']['header'] = [
'#type' => 'fieldset',
'#title' => t('Header'),
];
// Authority details - show.
$form['options']['header']['authority_details']['authority_details_show'] = [
'#type' => 'checkbox',
'#title' => t('Show authority details'),
'#default_value' => theme_get_setting('authority_details_show'),
];
// Authority details - name.
$form['options']['header']['authority_details']['authority_details_name'] = [
'#type' => 'textfield',
'#title' => t('Name of authority'),
'#description' => t('Ex. Myndighedsnavn'),
'#default_value' => theme_get_setting('authority_details_name'),
'#states' => [
'visible' => [
':input[name="authority_details_show"]' => [
'checked' => TRUE,
],
],
],
];
// Authority details - text.
$form['options']['header']['authority_details']['authority_details_text'] = [
'#type' => 'textfield',
'#title' => t('Text'),
'#description' => t('Ex. Support:'),
'#default_value' => theme_get_setting('authority_details_text'),
'#states' => [
'visible' => [
':input[name="authority_details_show"]' => [
'checked' => TRUE,
],
],
],
];
// Authority details - phone number - system.
$form['options']['header']['authority_details']['authority_details_phone_system'] = [
'#type' => 'textfield',
'#title' => t('Phone no. - technical format'),
'#description' => t('Remember language code. Ex: 004512345678'),
'#default_value' => theme_get_setting('authority_details_phone_system'),
'#states' => [
'visible' => [
':input[name="authority_details_show"]' => [
'checked' => TRUE,
],
],
],
];
// Authority details - phone number - readable.
$form['options']['header']['authority_details']['authority_details_phone_readable'] = [
'#type' => 'textfield',
'#title' => t('Phone no. - readable format'),
'#description' => t('The number that is visible for the user. Can contain spaces. Ex. +45 12 34 56 78'),
'#default_value' => theme_get_setting('authority_details_phone_readable'),
'#states' => [
'visible' => [
':input[name="authority_details_show"]' => [
'checked' => TRUE,
],
],
],
];
}