|
|
Drupal example source code file (block.inc)
The block.inc Drupal example source code<?php /** * @file * Definition of the 'block' panel style. */ // Plugin definition $plugin = array( 'title' => t('System block'), 'description' => t('Display the pane as a system block; this is more restrictive than the default.'), 'render pane' => 'panels_block_style_render_pane', 'weight' => -10, ); /** * Render callback. * * @ingroup themeable */ function theme_panels_block_style_render_pane($vars) { $content = $vars['content']; $pane = $vars['pane']; if (empty($content->content)) { return; } $block = clone($content); if (!empty($block->title)) { $block->subject = $block->title; } $block->region = $pane->panel; if (!isset($block->module)) { $block->module = $block->type; } if (!isset($block->delta)) { $block->delta = $block->subtype; } $build = $block->content; if (is_string($build)) { $build = array('#markup' => $build); } $build['#block'] = $block; $build['#theme_wrappers'][] = 'block'; // If using per pane classes, $block->css_class will need to be added in your // preprocess or template, along with any other Panels specific field you // might want to utilize. return drupal_render($build); } Other Drupal examples (source code examples)Here is a short list of links related to this Drupal block.inc source code file: |
"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.