Source for file function.pnblockgetinfo.php
Documentation is available at function.pnblockgetinfo.php
* Zikula Application Framework
* @copyright (c) 2004, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: function.pnblockgetinfo.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 obtain the a block variable
* Note: If the name parameter is not set then the assign parameter must be set since there is an array of
* block variables available.
* - name: If set the name of the parameter to get otherwise the entire block array is assigned to the template
* - assign: If set, the results are assigned to the corresponding variable instead of printed out
* @param array $params All attributes passed to this function from the template
* @param object &$smarty Reference to the Smarty object
* @return string the variables content
$bid = isset ($params['bid']) ? (int) $params['bid'] : 0;
$name = isset ($params['name']) ? $params['name'] : null;
$assign = isset ($params['assign']) ? $params['assign'] : null;
$smarty->trigger_error('pnblockgetinfo: parameter [bid] required');
// get the block info array
$smarty->assign($assign, $blockinfo[$name]);
return $blockinfo[$name];
// handle the full blockinfo array
$smarty->assign($assign, $blockinfo);
$smarty->trigger_error('pnblockgetinfo: parameter [assign] required for full blockinfo');
|