1
|
|
|
<?php namespace XoopsModules\Mymenus; |
2
|
|
|
|
3
|
|
|
use Xmf\Request; |
|
|
|
|
4
|
|
|
use XoopsModules\Mymenus; |
5
|
|
|
use XoopsModules\Mymenus\Common; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class Utility |
9
|
|
|
*/ |
10
|
|
|
class Utility |
11
|
|
|
{ |
12
|
|
|
use Common\VersionChecks; //checkVerXoops, checkVerPhp Traits |
13
|
|
|
|
14
|
|
|
use Common\ServerStats; // getServerStats Trait |
15
|
|
|
|
16
|
|
|
use Common\FilesManagement; // Files Management Trait |
17
|
|
|
|
18
|
|
|
//--------------- Custom module methods ----------------------------- |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @param string $moduleSkin |
22
|
|
|
* @param bool $useThemeSkin |
23
|
|
|
* @param string $themeSkin |
24
|
|
|
* @return array |
25
|
|
|
*/ |
26
|
|
|
public static function getSkinInfo($moduleSkin = 'default', $useThemeSkin = false, $themeSkin = '') |
27
|
|
|
{ |
28
|
|
|
// require __DIR__ . '/common.php'; |
29
|
|
|
/** @var \XoopsModules\Mymenus\Helper $helper */ |
30
|
|
|
$helper = \XoopsModules\Mymenus\Helper::getInstance(); |
31
|
|
|
$error = false; |
32
|
|
|
if ($useThemeSkin) { |
33
|
|
|
$path = 'themes/' . $GLOBALS['xoopsConfig']['theme_set'] . '/menu'; |
34
|
|
|
if (!file_exists($GLOBALS['xoops']->path("{$path}/skin_version.php"))) { |
35
|
|
|
$path = 'themes/' . $GLOBALS['xoopsConfig']['theme_set'] . "/modules/{$helper->getDirname()}/skins/{$themeSkin}"; |
36
|
|
|
if (!file_exists($GLOBALS['xoops']->path("{$path}/skin_version.php"))) { |
37
|
|
|
$error = true; |
38
|
|
|
} |
39
|
|
|
} |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
if ($error || !$useThemeSkin) { |
43
|
|
|
$path = "modules/{$helper->getDirname()}/skins/{$moduleSkin}"; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
$file = $GLOBALS['xoops']->path("{$path}/skin_version.php"); |
|
|
|
|
47
|
|
|
$info = []; |
48
|
|
|
|
49
|
|
|
if (file_exists($file)) { |
50
|
|
|
require $file; |
51
|
|
|
$info = $skinVersion; |
|
|
|
|
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
$info['path'] = $GLOBALS['xoops']->path($path); |
55
|
|
|
$info['url'] = $GLOBALS['xoops']->url($path); |
56
|
|
|
|
57
|
|
|
if (!isset($info['template'])) { |
58
|
|
|
$info['template'] = $GLOBALS['xoops']->path("modules/{$helper->getDirname()}/templates/static/blocks/mymenus_block.tpl"); |
59
|
|
|
} else { |
60
|
|
|
$info['template'] = $GLOBALS['xoops']->path("{$path}/" . $info['template']); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
if (!isset($info['prefix'])) { |
64
|
|
|
$info['prefix'] = $moduleSkin; |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
if (isset($info['css'])) { |
68
|
|
|
$info['css'] = (array)$info['css']; |
69
|
|
|
foreach ($info['css'] as $key => $value) { |
70
|
|
|
$info['css'][$key] = $GLOBALS['xoops']->url("{$path}/{$value}"); |
71
|
|
|
} |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
if (isset($info['js'])) { |
75
|
|
|
$info['js'] = (array)$info['js']; |
76
|
|
|
foreach ($info['js'] as $key => $value) { |
77
|
|
|
$info['js'][$key] = $GLOBALS['xoops']->url("{$path}/{$value}"); |
78
|
|
|
} |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
if (!isset($info['config'])) { |
82
|
|
|
$info['config'] = []; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
return $info; |
86
|
|
|
} |
87
|
|
|
} |
88
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths