-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.php
More file actions
129 lines (100 loc) · 3.08 KB
/
template.php
File metadata and controls
129 lines (100 loc) · 3.08 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
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
<?php
/**
* @file
* Contains theme override functions and preprocess functions for the flurry theme.
*/
/**
* Add body classes if certain regions have content.
*/
function flurry_preprocess_page(&$vars) {
// build main menu
$navigation_attributes = array(
'links' => $vars['main_menu'],
'attributes' => array(
'id' => 'main-menu',
'class' => array(
'links',
'clearfix'
)
),
'heading' => array(
'text' => t('Main menu'),
'class' => 'visuallyHidden',
'level' => 'h2'
)
);
$vars['navigation'] = theme('links__system_main_menu', $navigation_attributes);
}
/**
* Implements hook_html_head_alter().
* We are overwriting the default meta character type tag with HTML5 version.
*/
function flurry_html_head_alter(&$head_elements) {
$head_elements['system_meta_content_type']['#attributes'] = array(
'charset' => 'utf-8'
);
// Always force latest IE rendering engine (even in intranet) & Chrome Frame
$head_elements['flurry_meta_http_equiv'] = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'http-equiv' => 'X-UA-Compatible',
'content' => 'IE=edge,chrome=1'
),
'#weight' => -500
);
// Mobile viewport optimized: j.mp/bplateviewport
$head_elements['flurry_meta_viewport'] = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'viewport',
'content' => 'width=device-width, initial-scale=1.0'
),
'#weight' => -200
);
// Apple Touch Icon
$apple_touch_icon_path = './' . drupal_get_path('theme', $GLOBALS['theme']) . '/apple-touch-icon.png';
$flurry_apple_touch_icon_path = './' . drupal_get_path('theme', 'flurry') . '/apple-touch-icon.png';
$apple_touch_icon = (file_exists($apple_touch_icon_path))
? $apple_touch_icon_path
: $flurry_apple_touch_icon_path ;
$head_elements['apple_touch_icon'] = array(
'#type' => 'html_tag',
'#tag' => 'link',
'#attributes' => array(
'rel' => 'apple-touch-icon',
'href' => $apple_touch_icon
),
'#weight' => -100
);
}
/**
* Changes the search form to use the "search" input element of HTML5.
*/
function flurry_preprocess_search_block_form(&$vars) {
$vars['search_form'] = str_replace('type="text"', 'type="search"', $vars['search_form']);
}
/**
* Override unformated view style
*/
function flurry_preprocess_views_view(&$vars) {
//kpr($vars);
}
/**
* Override or insert variables into the block templates.
*
* @param $vars
* An array of variables to pass to the theme template.
* @param $hook
* The name of the template being rendered ("block" in this case.)
*/
function flurry_preprocess_block(&$vars, $hook) {
if ($vars['elements']['#block']->region === 'subnav') {
// visually hide title in subnav region
$vars['title_attributes_array'] = array(
"class" => "visuallyHidden",
);
$vars['classes_array'][] = "clearfix";
}
}