1 |
cc7b6b59
|
Julien Enselme
|
<?php
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
function responsive_html_head_alter(&$head_elements) {
|
7 |
|
|
$head_elements['system_meta_content_type']['#attributes'] = array(
|
8 |
|
|
'charset' => 'utf-8'
|
9 |
|
|
);
|
10 |
|
|
}
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
|
|
function responsive_breadcrumb($variables) {
|
16 |
|
|
$breadcrumb = $variables['breadcrumb'];
|
17 |
|
|
if (!empty($breadcrumb)) {
|
18 |
|
|
|
19 |
|
|
$output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
|
20 |
|
|
|
21 |
|
|
$breadcrumb[] = drupal_get_title();
|
22 |
|
|
$output .= '<nav class="breadcrumb">' . implode(' » ', $breadcrumb) . '</nav>';
|
23 |
|
|
return $output;
|
24 |
|
|
}
|
25 |
|
|
}
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
function responsive_process_html(&$vars) {
|
31 |
|
|
|
32 |
|
|
if (module_exists('color')) {
|
33 |
|
|
_color_html_alter($vars);
|
34 |
|
|
}
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
|
|
function responsive_process_page(&$variables) {
|
41 |
|
|
|
42 |
|
|
if (module_exists('color')) {
|
43 |
|
|
_color_page_alter($variables);
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
function responsive_preprocess_page(&$vars) {
|
52 |
|
|
if (isset($vars['main_menu'])) {
|
53 |
|
|
$vars['main_menu'] = theme('links__system_main_menu', array(
|
54 |
|
|
'links' => $vars['main_menu'],
|
55 |
|
|
'attributes' => array(
|
56 |
|
|
'class' => array('links', 'main-menu', 'clearfix'),
|
57 |
|
|
),
|
58 |
|
|
'heading' => array(
|
59 |
|
|
'text' => t('Main menu'),
|
60 |
|
|
'level' => 'h2',
|
61 |
|
|
'class' => array('element-invisible'),
|
62 |
|
|
)
|
63 |
|
|
));
|
64 |
|
|
}
|
65 |
|
|
else {
|
66 |
|
|
$vars['main_menu'] = FALSE;
|
67 |
|
|
}
|
68 |
|
|
if (isset($vars['secondary_menu'])) {
|
69 |
|
|
$vars['secondary_menu'] = theme('links__system_secondary_menu', array(
|
70 |
|
|
'links' => $vars['secondary_menu'],
|
71 |
|
|
'attributes' => array(
|
72 |
|
|
'class' => array('links', 'secondary-menu', 'clearfix'),
|
73 |
|
|
),
|
74 |
|
|
'heading' => array(
|
75 |
|
|
'text' => t('Secondary menu'),
|
76 |
|
|
'level' => 'h2',
|
77 |
|
|
'class' => array('element-invisible'),
|
78 |
|
|
)
|
79 |
|
|
));
|
80 |
|
|
}
|
81 |
|
|
else {
|
82 |
|
|
$vars['secondary_menu'] = FALSE;
|
83 |
|
|
}
|
84 |
|
|
}
|
85 |
|
|
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
|
|
function responsive_menu_local_tasks(&$variables) {
|
90 |
|
|
$output = '';
|
91 |
|
|
|
92 |
|
|
if (!empty($variables['primary'])) {
|
93 |
|
|
$variables['primary']['#prefix'] = '<h2 class="element-invisible">' . t('Primary tabs') . '</h2>';
|
94 |
|
|
$variables['primary']['#prefix'] .= '<ul class="tabs primary clearfix">';
|
95 |
|
|
$variables['primary']['#suffix'] = '</ul>';
|
96 |
|
|
$output .= drupal_render($variables['primary']);
|
97 |
|
|
}
|
98 |
|
|
if (!empty($variables['secondary'])) {
|
99 |
|
|
$variables['secondary']['#prefix'] = '<h2 class="element-invisible">' . t('Secondary tabs') . '</h2>';
|
100 |
|
|
$variables['secondary']['#prefix'] .= '<ul class="tabs secondary clearfix">';
|
101 |
|
|
$variables['secondary']['#suffix'] = '</ul>';
|
102 |
|
|
$output .= drupal_render($variables['secondary']);
|
103 |
|
|
}
|
104 |
|
|
return $output;
|
105 |
|
|
}
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
function responsive_preprocess_node(&$variables) {
|
111 |
|
|
$node = $variables['node'];
|
112 |
|
|
if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
|
113 |
|
|
$variables['classes_array'][] = 'node-full';
|
114 |
|
|
}
|
115 |
|
|
}
|
116 |
|
|
|
117 |
|
|
function responsive_page_alter($page) {
|
118 |
|
|
|
119 |
|
|
$viewport = array(
|
120 |
|
|
'#type' => 'html_tag',
|
121 |
|
|
'#tag' => 'meta',
|
122 |
|
|
'#attributes' => array(
|
123 |
|
|
'name' => 'viewport',
|
124 |
|
|
'content' => 'width=device-width, initial-scale=1, maximum-scale=1'
|
125 |
|
|
)
|
126 |
|
|
);
|
127 |
|
|
drupal_add_html_head($viewport, 'viewport');
|
128 |
|
|
}
|
129 |
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
|
|
if (drupal_is_front_page()) {
|
134 |
|
|
drupal_add_js(drupal_get_path('theme', 'responsive') . '/js/jquery.flexslider-min.js');
|
135 |
|
|
drupal_add_js(drupal_get_path('theme', 'responsive') . '/js/slide.js');
|
136 |
|
|
} |