1
|
|
|
<?php |
2
|
|
|
// |
3
|
|
|
|
4
|
|
|
// 2012-01-01 K.OHWADA |
5
|
|
|
// PHP 5.3: Assigning the return value of new by reference is now deprecated. |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Id: link.php 159 2007-12-17 16:44:05Z malanciault |
9
|
|
|
* Module: SmartShop |
10
|
|
|
* Author: The SmartFactory <www.smartfactory.ca> |
11
|
|
|
* Licence: GNU |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
use XoopsModules\Smartobject; |
15
|
|
|
use XoopsModules\Smartobject\ObjectColumn; |
16
|
|
|
use XoopsModules\Smartobject\ObjectController; |
17
|
|
|
use XoopsModules\Smartobject\Table; |
18
|
|
|
|
19
|
|
|
require_once __DIR__ . '/admin_header.php'; |
20
|
|
|
//require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
21
|
|
|
//require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjectlink.php'; |
22
|
|
|
$adminObject = \Xmf\Module\Admin::getInstance(); |
23
|
|
|
|
24
|
|
|
$smartobjectLinkHandler = Smartobject\Helper::getInstance()->getHandler('Link'); |
25
|
|
|
|
26
|
|
|
$op = ''; |
27
|
|
|
|
28
|
|
|
if (isset($_GET['op'])) { |
29
|
|
|
$op = $_GET['op']; |
30
|
|
|
} |
31
|
|
|
if (isset($_POST['op'])) { |
32
|
|
|
$op = $_POST['op']; |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
switch ($op) { |
36
|
|
|
|
37
|
|
|
case 'del': |
38
|
|
|
// require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php'; |
39
|
|
|
$controller = new XoopsModules\Smartobject\ObjectController($smartobjectLinkHandler); |
40
|
|
|
$controller->handleObjectDeletion(_AM_SOBJECT_SENT_LINK_DELETE_CONFIRM); |
|
|
|
|
41
|
|
|
|
42
|
|
|
break; |
43
|
|
|
|
44
|
|
|
case 'view': |
45
|
|
|
$linkid = \Xmf\Request::getInt('linkid', 0, 'GET'); |
46
|
|
|
$linkObj = $smartobjectLinkHandler->get($linkid); |
47
|
|
|
|
48
|
|
|
if ($linkObj->isNew()) { |
49
|
|
|
redirect_header(SMARTOBJECT_URL . 'admin/link.php', 3, _AM_SOBJECT_LINK_NOT_FOUND); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
Smartobject\Utility::getXoopsCpHeader(); |
53
|
|
|
|
54
|
|
|
//Smartobject\Utility::getAdminMenu(1, _AM_SOBJECT_SENT_LINK_DISPLAY); |
55
|
|
|
|
56
|
|
|
Smartobject\Utility::getCollapsableBar('sentlinks', _AM_SOBJECT_SENT_LINK_DISPLAY, _AM_SOBJECT_SENT_LINK_DISPLAY_INFO); |
57
|
|
|
|
58
|
|
|
require_once XOOPS_ROOT_PATH . '/class/template.php'; |
59
|
|
|
|
60
|
|
|
// --- |
61
|
|
|
// 2012-01-01 PHP 5.3: Assigning the return value of new by reference is now deprecated. |
62
|
|
|
// $xoopsTpl = new \XoopsTpl(); |
63
|
|
|
$xoopsTpl = new \XoopsTpl(); |
64
|
|
|
//--- |
65
|
|
|
|
66
|
|
|
$xoopsTpl->assign('link', $linkObj->toArray()); |
67
|
|
|
$xoopsTpl->display('db:smartobject_sentlink_display.tpl'); |
68
|
|
|
|
69
|
|
|
echo '<br>'; |
70
|
|
|
Smartobject\Utility::closeCollapsable('sentlinks'); |
71
|
|
|
echo '<br>'; |
72
|
|
|
|
73
|
|
|
break; |
74
|
|
|
|
75
|
|
|
default: |
76
|
|
|
|
77
|
|
|
Smartobject\Utility::getXoopsCpHeader(); |
78
|
|
|
|
79
|
|
|
$adminObject->displayNavigation(basename(__FILE__)); |
80
|
|
|
|
81
|
|
|
//Smartobject\Utility::getAdminMenu(1, _AM_SOBJECT_SENT_LINKS); |
82
|
|
|
|
83
|
|
|
Smartobject\Utility::getCollapsableBar('sentlinks', _AM_SOBJECT_SENT_LINKS, _AM_SOBJECT_SENT_LINKS_INFO); |
84
|
|
|
|
85
|
|
|
// require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php'; |
86
|
|
|
$objectTable = new Smartobject\Table($smartobjectLinkHandler, null, ['delete']); |
87
|
|
|
$objectTable->addColumn(new Smartobject\ObjectColumn('date')); |
88
|
|
|
$objectTable->addColumn(new Smartobject\ObjectColumn(_AM_SOBJECT_SENT_LINKS_FROM, $align = 'left', $width = false, 'getFromInfo')); |
|
|
|
|
89
|
|
|
$objectTable->addColumn(new Smartobject\ObjectColumn(_AM_SOBJECT_SENT_LINKS_TO, $align = 'left', $width = false, 'getToInfo')); |
|
|
|
|
90
|
|
|
$objectTable->addColumn(new Smartobject\ObjectColumn('link')); |
91
|
|
|
|
92
|
|
|
$objectTable->addCustomAction('getViewItemLink'); |
93
|
|
|
|
94
|
|
|
$objectTable->setDefaultSort('date'); |
95
|
|
|
$objectTable->setDefaultOrder('DESC'); |
96
|
|
|
|
97
|
|
|
$objectTable->render(); |
98
|
|
|
|
99
|
|
|
echo '<br>'; |
100
|
|
|
Smartobject\Utility::closeCollapsable('sentlinks'); |
101
|
|
|
echo '<br>'; |
102
|
|
|
|
103
|
|
|
break; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
//Smartobject\Utility::getModFooter(); |
107
|
|
|
//xoops_cp_footer(); |
108
|
|
|
require_once __DIR__ . '/admin_footer.php'; |
109
|
|
|
|
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: