1 |
d7f58da2
|
Florent Torregrosa
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Implimentation of a Page Layout Plugin for MAYO.
|
6 |
|
|
*
|
7 |
|
|
* @see three_col_grail.inc for detailed documentation.
|
8 |
|
|
*/
|
9 |
|
|
function one_col_vert() {
|
10 |
|
|
$page_layout['one_col_vert'] = array(
|
11 |
|
|
'title' => t('One Column Vertical Sidebars'),
|
12 |
|
|
'method' => 'one_col_vert',
|
13 |
|
|
'type' => 'page_layout',
|
14 |
|
|
'device_groups' => array(
|
15 |
|
|
'tablet_portrait',
|
16 |
|
|
'smalltouch_landscape',
|
17 |
|
|
),
|
18 |
|
|
);
|
19 |
|
|
|
20 |
|
|
return $page_layout;
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
/**
|
24 |
|
|
* CSS Builder for the one_col_vert layout.
|
25 |
|
|
* Displays sidebars vertically side by side beneath the main content column.
|
26 |
|
|
*
|
27 |
|
|
* @param $sidebar_first, an arbitary numeric value.
|
28 |
|
|
* @param $sidebar_second, an arbitary numeric value.
|
29 |
|
|
* @param $sidebar_unit, a value unit, one of px, em or %.
|
30 |
|
|
*/
|
31 |
|
|
function one_col_vert_layout($sidebar_first, $sidebar_second, $sidebar_unit) {
|
32 |
|
|
|
33 |
|
|
$one_sidebar = $sidebar_first + $sidebar_second . $sidebar_unit;
|
34 |
|
|
$sidebar_first = $sidebar_first . $sidebar_unit;
|
35 |
|
|
$sidebar_second = $sidebar_second . $sidebar_unit;
|
36 |
|
|
|
37 |
|
|
$styles = <<<EOF
|
38 |
|
|
.two-sidebars #content,.one-sidebar #content,#sidebar-first,#sidebar-second {margin-left: 0; margin-right: 0}
|
39 |
|
|
#sidebar-first {width: $sidebar_first}
|
40 |
|
|
.one-sidebar #sidebar-first {width: 100%;}
|
41 |
|
|
#sidebar-second {width: $sidebar_second}
|
42 |
|
|
#sidebar-first,#sidebar-second {overflow: hidden; margin-top: 20px; float: left; clear: none}
|
43 |
|
|
#sidebar-first .section {margin-right: 5px; margin-left: 0;}
|
44 |
|
|
.one-sidebar #sidebar-first .section {margin-right: 0; margin-left: 0;}
|
45 |
|
|
#sidebar-second .section {margin-right: 0; margin-left: 5px;}
|
46 |
|
|
#top-columns .column-block-wrapper {width: 100% !important; margin-top: 1em;}
|
47 |
|
|
#top-columns .column-block-wrapper .column-block {height: auto ; margin: 0 !important;}
|
48 |
|
|
EOF;
|
49 |
|
|
|
50 |
|
|
return $styles;
|
51 |
|
|
} |