summaryrefslogtreecommitdiff
path: root/smartyplugins/modifier.iconify.php
blob: 64115b6fcbb032ad6267b7281d0f3c41a32c0cde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
namespace Bitweaver\Plugins;

/**
 * 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' />";
  }
	return "<img border='0' src='".IMG_PKG_URL."icn/else.gif' alt='icon' class='icon' />";

}