Révision d7f58da2
Ajouté par Florent Torregrosa il y a presque 10 ans
drupal7/sites/all/themes/mayo/templates/page.tpl.php | ||
---|---|---|
69 | 69 |
|
70 | 70 |
<?php |
71 | 71 |
$page_wrapper_style = ''; |
72 |
$page_width = theme_get_setting('page_width'); |
|
73 |
if (empty($page_width)) $page_width = '90%'; |
|
74 |
if (arg(0) == "admin") $page_width = '100%'; // admin page |
|
75 |
$page_wrapper_style = 'width: ' . $page_width . ';'; |
|
76 | 72 |
$base_vmargin = theme_get_setting('base_vmargin'); |
77 | 73 |
if (arg(0) == "admin") $base_vmargin = '0px'; // admin page |
78 | 74 |
if (empty($base_vmargin)) $base_vmargin = '0px'; |
... | ... | |
135 | 131 |
if (empty($searchbox_top_margin)) $searchbox_top_margin = '0px'; |
136 | 132 |
$searchbox_style = 'padding-right: ' . $searchbox_right_margin . '; padding-top: ' . $searchbox_top_margin . ';'; |
137 | 133 |
|
134 |
$menubar_style = ''; |
|
135 |
$menubar_bg_value = theme_get_setting('menubar_bg_value'); |
|
136 |
if (theme_get_setting('menubar_background') == 1) $menubar_style = ' style=" background-color: ' . $menubar_bg_value . ';"'; |
|
137 |
|
|
138 | 138 |
$fontsizer_top_margin = (intval($searchbox_top_margin) + 3) . 'px'; |
139 | 139 |
$fontsizer_style = 'margin-top: ' . $fontsizer_top_margin . ';'; |
140 | 140 |
|
141 |
$sb_layout_style = theme_get_setting('sidebar_layout_style'); |
|
142 |
$sb_first_width = theme_get_setting('sidebar_first_width'); |
|
143 |
if (empty($sb_first_width)) $sb_first_width = '25%'; |
|
144 |
$sb_first_style = 'width: ' . $sb_first_width . ';'; |
|
145 |
$sb_second_width = theme_get_setting('sidebar_second_width'); |
|
146 |
if (empty($sb_second_width)) $sb_second_width = '25%'; |
|
147 |
$sb_second_style = 'width: ' . $sb_second_width . ';'; |
|
148 |
|
|
149 |
$content_width = 100; |
|
150 |
if ($page['sidebar_first']) { |
|
151 |
$content_width -= intval(preg_replace('/%/', '', $sb_first_width)); |
|
152 |
} |
|
153 |
if ($page['sidebar_second']) { |
|
154 |
$content_width -= intval(preg_replace('/%/', '', $sb_second_width)); |
|
155 |
} |
|
156 |
$content_style = 'width: ' . $content_width . '%;'; |
|
157 |
|
|
158 |
$margins = mayo_get_margins($page['content'], $page['sidebar_first'], $page['sidebar_second']); |
|
159 |
$content_section_style = $margins['content']; |
|
160 |
$sb_first_section_style = $margins['sb_first']; |
|
161 |
$sb_second_section_style = $margins['sb_second']; |
|
162 |
|
|
163 | 141 |
if (theme_get_setting('header_fontsizer')) { |
164 | 142 |
drupal_add_js(drupal_get_path('theme', 'mayo') . '/js/mayo-fontsize.js'); |
165 | 143 |
} |
... | ... | |
243 | 221 |
|
244 | 222 |
<!-- for nice_menus, superfish --> |
245 | 223 |
<?php if ($page['menubar']) { ?> |
246 |
<div id="menubar" class="menubar clearfix"> |
|
224 |
<div id="menubar" class="menubar clearfix"<?php if(!empty($menubar_style)) echo $menubar_style; ?>>
|
|
247 | 225 |
<?php print render($page['menubar']); ?> |
248 | 226 |
</div> |
249 | 227 |
<?php } ?> |
... | ... | |
285 | 263 |
<div class="clearfix cfie"></div> |
286 | 264 |
|
287 | 265 |
|
288 |
<!-- sidebars (left) --> |
|
289 |
<?php if (($page['sidebar_first']) && ($sb_layout_style != 3)){ ?> |
|
290 |
<div id="sidebar-first" class="column sidebar" style="<?php echo $sb_first_style; ?>"><div class="section" style="<?php echo $sb_first_section_style; ?>"> |
|
291 |
<?php print render($page['sidebar_first']); ?> |
|
292 |
</div></div> <!-- /.section, /#sidebar-first --> |
|
293 |
<?php } ?> |
|
294 |
<?php if (($page['sidebar_second']) && ($sb_layout_style == 2)) { ?> |
|
295 |
<div id="sidebar-second" class="column sidebar" style="<?php echo $sb_second_style; ?>"><div class="section" style="<?php echo $sb_second_section_style; ?>"> |
|
296 |
<?php print render($page['sidebar_second']); ?> |
|
297 |
</div></div> <!-- /.section, /#sidebar-second --> |
|
298 |
<?php } ?> |
|
299 |
|
|
300 |
|
|
301 | 266 |
<!-- main content --> |
302 |
<div id="content" class="column" style="<?php echo $content_style; ?>"><div class="section" style="<?php echo $content_section_style; ?>">
|
|
267 |
<div id="content" class="column"><div class="section">
|
|
303 | 268 |
|
304 | 269 |
<?php if ($page['highlighted']) { ?> |
305 | 270 |
<div id="highlighted"><?php print render($page['highlighted']); ?></div> |
... | ... | |
321 | 286 |
|
322 | 287 |
</div></div> <!-- /.section, /#content --> |
323 | 288 |
|
324 |
|
|
325 |
<!-- sidebars (right) --> |
|
326 |
<?php if (($page['sidebar_first']) && ($sb_layout_style == 3)) { ?> |
|
327 |
<div id="sidebar-first-r" class="column sidebar" style="<?php echo $sb_first_style; ?>"><div class="section" style="<?php echo $sb_first_section_style; ?>"> |
|
289 |
<!-- sidebar (first) --> |
|
290 |
<?php if ($page['sidebar_first']){ ?> |
|
291 |
<div id="sidebar-first" class="column sidebar"><div class="section"> |
|
328 | 292 |
<?php print render($page['sidebar_first']); ?> |
329 | 293 |
</div></div> <!-- /.section, /#sidebar-first --> |
330 | 294 |
<?php } ?> |
331 |
<?php if (($page['sidebar_second']) && ($sb_layout_style != 2)) { ?> |
|
332 |
<div id="sidebar-second-r" class="column sidebar" style="<?php echo $sb_second_style; ?>"><div class="section" style="<?php echo $sb_second_section_style; ?>"> |
|
295 |
|
|
296 |
<!-- sidebar (second) --> |
|
297 |
<?php if ($page['sidebar_second']) { ?> |
|
298 |
<div id="sidebar-second" class="column sidebar"><div class="section"> |
|
333 | 299 |
<?php print render($page['sidebar_second']); ?> |
334 | 300 |
</div></div> <!-- /.section, /#sidebar-second --> |
335 | 301 |
<?php } ?> |
... | ... | |
387 | 353 |
<?php } ?> |
388 | 354 |
|
389 | 355 |
</div> <!-- /#footer-wrapper --> |
390 |
|
|
391 |
|
|
392 | 356 |
</div> <!-- /#page --> |
393 | 357 |
</div> <!-- /#page-wrapper --> |
Formats disponibles : Unified diff
Switch MAYO on version 7.x-2.0 to be adaptative.