You are here

twocol.inc in Panels 5

Same filename and directory in other branches
  1. 5.2 layouts/twocol.inc

File

layouts/twocol.inc
View source
<?php

/**
 * implementation of hook_panels_layouts
 */
function panels_twocol_panels_layouts() {
  $items['twocol'] = array(
    'module' => 'panels',
    'title' => t('Two column'),
    'icon' => 'layouts/twocol.png',
    'theme' => 'panels_twocol',
    'css' => 'layouts/twocol.css',
    'content areas' => array(
      'left' => t('Left side'),
      'right' => t('Right side'),
    ),
  );
  return $items;
}

/**
 * This function uses heredoc notation to make it easier to convert
 * to a template.
 */
function theme_panels_twocol($id, $content) {
  if ($id) {
    $idstr = " id='{$id}'";
  }
  $output = <<<EOT
<div class="panel-2col" {<span class="php-variable">$idstr</span>}>
  <div class="panel-col-first">
    <div>{<span class="php-variable">$content</span>[<span class="php-string">'left'</span>]}</div>
  </div>

  <div class="panel-col-last">
    <div>{<span class="php-variable">$content</span>[<span class="php-string">'right'</span>]}</div>
  </div>
</div>
<br class="panel-clearer" />
EOT;
  return $output;
}

Functions

Namesort descending Description
panels_twocol_panels_layouts implementation of hook_panels_layouts
theme_panels_twocol This function uses heredoc notation to make it easier to convert to a template.