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

Source for file function.pnbannerdisplay.php

Documentation is available at function.pnbannerdisplay.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.pnbannerdisplay.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 .
  15.  *
  16.  * This function takes a identifier and returns a banner from the banners module
  17.  *
  18.  * Available parameters:
  19.  *   - id:       id of the banner group as defined in the banners module
  20.  *   - assign:   If set, the results are assigned to the corresponding variable instead of printed out
  21.  *
  22.  * Example
  23.  * <!--[pnbannerdisplay id=0]-->
  24.  *
  25.  *
  26.  * @author       Mark West
  27.  * @since        20/10/2003
  28.  * @param        array       $params      All attributes passed to this function from the template
  29.  * @param        object      &$smarty     Reference to the Smarty object
  30.  * @param        sting 
  31.  * @return       string      the banner
  32.  */
  33. function smarty_function_pnbannerdisplay ($params&$smarty)
  34. {
  35.     $id     = isset($params['id'])     ? (int)$params['id'0;
  36.     $assign = isset($params['assign']$params['assign']  null;
  37.  
  38.     if (pnModAvailable('Banners'))  {
  39.         $result pnBannerDisplay($id);
  40.         if ($assign{
  41.             $smarty->assign($assign$result);
  42.         else {
  43.             return $result;
  44.         }
  45.     else {
  46.         return '&nbsp;';
  47.     }
  48. }

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