Zikula_Template_Plugins
[ class tree: Zikula_Template_Plugins ] [ index: Zikula_Template_Plugins ] [ all elements ]

Source for file function.blockposition.php

Documentation is available at function.blockposition.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright (c) 2004, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: function.blockposition.php 24342 2008-06-06 12:03:14Z markwest $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @package Zikula_Template_Plugins
  10.  * @subpackage Functions
  11.  */
  12.  
  13. /**
  14.  * Smarty function to display the welcome message
  15.  *
  16.  * Example
  17.  * <!--[blockposition name=left]-->
  18.  *
  19.  * @author       Mark West
  20.  * @since        21/06/04
  21.  * @see          function.blockposition.php::smarty_function_blockposition()
  22.  * @param        array       $params      All attributes passed to this function from the template
  23.  * @param        object      &$smarty     Reference to the Smarty object
  24.  * @param        string         name         The name of the block position to render
  25.  * @return       string      the welcome message
  26.  */
  27. function smarty_function_blockposition($params&$smarty)
  28. {
  29.     // fix the core positions for a better name
  30.     if ($params['name'== 'l'$params['name''left';
  31.     if ($params['name'== 'r'$params['name''right';
  32.     if ($params['name'== 'c'$params['name''center';
  33.  
  34.     if (!isset($params['name'])) {
  35.         $smarty->trigger_error('blockposition: attribute name required');
  36.         return false;
  37.     }
  38.  
  39.     $return pnBlockDisplayPosition($params['name']falsetrue);
  40.     if (isset($params['assign'])) {
  41.         $smarty->assign($params['assign']$return);
  42.     else {
  43.         return $return;
  44.     }
  45.  
  46. }

Documentation generated on Fri, 18 Jul 2008 21:45:09 +0200 by phpDocumentor 1.4.1