1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Module: SmartObject |
4
|
|
|
* Author: The SmartFactory <www.smartfactory.ca> |
5
|
|
|
* Licence: GNU |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
use XoopsModules\Smartobject; |
9
|
|
|
|
10
|
|
|
// require_once __DIR__ . '/../class/Helper.php'; |
11
|
|
|
//require_once __DIR__ . '/../include/common.php'; |
12
|
|
|
$helper = Smartobject\Helper::getInstance(); |
13
|
|
|
|
14
|
|
|
$pathIcon32 = \Xmf\Module\Admin::menuIconPath(''); |
15
|
|
|
$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
16
|
|
|
|
17
|
|
|
|
18
|
|
|
$adminmenu = []; |
19
|
|
|
|
20
|
|
|
$adminmenu[] = [ |
21
|
|
|
'title' => _MI_SOBJECT_HOME, |
22
|
|
|
'link' => 'admin/index.php', |
23
|
|
|
'icon' => $pathIcon32 . '/home.png', |
24
|
|
|
]; |
25
|
|
|
|
26
|
|
|
//$adminmenu[] = [ |
27
|
|
|
//'title' => _MI_SOBJECT_INDEX, |
28
|
|
|
//'link' => "admin/main.php", |
29
|
|
|
//$adminmenu[$i]["icon"] = $pathIcon32 . '/manage.png'; |
30
|
|
|
//]; |
31
|
|
|
|
32
|
|
|
$adminmenu[] = [ |
33
|
|
|
'title' => _MI_SOBJECT_SENT_LINKS, |
34
|
|
|
'link' => 'admin/link.php', |
35
|
|
|
'icon' => $pathIcon32 . '/addlink.png', |
36
|
|
|
]; |
37
|
|
|
|
38
|
|
|
$adminmenu[] = [ |
39
|
|
|
'title' => _MI_SOBJECT_TAGS, |
40
|
|
|
'link' => 'admin/customtag.php', |
41
|
|
|
'icon' => $pathIcon32 . '/identity.png', |
42
|
|
|
]; |
43
|
|
|
|
44
|
|
|
$adminmenu[] = [ |
45
|
|
|
'title' => _MI_SOBJECT_ADSENSES, |
46
|
|
|
'link' => 'admin/adsense.php', |
47
|
|
|
'icon' => $pathIcon32 . '/alert.png', |
48
|
|
|
]; |
49
|
|
|
|
50
|
|
|
$adminmenu[] = [ |
51
|
|
|
'title' => _MI_SOBJECT_RATINGS, |
52
|
|
|
'link' => 'admin/rating.php', |
53
|
|
|
'icon' => $pathIcon32 . '/stats.png', |
54
|
|
|
]; |
55
|
|
|
|
56
|
|
|
$adminmenu[] = [ |
57
|
|
|
'title' => _MI_SOBJECT_ABOUT, |
58
|
|
|
'link' => 'admin/about.php', |
59
|
|
|
'icon' => $pathIcon32 . '/about.png', |
60
|
|
|
]; |
61
|
|
|
|
62
|
|
|
//--------------------------------- |
63
|
|
|
|
64
|
|
|
if (!defined('SMARTOBJECT_ROOT_PATH')) { |
65
|
|
|
// require_once XOOPS_ROOT_PATH . '/modules/smartobject/include/functions.php'; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
$smartobjectConfig = Smartobject\Utility::getModuleConfig('smartobject'); |
|
|
|
|
69
|
|
|
|
70
|
|
|
if (isset($smartobjectConfig['enable_currencyman']) && true === $smartobjectConfig['enable_currencyman']) { |
71
|
|
|
$adminmenu[] = [ |
72
|
|
|
'title' => _MI_SOBJECT_CURRENCIES, |
73
|
|
|
'link' => 'admin/currency.php', |
74
|
|
|
'icon' => $pathIcon32 . '/cash_stack.png', |
75
|
|
|
]; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
global $xoopsModule; |
79
|
|
|
if (isset($xoopsModule)) { |
80
|
|
|
$i = -1; |
81
|
|
|
|
82
|
|
|
// --- for XCL --- |
83
|
|
|
// $headermenu[$i]['link'] = '../../system/admin.php?fct=preferences&op=showmod&mod=' . $xoopsModule->getVar('mid'); |
84
|
|
|
$mid = $xoopsModule->getVar('mid'); |
85
|
|
View Code Duplication |
if (defined('XOOPS_CUBE_LEGACY')) { |
|
|
|
|
86
|
|
|
$link_pref = XOOPS_URL . '/modules/legacy/admin/index.php?action=PreferenceEdit&confmod_id=' . $mid; |
87
|
|
|
} else { |
88
|
|
|
$link_pref = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid; |
89
|
|
|
} |
90
|
|
|
$headermenu[$i]['link'] = $link_pref; |
91
|
|
|
// ----- |
92
|
|
|
|
93
|
|
|
// --- for XCL --- |
94
|
|
|
// $headermenu[$i]['link'] = XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname'); |
95
|
|
|
$dirname = $xoopsModule->getVar('dirname'); |
96
|
|
View Code Duplication |
if (defined('XOOPS_CUBE_LEGACY')) { |
|
|
|
|
97
|
|
|
$link_module = XOOPS_URL . '/modules/legacy/admin/index.php?action=ModuleUpdate&dirname=' . $dirname; |
98
|
|
|
} else { |
99
|
|
|
$link_module = XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin&op=update&module=' . $dirname; |
100
|
|
|
} |
101
|
|
|
$headermenu[$i]['link'] = $link_module; |
102
|
|
|
// ----- |
103
|
|
|
|
104
|
|
|
++$i; |
105
|
|
|
} |
106
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: