1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11: 12: 13: 14: 15: 16: 17: 18:
19:
20: function smarty_compiler_xoAdminIcons($params, Smarty $smarty)
21: {
22: $xoops = Xoops::getInstance();
23: $arg = reset($params);
24: $ico = trim($arg, " '\"\t\n\r\0\x0B");
25:
26: $icons = $xoops->getModuleConfig('typeicons', 'system');
27: if ($icons == '') {
28: $icons = 'default';
29: }
30:
31: if (XoopsLoad::fileExists($xoops->path('modules/system/images/icons/' . $icons . '/index.html'))) {
32: $url = $xoops->url('modules/system/images/icons/' . $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: