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

Source for file function.booticon.php

Documentation is available at function.booticon.php

  1. <?php
  2. /**
  3.  * Smarty plugin
  4.  * @package Smarty
  5.  * @subpackage plugins
  6.  * @link http://www.bitweaver.org/wiki/function_booticon function_booticon
  7.  */
  8.  
  9. /**
  10.  * Turn collected information into an html image
  11.  *
  12.  * @param boolean $pParams['url'] set to TRUE if you only want the url and nothing else
  13.  * @param string $pParams['iexplain'] Explanation of what the icon represents
  14.  * @param string $pParams['iforce'] takes following optins: icon, icon_text, text - will override system settings
  15.  * @param string $pFile Path to icon file
  16.  * @param string iforce  override site-wide setting how to display icons (can be set to 'icon', 'text' or 'icon_text')
  17.  * @access public
  18.  * @return Full <img> on success
  19.  */
  20. function smarty_function_booticon$pParams$pFile {
  21.     global $gBitSystem;
  22.  
  23.     ifempty$pParams['iforce')) {
  24.         $pParams['iforce'NULL;
  25.     }
  26.  
  27.     ifisset$pParams["url")) {
  28.         $outstr .= $pFile;
  29.     else {
  30.         $outstr '';
  31.         ifisset$pParams['href') ) {
  32.             $outstr .= '<a href="'.$pParams['href'].'" class="icon"';
  33.             ifisset$pParams['iexplain') ) {
  34.                 $outstr .= ' title="'.htmlentities$pParams['iexplain').'"';
  35.             }
  36.             $outstr .= '>';
  37.         }
  38.  
  39.         $outstr .= '<div class="'.$pParams['iname'];
  40.         ifisset$pParams["iclass") ) {
  41.             $outstr .=  ' '.$pParams["iclass"].'';
  42.         }
  43.         ifisset$pParams["class") ) {
  44.             $outstr .=  ' '.$pParams["class"].'';
  45.         }
  46.         $outstr .= '"';
  47.  
  48.         ifisset$pParams["id") ) {
  49.             $outstr .=  ' id="'.$pParams['id'].'"';
  50.         }
  51.  
  52.         ifisset$pParams['iexplain') ) {
  53.             $outstr .= ' title="'.htmlentities$pParams['iexplain').'"';
  54.         }
  55.  
  56.         foreacharray_keys$pParams as $key {
  57.             ifstrpos$key'on' === {
  58.                 $outstr .=  ' '.$key.'="'.$pParams[$key].'"';
  59.             }
  60.         }
  61.  
  62.         $outstr .= '></div>';
  63.  
  64.         if!empty$pParams['ilocation') ) {
  65.             if$pParams['ilocation'== 'menu' && isset$pParams['iexplain') ) {
  66.                 $outstr .= ' '.$pParams['iexplain'];
  67.             }
  68.         }
  69.         ifisset$pParams["href") ) {
  70.             $outstr .= '</a>';
  71.         }
  72.     }
  73.  
  74.     return $outstr;
  75. }

Documentation generated on Wed, 29 Jul 2015 13:56:37 +0000 by phpDocumentor 1.5.0-lsces