-
Notifications
You must be signed in to change notification settings - Fork 10
/
theme-settings.php
81 lines (78 loc) · 2.5 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
<?php
/**
* Implements hook_form_system_theme_settings_alter().
*/
function cambridge_theme_form_system_theme_settings_alter(&$form, $form_state) {
global $base_url;
$form['cambridge'] = array(
'#type' => 'fieldset',
'#title' => t('Theme settings'),
'#weight' => 0,
);
$form['cambridge']['colour_scheme'] = array(
'#type' => 'select',
'#title' => t('Colour scheme'),
'#options' => array(
1 => 'Blue',
2 => 'Turquoise',
3 => 'Purple',
4 => 'Green',
5 => 'Orange',
6 => 'Red',
7 => 'Grey',
8 => 'Lime',
9 => 'Blue-grey',
),
'#default_value' => theme_get_setting('colour_scheme'),
);
$form['cambridge']['search_box'] = array(
'#type' => 'radios',
'#title' => t('Search box'),
'#description' => t('Choose what the search box in the global navigation searches.'),
'#options' => array(
0 => t('Whole University'),
1 => t('This site (ie ' . $base_url . ')'),
2 => t('Search engine filter'),
),
'#default_value' => theme_get_setting('search_box'),
);
$form['cambridge']['search_box_filter'] = array(
'#type' => 'fieldset',
'#title' => t('Filter settings'),
'#description' => t('These details must match a filter configured in the University\'s search engine.'),
'#states' => array(
'visible' => array(
':input[name="search_box"]' => array('value' => 2),
),
),
);
$form['cambridge']['search_box_filter']['search_box_filter_inst'] = array(
'#type' => 'textfield',
'#title' => t('Institution filter code'),
'#default_value' => theme_get_setting('search_box_filter_inst'),
'#states' => array(
'visible' => array(
':input[name="search_box"]' => array('value' => 2),
),
'required' => array(
':input[name="search_box"]' => array('value' => 2),
),
),
);
$form['cambridge']['search_box_filter']['search_box_filter_tag'] = array(
'#type' => 'textfield',
'#title' => t('Tag'),
'#default_value' => theme_get_setting('search_box_filter_tag'),
'#states' => array(
'visible' => array(
':input[name="search_box"]' => array('value' => 2),
),
),
);
// Hide reference to non-existent default logo.
$form['logo']['default_logo']['#type'] = 'hidden';
$form['logo']['default_logo']['#default_value'] = 0;
unset($form['logo']['settings']['#states']);
$form['logo']['settings']['logo_path']['#description'] =
t('The path to the file you would like to use as your logo file.');
}