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

Source for file function.allowedhtml.php

Documentation is available at function.allowedhtml.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.allowedhtml.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 list of allowed html tags
  15.  *
  16.  * Available parameters:
  17.  *   - assign:   If set, the results are assigned to the corresponding variable instead of printed out
  18.  *
  19.  * Example
  20.  *   <!--[allowedhtml]-->
  21.  *
  22.  * @author       Mark West
  23.  * @since        25 April 2004
  24.  * @param        array       $params      All attributes passed to this function from the template
  25.  * @param        object      &$smarty     Reference to the Smarty object
  26.  * @return       string      the value of the last status message posted, or void if no status message exists
  27.  */
  28. function smarty_function_allowedhtml($params&$smarty)
  29. {
  30.     extract($params);
  31.  
  32.     $AllowableHTML pnConfigGetVar('AllowableHTML');
  33.     $allowedhtml '';
  34.     foreach($AllowableHTML as $key=>$access{
  35.         if ($access 0{
  36.             $allowedhtml .= '&lt;' htmlspecialchars($key'&gt; ';
  37.         }
  38.     }
  39.  
  40.     if (isset($assign)) {
  41.         $smarty->assign($assign$allowedhtml);
  42.     else {
  43.         return $allowedhtml;
  44.     }
  45. }

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