diff options
Diffstat (limited to 'smartyplugins/modifier.iconify.php')
| -rw-r--r-- | smartyplugins/modifier.iconify.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/smartyplugins/modifier.iconify.php b/smartyplugins/modifier.iconify.php new file mode 100644 index 0000000..31eb528 --- /dev/null +++ b/smartyplugins/modifier.iconify.php @@ -0,0 +1,28 @@ +<?php +/** + * Smarty plugin + * @package Smarty + * @subpackage plugins + */ + +/** + * Smarty plugin + * ------------------------------------------------------------- + * Type: modifier + * Name: capitalize + * Purpose: capitalize words in the string + * ------------------------------------------------------------- + */ +function smarty_modifier_iconify($string) +{ + // XINGICON what are we going to do with this function? is this needed? + $string=substr($string,strlen($string)-3); + if(file_exists(IMG_PKG_PATH."icn/$string".".gif")) { + return "<img border='0' src='".IMG_PKG_URL."icn/${string}.gif' alt='icon' class='icon' />"; + } else { + return "<img border='0' src='".IMG_PKG_URL."icn/else.gif' alt='icon' class='icon' />"; + } + +} + +?> |
