Source for file function.pnblock.php
Documentation is available at function.pnblock.php
* Zikula Application Framework
* @copyright (c) 2004, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: function.pnblock.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Template_Plugins
* Smarty function to display an existing Zikula block.
* The block is choosen by its id.
* The block state is ignored, so even deactivated blocks
* The block specific parameters can be overwritten,
* considering they are known.
* - id id of block to be displayed
* - name title of block to be displayed
* - title Overwrites block title
* - position Overwrites position (l,c,r)
* - assign: If set, the results are assigned to the corresponding variable instead of printed out
* @author Andreas Stratmann
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
* @return string the block
$bid = isset ($params['bid']) ? (int) $params['bid'] : 0;
$name = isset ($params['name']) ? $params['name'] : null;
$title = isset ($params['title']) ? $params['title'] : null;
$position = isset ($params['position']) ? $params['position'] : null;
$assign = isset ($params['assign']) ? $params['assign'] : null;
// unset the variables for the function, leaving the ones for the block
unset ($params['position']);
unset ($params['assign']);
$blockinfo['title'] = $title;
$blockinfo['position'] = $position;
$blockinfo['bid'] = $bid; // bid is not return by BlockGetInfo.
// Overwrite block specific config vars.
// Only the new style is supported.
if (count($params) > 0) {
// We need the module name.
if (!is_array($modinfo) || !isset ($modinfo['name'])) {
$modinfo = array('name' => 'core');
// show the block and capture its contents
$content = pnBlockShow($modinfo['name'], $blockinfo['bkey'], $blockinfo);
$smarty->assign($assign, $content);
|