twocol_bricks.inc in Panels 5.2
Implementation for the two column bricked layout
File
layouts/twocol_bricks.incView source
<?php
/**
* @file twocol_bricks.inc
*
* Implementation for the two column bricked layout
*/
/**
* implementation of hook_panels_layouts
*/
function panels_twocol_bricks_panels_layouts() {
$items['twocol_bricks'] = array(
'title' => t('Two column bricks'),
'icon' => 'layouts/twocol_bricks.png',
'theme' => 'panels_twocol_bricks',
'css' => 'layouts/twocol_bricks.css',
'panels' => array(
'top' => t('Top'),
'left_above' => t('Left above'),
'right_above' => t('Right above'),
'middle' => t('Middle'),
'left_below' => t('Left below'),
'right_below' => t('Right below'),
'bottom' => t('Bottom'),
),
);
return $items;
}
/**
* This function uses heredoc notation to make it easier to convert
* to a template.
*/
function theme_panels_twocol_bricks($id, $content) {
if ($id) {
$idstr = " id='{$id}'";
}
$output = <<<EOT
<div class="panel-display panel-2col-bricks clear-block" {<span class="php-variable">$idstr</span>}>
<div class="panel-panel panel-col-top">
<div class="inside">{<span class="php-variable">$content</span>[<span class="php-string">'top'</span>]}</div>
</div>
<div class="center-wrapper">
<div class="panel-panel panel-col-first">
<div class="inside">{<span class="php-variable">$content</span>[<span class="php-string">'left_above'</span>]}</div>
</div>
<div class="panel-panel panel-col-last">
<div class="inside">{<span class="php-variable">$content</span>[<span class="php-string">'right_above'</span>]}</div>
</div>
</div>
<div class="panel-panel panel-col-middle">
<div class="inside">{<span class="php-variable">$content</span>[<span class="php-string">'middle'</span>]}</div>
</div>
<div class="center-wrapper">
<div class="panel-panel panel-col-first">
<div class="inside">{<span class="php-variable">$content</span>[<span class="php-string">'left_below'</span>]}</div>
</div>
<div class="panel-panel panel-col-last">
<div class="inside">{<span class="php-variable">$content</span>[<span class="php-string">'right_below'</span>]}</div>
</div>
</div>
<div class="panel-panel panel-col-bottom">
<div class="inside">{<span class="php-variable">$content</span>[<span class="php-string">'bottom'</span>]}</div>
</div>
</div>
EOT;
return $output;
}
Functions
Name | Description |
---|---|
panels_twocol_bricks_panels_layouts | implementation of hook_panels_layouts |
theme_panels_twocol_bricks | This function uses heredoc notation to make it easier to convert to a template. |