ModuleTransferHandler::do_transfer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Transfer handler for XOOPS
4
 *
5
 * This is intended to handle content intercommunication between modules as well as components
6
 * There might need to be a more explicit name for the handle since it is always confusing
7
 *
8
 * @copyright   XOOPS Project (https://xoops.org)
9
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
10
 * @author      Taiwen Jiang (phppp or D.J.) <[email protected]>
11
 * @since       1.00
12
 * @package     Frameworks::transfer
13
 */
14
15
// defined('XOOPS_ROOT_PATH') || die('Restricted access');
16
17
if (!@require_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') {
18
    return null;
19
}
20
21
// Specify the addons to skip for the module
22
$GLOBALS['addons_skip_module'] = ['pm', 'email'];
23
// Maximum items to show on page
24
$GLOBALS['addons_limit_module'] = 5;
25
26
/**
27
 * Class ModuleTransferHandler
28
 */
29
class ModuleTransferHandler extends TransferHandler
30
{
31
    /**
32
     * ModuleTransferHandler constructor.
33
     */
34
    public function __construct()
35
    {
36
        parent::__construct();
37
    }
38
39
    /**
40
     * Get valid addon list
41
     *
42
     * @param array   $skip Addons to skip
43
     * @param boolean $sort To sort the list upon 'level'
44
     *                      return  array   $list
45
     */
46
    public function &getList($skip = [], $sort = true)
47
    {
48
        $list = parent::getList($skip, $sort);
49
50
        return $list;
51
    }
52
53
    /**
54
     * If need change config of an item
55
     * 1 parent::load_item
56
     * 2 $this->config
57
     * 3 $this->do_transfer
58
     * @param $item
59
     * @param $data
60
     * @return
61
     */
62
    public function do_transfer($item, &$data)
63
    {
64
        $ret = parent::do_transfer($item, $data);
65
66
        return $ret;
67
    }
68
}
69