1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Implimentation of a Page Layout Plugin for Adaptivetheme.
|
6
|
*
|
7
|
* @see three_col_grail.inc for detailed documentation.
|
8
|
*/
|
9
|
function two_sidebars_left() {
|
10
|
$page_layout['two_sidebars_left'] = array(
|
11
|
'title' => t('Two Sidebars Left'),
|
12
|
'category' => t('AT Core layout'),
|
13
|
'method' => 'two_sidebars_left',
|
14
|
'type' => 'page_layout',
|
15
|
'device_groups' => array(
|
16
|
'bigscreen',
|
17
|
'tablet_landscape',
|
18
|
),
|
19
|
);
|
20
|
|
21
|
return $page_layout;
|
22
|
}
|
23
|
|
24
|
/**
|
25
|
* CSS Builder for the two_sidebars_left layout.
|
26
|
* Positions both sidebars to the left of the main content column.
|
27
|
*
|
28
|
* @param $sidebar_first, an arbitary numeric value.
|
29
|
* @param $sidebar_second, an arbitary numeric value.
|
30
|
* @param $sidebar_unit, a value unit, one of px, em or %.
|
31
|
*/
|
32
|
function two_sidebars_left_layout($sidebar_first, $sidebar_second, $sidebar_unit) {
|
33
|
|
34
|
$left = 'left';
|
35
|
$right = 'right';
|
36
|
|
37
|
$content_margin = $sidebar_second + $sidebar_first . $sidebar_unit;
|
38
|
$sidebar_first = $sidebar_first . $sidebar_unit;
|
39
|
$sidebar_second = $sidebar_second . $sidebar_unit;
|
40
|
$left_margin = $sidebar_first;
|
41
|
$right_margin = $sidebar_second;
|
42
|
$push_right = $sidebar_first;
|
43
|
|
44
|
$styles = <<<EOF
|
45
|
#content-column,.content-column,div.sidebar {float: left; clear: none}
|
46
|
.two-sidebars .content-inner {margin-$left: $content_margin; margin-$right: 0}
|
47
|
.sidebar-first .content-inner {margin-$left: $left_margin; margin-$right: 0}
|
48
|
.sidebar-second .content-inner {margin-$left: $right_margin; margin-$right: 0}
|
49
|
.region-sidebar-first {width: $sidebar_first; margin-$left: -100%}
|
50
|
.region-sidebar-second {width: $sidebar_second; margin-$left: -100%}
|
51
|
.two-sidebars .region-sidebar-second {width: $sidebar_second; position: relative; $left: $push_right}
|
52
|
EOF;
|
53
|
|
54
|
return $styles;
|
55
|
}
|