Projet

Général

Profil

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

root / drupal7 / sites / all / themes / mayo / layouts / core / two_sidebars_left_stack / two_sidebars_left_stack.inc @ d7f58da2

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

    
20
  return $page_layout;
21
}
22

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

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

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

    
41
  $styles = <<<EOF
42
.two-sidebars #content .section {margin-$left: $push_left; margin-$right: 0}
43
.one-sidebar #content .section {margin-$left: $push_left; margin-$right: 0}
44
#sidebar-first {width: $sidebar_first; margin-$left: -100%}
45
#sidebar-first .section { margin-left: 0; margin-right: 10px;}
46
#sidebar-second .region-sidebar-second { display: table; width: 100%;border-spacing: 10px;}
47
#sidebar-second {width: 100%; margin-left: 0; margin-right: 0; margin-top: 20px; clear: both; overflow: hidden; display: table-row;}
48
#sidebar-second .block {display: table-cell;}
49
#sidebar-second .section { margin: 0 -10px; }
50
EOF;
51

    
52
  return $styles;
53
}