-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcts_demo.theme
95 lines (85 loc) · 2.92 KB
/
cts_demo.theme
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
<?php
/**
* @file
* Functions to support theming in the CTS Demo theme.
*/
/**
* Implements hook_preprocess_HOOK() for HTML document templates.
*
* Adds body classes if certain regions have content.
*/
function cts_demo_preprocess_html(&$variables) {
// Retrieving skin option selected in theme settings
$site_flavor = theme_get_setting('site_flavor', 'cts_demo');
$variables['attributes']['class'][] = 'cts-skin-' . $site_flavor;
}
/**
* Override or insert variables into the page templates.
*
* @param $variables
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("page" in this case.)
* @TODO: gt_tools check doesn't work properly with overlay turned on.
*/
function cts_demo_preprocess_page(&$variables, $hook) {
/**
* Below is where we set the variables based on our custom theme settings selections,
* which are used in the page.tpl.php file.
*
*/
// Retrieve the Division selection from the theme settings,
// and set the variable with the appropriate text.
$division_id = theme_get_setting('division_id');
switch ($division_id) {
case 0:
$variables['division_id'] = 'Divison of Leprechaun Arbitration';
break;
case 1:
$variables['division_id'] = 'Divison of Sugar Procurement';
break;
case 2:
$variables['division_id'] = 'Divison of Marshmallow Engineering';
break;
default:
$variables['division_id'] = 'Divison of Leprechaun Arbitration';
}
// Retrieve the Territory selection from the theme settings,
// and set the variable with the appropriate text.
$division_id = theme_get_setting('territory_id');
switch ($division_id) {
case 0:
$variables['territory_id'] = 'Northeastern United States Territory';
break;
case 1:
$variables['territory_id'] = 'Southeastern United States Territory';
break;
case 2:
$variables['territory_id'] = 'Southwestern United States Territory';
break;
default:
$variables['territory_id'] = 'Northeastern United States Territory';
}
// Retrieve the main menu location selection from the theme settings,
// and set the variable with the appropriate text.
$main_menu_location = theme_get_setting('main_menu_location');
switch ($main_menu_location) {
case 0:
$variables['main_menu_location'] = 'top';
break;
case 1:
$variables['main_menu_location'] = 'sidebar';
break;
default:
$variables['main_menu_location'] = 'top';
}
// Check whether or not they've opted to include a leprechaun mascot
$leprechaun_mascot = theme_get_setting('leprechaun_mascot');
if ($leprechaun_mascot != '') {
$variables['leprechaun_mascot'] = $leprechaun_mascot;
$leprechaun_mascot_style = theme_get_setting('leprechaun_mascot_style');
$variables['leprechaun_mascot_style'] = $leprechaun_mascot_style;
} else {
$variables['leprechaun_mascot'] = FALSE;
}
}