1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11: 12: 13: 14: 15: 16: 17: 18:
19:
20: function smarty_compiler_xoModuleIcons32($argStr, &$smarty)
21: {
22: $xoops = Xoops::getInstance();
23: $icons = $xoops->getModuleConfig('typeicons', 'system');
24: if ($icons == '') {
25: $icons = 'default';
26: }
27:
28: $arg = reset($params);
29: $ico = trim($arg, " '\"\t\n\r\0\x0B");
30:
31: if (XoopsLoad::fileExists($xoops->path('media/xoops/images/icons/32/' . $icons . '/index.html'))) {
32: $url = $xoops->url('media/xoops/images/icons/32/' . $icons . '/' . $ico);
33: } else {
34: if (XoopsLoad::fileExists($xoops->path('modules/system/images/icons/default/' . $ico))) {
35: $url = $xoops->url('modules/system/images/icons/default/' . $ico);
36: } else {
37: $url = $xoops->url('modules/system/images/icons/default/xoops/xoops.png');
38: }
39: }
40: return "<?php echo '" . addslashes($url) . "'; ?>";
41: }
42: