Projet

Général

Profil

Paste
Télécharger (1,74 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / adaptivetheme / at_core / layouts / core / two_sidebars_left_stack / two_sidebars_left_stack.inc @ 74f6bef0

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_stack() {
10
  $page_layout['two_sidebars_left_stack'] = array(
11
    'title'    => t('Two Sidebars Left Stacked'),
12
    'category' => t('AT Core layout'),
13
    'method'   => 'two_sidebars_left_stack',
14
    'type'     => 'page_layout',
15
    'device_groups' => array(
16
      'tablet_landscape',
17
      'tablet_portrait',
18
     ),
19
  );
20

    
21
  return $page_layout;
22
}
23

    
24
/**
25
 * CSS Builder for the two_sidebars_left_stack layout.
26
 * Both sidebars are pushed to the left, however the second sidebar wraps below
27
 * the main content column and is 100% width. Sometimes known as a "column drop"
28
 * layout, and conceptually similar to the two_sidebars_right_stack.
29
 *
30
 * @param $sidebar_first, an arbitary numeric value.
31
 * @param $sidebar_second, an arbitary numeric value.
32
 * @param $sidebar_unit, a value unit, one of px, em or %.
33
 */
34
function two_sidebars_left_stack_layout($sidebar_first, $sidebar_second, $sidebar_unit) {
35

    
36
  $left = 'left';
37
  $right = 'right';
38

    
39
  $sidebar_first = $sidebar_first . $sidebar_unit;
40
  $push_left     = $sidebar_first;
41

    
42
  $styles = <<<EOF
43
#content-column,.content-column,.region-sidebar-first {float: left; clear: none}
44
.two-sidebars .content-inner {margin-$left: $push_left; margin-$right: 0}
45
.sidebar-first .content-inner {margin-$left: $push_left; margin-$right: 0}
46
.sidebar-second .content-inner {margin-$right: 0; margin-$left: 0}
47
.region-sidebar-first {width: $sidebar_first; margin-$left: -100%}
48
.region-sidebar-second {width: 100%; margin-left: 0; margin-right: 0; margin-top: 20px; clear: both; overflow: hidden}
49
.region-sidebar-second .block {float: left; clear: none}
50
EOF;
51

    
52
  return $styles;
53
}