Projet

Général

Profil

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

root / drupal7 / sites / all / themes / adaptivetheme / at_core / layouts / core / one_col_vert / one_col_vert.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 one_col_vert() {
10
  $page_layout['one_col_vert'] = array(
11
    'title'    => t('One Column Vertical Sidebars'),
12
    'category' => t('AT Core layout'),
13
    'method'   => 'one_col_vert',
14
    'type'     => 'page_layout',
15
    'device_groups' => array(
16
      'tablet_portrait',
17
      'smalltouch_landscape',
18
     ),
19
  );
20

    
21
  return $page_layout;
22
}
23

    
24
/**
25
 * CSS Builder for the one_col_vert layout.
26
 * Displays sidebars vertically side by side beneath 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 one_col_vert_layout($sidebar_first, $sidebar_second, $sidebar_unit) {
33

    
34
  $one_sidebar    = $sidebar_first + $sidebar_second . $sidebar_unit;
35
  $sidebar_first  = $sidebar_first . $sidebar_unit;
36
  $sidebar_second = $sidebar_second . $sidebar_unit;
37

    
38
  $styles = <<<EOF
39
.two-sidebars .content-inner,.one-sidebar .content-inner,.region-sidebar-first,.region-sidebar-second {margin-left: 0; margin-right: 0}
40
.region-sidebar-first {width: $sidebar_first}
41
.region-sidebar-second {width: $sidebar_second}
42
.one-sidebar .sidebar {width: $one_sidebar}
43
.region-sidebar-first,.region-sidebar-second {overflow: hidden; margin-top: 20px; float: left; clear: none}
44
.region-sidebar-first.block,.region-sidebar-second .block {width: 100%}
45
EOF;
46

    
47
  return $styles;
48
}