1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: 13: 14: 15: 16: 17:
18:
19: class Menus extends Xoops\Module\Helper\HelperAbstract
20: {
21: 22: 23: 24: 25:
26: public function init()
27: {
28: $this->setDirname('menus');
29: }
30:
31: 32: 33:
34: public static function getInstance()
35: {
36: return parent::getInstance();
37: }
38:
39: 40: 41:
42: public function getHandlerMenus()
43: {
44: return $this->getHandler('menus');
45: }
46:
47: 48: 49:
50: public function getHandlerMenu()
51: {
52: return $this->getHandler('menu');
53: }
54:
55: 56: 57: 58: 59: 60:
61: public function getSkinInfo($skin, $skin_from_theme = false)
62: {
63: $error = false;
64: $path = '';
65: if ($skin_from_theme) {
66: $path = "themes/" . $this->xoops()->getConfig('theme_set') . "/menu";
67: if (!XoopsLoad::fileExists($this->xoops()->path("{$path}/skin_version.php"))) {
68: $error = true;
69: }
70: }
71:
72: if ($error || !$skin_from_theme) {
73: $path = "modules/menus/skins/{$skin}";
74: }
75:
76: $file = $this->xoops()->path("{$path}/skin_version.php");
77: $info = array();
78:
79: if (XoopsLoad::fileExists($file)) {
80: include $file;
81: $info =& $skinversion;
82: }
83:
84: $info['path'] = $this->xoops()->path($path);
85: $info['url'] = $this->xoops()->url($path);
86:
87: if (!isset($info['template'])) {
88: $info['template'] = $this->xoops()->path("modules/menus/templates/block.tpl");
89: } else {
90: $info['template'] = $this->xoops()->path("{$path}/" . $info['template']);
91: }
92:
93: if (!isset($info['prefix'])) {
94: $info['prefix'] = $skin;
95: }
96:
97: if (isset($info['css'])) {
98: $info['css'] = (array)$info['css'];
99: foreach ($info['css'] as $key => $value) {
100: $info['css'][$key] = $this->xoops()->url("{$path}/{$value}");
101: }
102: }
103:
104: if (isset($info['js'])) {
105: $info['js'] = (array)$info['js'];
106: foreach ($info['js'] as $key => $value) {
107: $info['js'][$key] = $this->xoops()->url("{$path}/{$value}");
108: }
109: }
110:
111: if (!isset($info['config'])) {
112: $info['config'] = array();
113: }
114:
115: return $info;
116: }
117: }
118: