home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (default.inc)

This example Drupal source code file (default.inc) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

15, array, div, foreach, function, output, pane_output, panel-region-separator, panels_default_style_render_region, panes, php, render, style, title

The default.inc Drupal example source code

<?php
// $Id: default.inc,v 1.1.2.8 2010/07/13 23:55:58 merlinofchaos Exp $

/**
 * @file
 * Definition of the 'default' panel style.
 */

// Plugin definition
$plugin = array(
  'title' => t('No style'),
  'description' => t('The default panel rendering style; displays each pane with a separator.'),
  'render region' => 'panels_default_style_render_region',
  'weight' => -15,
);

/**
 * Render callback.
 *
 * @ingroup themeable
 */
function theme_panels_default_style_render_region($display, $region_id, $panes, $settings) {
  $output = '';

  $print_separator = FALSE;
  foreach ($panes as $pane_id => $pane_output) {
    // Add the separator if we've already displayed a pane.
    if ($print_separator) {
      $output .= '<div class="panel-region-separator"></div>';
    }

    $output .= $pane_output;
    // If we displayed a pane, this will become true; if not, it will become
    // false.
    $print_separator = (bool) $pane_output;
  }

  return $output;
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal default.inc source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.