-
Notifications
You must be signed in to change notification settings - Fork 1
/
theme-settings.php
45 lines (39 loc) · 1.42 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
<?php
/**
* @file
* Default theme settings.
*/
/**
* Add toogle option to theme settings to enable/disable dropdown menu.
*/
function ec_resp_form_system_theme_settings_alter(&$form, &$form_state) {
$form['dropdown_fieldset'] = array(
'#type' => 'fieldset',
'#title' => t('Dropdown menu settings'),
);
$form['dropdown_fieldset']['disable_dropdown_menu'] = array(
'#type' => 'checkbox',
'#title' => t('Disable dropdown menu'),
'#default_value' => theme_get_setting('disable_dropdown_menu'),
);
$form['interinstitutional_fieldset'] = array(
'#type' => 'fieldset',
'#title' => t('Interinstitutional theme'),
);
$form['interinstitutional_fieldset']['enable_interinstitutional_theme'] = array(
'#type' => 'checkbox',
'#title' => t('Enable Interinstitutional theme'),
'#default_value' => theme_get_setting('enable_interinstitutional_theme'),
);
$form['#submit'][] = 'ec_resp_theme_settings_submit';
}
/**
* Form submission handler for ec_resp_form_system_theme_settings_alter().
*/
function ec_resp_theme_settings_submit($form, &$form_state) {
// The 'easy_breadcrumb-segments_separator' variable is used by
// easy-breadcrumb module, to construct link separators.
// For interinstituional template, we replace it by an image.
$separator = ($form_state['values']['enable_interinstitutional_theme'] == 0) ? '>' : ' ';
variable_set('easy_breadcrumb-segments_separator', $separator);
}