Révision 74f6bef0
Ajouté par Assos Assos il y a plus de 10 ans
drupal7/sites/all/themes/adaptivetheme/at_core/inc/process.inc | ||
---|---|---|
19 | 19 |
// comment for IE. |
20 | 20 |
$vars['rdf_namespaces'] = empty($vars['rdf_namespaces_array']) ? '' : drupal_attributes($vars['rdf_namespaces_array']); |
21 | 21 |
|
22 |
if (!empty($vars['polyfills_array'])) { |
|
23 |
$vars['polyfills'] = drupal_static('adaptivetheme_process_html_polyfills'); |
|
24 |
if (empty($vars['polyfills'])) { |
|
25 |
$ie_scripts = array(); |
|
26 |
if (!empty($vars['polyfills_array'])) { |
|
27 |
foreach ($vars['polyfills_array'] as $ke => $va) { |
|
28 |
foreach ($va as $k => $v) { |
|
29 |
$ies[$k][] = implode("\n", $v); |
|
30 |
} |
|
31 |
} |
|
32 |
} |
|
33 |
foreach ($ies as $kv => $kvp) { |
|
34 |
$aus[$kv] = implode("\n", $kvp); |
|
35 |
} |
|
36 |
$vars['polyfills'] = at_theme_conditional_scripts($aus); |
|
37 |
} |
|
38 |
} |
|
39 |
else { |
|
40 |
$vars['polyfills'] = ''; |
|
22 |
// Render polyfills |
|
23 |
if ($vars['polyfills']) { |
|
24 |
$vars['polyfills'] = drupal_render($vars['polyfills']); |
|
41 | 25 |
} |
42 | 26 |
} |
43 | 27 |
|
... | ... | |
75 | 59 |
|
76 | 60 |
// Theme the menu bars |
77 | 61 |
if (!empty($vars['primary_navigation'])) { |
78 |
$vars['primary_navigation'] = theme('menubar', array('menu' => $vars['primary_navigation'], 'type' => 'primary'));
|
|
62 |
$vars['primary_navigation'] = theme('menubar', array('menu' => $vars['primary_navigation'],'type' => 'primary')); |
|
79 | 63 |
} |
80 | 64 |
if (!empty($vars['secondary_navigation'])) { |
81 | 65 |
$vars['secondary_navigation'] = theme('menubar', array('menu' => $vars['secondary_navigation'], 'type' => 'secondary')); |
... | ... | |
91 | 75 |
// so other suggestions can easily override it. |
92 | 76 |
if (at_get_setting('page_content_type_suggestions', $theme_name) === 1) { |
93 | 77 |
if (isset($vars['node'])) { |
94 |
$suggestion = 'page__' . str_replace('_', '--', $vars['node']->type);
|
|
78 |
$suggestion = 'page__' . $vars['node']->type;
|
|
95 | 79 |
array_unshift($vars['theme_hook_suggestions'], $suggestion); |
96 | 80 |
} |
97 | 81 |
} |
... | ... | |
157 | 141 |
$vars['outer_prefix'] = '<' . $vars['tag'] . ' id="' . $vars['block_html_id'] . '" class="' . $vars['classes'] . '" ' . $vars['attributes'] . '>'; |
158 | 142 |
$vars['outer_suffix'] = '</' . $vars['tag'] . '>'; |
159 | 143 |
|
144 |
// Block inner attributes |
|
145 |
$vars['block_inner_attributes'] = empty($vars['block_inner_attributes_array']) ? '' : drupal_attributes($vars['block_inner_attributes_array']); |
|
146 |
|
|
147 |
// Populate the default inner wrappers |
|
148 |
$vars['inner_prefix'] = '<div' . $vars['block_inner_attributes'] . '>'; |
|
149 |
$vars['inner_suffix'] = '</div>'; |
|
150 |
|
|
160 | 151 |
// Wrap the content variable in a div with attributes |
161 | 152 |
$vars['content_processed'] = '<div' . $vars['content_attributes'] . '>' . $vars['content'] . '</div>'; |
162 | 153 |
|
... | ... | |
166 | 157 |
$vars['inner_suffix'] = ''; |
167 | 158 |
$vars['content_processed'] = $vars['content']; // remove the default wrapper |
168 | 159 |
} |
160 |
// Navigation or menu blocks get special treatment in these regions |
|
161 |
if ($vars['block']->region === 'leaderboard' || $vars['block']->region === 'header') { |
|
162 |
if ($vars['tag'] == 'nav') { |
|
163 |
$vars['content_processed'] = $vars['content']; // remove the default wrapper |
|
164 |
} |
|
165 |
} |
|
169 | 166 |
|
170 | 167 |
// Some blocks look bad with wrappers so we strip them |
171 | 168 |
if ($vars['block']->region === 'content') { |
... | ... | |
207 | 204 |
$vars['footer_attributes'] = empty($vars['footer_attributes_array']) ? '' : drupal_attributes($vars['footer_attributes_array']); |
208 | 205 |
$vars['links_attributes'] = empty($vars['links_attributes_array']) ? '' : drupal_attributes($vars['links_attributes_array']); |
209 | 206 |
|
210 |
// If a panels layout is being used by Display Suite in a node, we wrap the
|
|
207 |
// If a panels layout is being rendered by Display Suite in a node we wrap the
|
|
211 | 208 |
// the layout in markup to make the themers life a little easier and remove |
212 | 209 |
// the requirement to add a DS template override. |
213 |
if (module_exists('ds')) { |
|
214 |
$panels_data = drupal_static(__FUNCTION__, array()); |
|
215 |
if (empty($panels_data)) { |
|
216 |
$panels_data = responsive_panels_plugin_names(); |
|
217 |
} |
|
218 |
foreach ($panels_data as $plugin => $name) { |
|
219 |
if (in_array($name, $vars['theme_hook_suggestions'])) { |
|
220 |
$vars['panel_prefix'] = '<article id="node-' . $vars['node']->nid . '" class="' . $vars['classes'] . ' clearfix"' . $vars['attributes'] . '>'; |
|
221 |
$vars['panel_suffix'] = '</article>'; |
|
222 |
} |
|
223 |
} |
|
224 |
} |
|
225 |
/* This will replace the above code @see http://drupal.org/node/1514216 |
|
226 | 210 |
if (isset($vars['rendered_by_ds']) && $vars['rendered_by_ds'] == TRUE) { |
227 |
$vars['panel_prefix'] = '<article id="node-' . $vars['node']->nid . '" class="' . $vars['classes'] . ' clearfix"' . $vars['attributes'] . '>'; |
|
211 |
$vars['panel_prefix'] = '<article id="node-' . $vars['node']->nid . '" class="' . $vars['classes'] . ' rendered-by-ds clearfix"' . $vars['attributes'] . '>'; |
|
212 |
$vars['panel_prefix'] .= render($vars['title_prefix']); |
|
213 |
$vars['panel_prefix'] .= render($vars['title_suffix']); |
|
228 | 214 |
$vars['panel_suffix'] = '</article>'; |
229 | 215 |
} |
230 |
*/ |
|
231 | 216 |
} |
232 | 217 |
|
233 | 218 |
/** |
... | ... | |
273 | 258 |
* Process variables for maintenance-page.tpl.php |
274 | 259 |
*/ |
275 | 260 |
function adaptivetheme_process_maintenance_page(&$vars) { |
276 |
// Load polyfills for the maintenance page, its HTML5 also |
|
277 |
if (!empty($vars['polyfills_array'])) { |
|
278 |
$vars['polyfills'] = drupal_static('adaptivetheme_process_html_polyfills'); |
|
279 |
if (empty($vars['polyfills'])) { |
|
280 |
$ie_scripts = array(); |
|
281 |
if (!empty($vars['polyfills_array'])) { |
|
282 |
foreach ($vars['polyfills_array'] as $ke => $va) { |
|
283 |
foreach ($va as $k => $v) { |
|
284 |
$ies[$k][] = implode("\n", $v); |
|
285 |
} |
|
286 |
} |
|
287 |
} |
|
288 |
foreach ($ies as $kv => $kvp) { |
|
289 |
$aus[$kv] = implode("\n", $kvp); |
|
290 |
} |
|
291 |
$vars['polyfills'] = at_theme_conditional_scripts($aus); |
|
292 |
} |
|
261 |
// Render polyfills |
|
262 |
if ($vars['polyfills']) { |
|
263 |
$vars['polyfills'] = drupal_render($vars['polyfills']); |
|
293 | 264 |
} |
294 |
else { |
|
295 |
$vars['polyfills'] = ''; |
|
265 |
} |
|
266 |
|
|
267 |
/** |
|
268 |
* Process variables for user-profile.tpl.php |
|
269 |
*/ |
|
270 |
function adaptivetheme_process_user_profile(&$vars) { |
|
271 |
// If a panels layout is rendered by Display Suite in a user profile we wrap the |
|
272 |
// the layout in markup to make the themers life a little easier and remove |
|
273 |
// the requirement to add a DS template override. |
|
274 |
if (isset($vars['rendered_by_ds']) && $vars['rendered_by_ds'] == TRUE) { |
|
275 |
$vars['panel_prefix'] = '<article id="user-' . $vars['user']->uid . '" class="' . $vars['classes'] . ' rendered-by-ds clearfix"' . $vars['attributes'] . '>'; |
|
276 |
$vars['panel_suffix'] = '</article>'; |
|
296 | 277 |
} |
297 | 278 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules