Modification   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 55
dl 0
loc 69
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 64 3
1
<?php
2
3
namespace XoopsModules\Wfdownloads;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
 */
14
15
/**
16
 * Wfdownloads module
17
 *
18
 * @copyright       XOOPS Project (https://xoops.org)
19
 * @license         GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
20
 * @package         wfdownload
21
 * @since           3.23
22
 * @author          Xoops Development Team
23
 */
24
25
use XoopsModules\Wfdownloads;
26
27
require_once \dirname(__DIR__) . '/include/common.php';
28
29
//require_once XOOPS_ROOT_PATH . '/modules/wfdownloads/class/Download.php';
30
31
/**
32
 * Class Modification
33
 */
34
class Modification extends Wfdownloads\Download
35
{
36
    /**
37
     * @param int|null $id
38
     */
39
    public function __construct($id = null)
40
    {
41
        parent::__construct();
42
        $this->initVar('requestid', \XOBJ_DTYPE_INT);
43
44
        $this->initVar('modifysubmitter', \XOBJ_DTYPE_INT, 0);
45
        $this->initVar('requestdate', \XOBJ_DTYPE_INT, 0);
46
47
        $this->initVar('lid', \XOBJ_DTYPE_INT);
48
        $this->initVar('cid', \XOBJ_DTYPE_INT, 0);
49
        $this->initVar('title', \XOBJ_DTYPE_TXTBOX, '');
50
        $this->initVar('url', \XOBJ_DTYPE_URL, 'http://');
51
        $this->initVar('filename', \XOBJ_DTYPE_TXTBOX, '');
52
        $this->initVar('filetype', \XOBJ_DTYPE_TXTBOX, '');
53
        $this->initVar('homepage', \XOBJ_DTYPE_URL, 'http://');
54
        $this->initVar('version', \XOBJ_DTYPE_TXTBOX, '');
55
        $this->initVar('size', \XOBJ_DTYPE_INT, 0);
56
        $this->initVar('platform', \XOBJ_DTYPE_TXTBOX, '');
57
        $this->initVar('screenshot', \XOBJ_DTYPE_TXTBOX, '');
58
        $this->initVar('screenshot2', \XOBJ_DTYPE_TXTBOX, '');
59
        $this->initVar('screenshot3', \XOBJ_DTYPE_TXTBOX, '');
60
        $this->initVar('screenshot4', \XOBJ_DTYPE_TXTBOX, '');
61
        $this->initVar('submitter', \XOBJ_DTYPE_INT);
62
        $this->initVar('publisher', \XOBJ_DTYPE_TXTBOX, '');
63
        $this->initVar('status', \XOBJ_DTYPE_INT, \_WFDOWNLOADS_STATUS_WAITING);
64
        $this->initVar('date', \XOBJ_DTYPE_INT);
65
        $this->initVar('hits', \XOBJ_DTYPE_INT, 0);
66
        $this->initVar('rating', \XOBJ_DTYPE_OTHER, 0.0);
67
        $this->initVar('votes', \XOBJ_DTYPE_INT, 0);
68
        $this->initVar('comments', \XOBJ_DTYPE_INT, 0);
69
        $this->initVar('license', \XOBJ_DTYPE_TXTBOX, '');
70
        $this->initVar('mirror', \XOBJ_DTYPE_TXTBOX, '');
71
        $this->initVar('price', \XOBJ_DTYPE_TXTBOX, 0);
72
        $this->initVar('paypalemail', \XOBJ_DTYPE_TXTBOX, '');
73
        $this->initVar('features', \XOBJ_DTYPE_TXTAREA, '');
74
        $this->initVar('requirements', \XOBJ_DTYPE_TXTAREA, '');
75
        $this->initVar('homepagetitle', \XOBJ_DTYPE_TXTBOX, '');
76
        $this->initVar('forumid', \XOBJ_DTYPE_INT, 0);
77
        $this->initVar('limitations', \XOBJ_DTYPE_TXTBOX, '');
78
        $this->initVar('versiontypes', \XOBJ_DTYPE_TXTBOX, '');
79
        $this->initVar('dhistory', \XOBJ_DTYPE_TXTAREA, '');
80
        $this->initVar('published', \XOBJ_DTYPE_INT, 0); // published time or 0
81
        $this->initVar('expired', \XOBJ_DTYPE_INT, 0);
82
        $this->initVar('updated', \XOBJ_DTYPE_INT, 0); // uploaded time or 0
83
        $this->initVar('offline', \XOBJ_DTYPE_INT, false); // boolean
84
        $this->initVar('summary', \XOBJ_DTYPE_TXTAREA, '');
85
        $this->initVar('description', \XOBJ_DTYPE_TXTAREA, '');
86
        //        $this->initVar('ipaddress', XOBJ_DTYPE_TXTBOX, '');
87
        //        $this->initVar('notifypub', XOBJ_DTYPE_INT, 0);
88
        // added 3.23
89
        $this->initVar('screenshots', \XOBJ_DTYPE_ARRAY, []); // IN PROGRESS
90
        $this->initVar('dohtml', \XOBJ_DTYPE_INT, false); // boolean
91
        $this->initVar('dosmiley', \XOBJ_DTYPE_INT, true); // boolean
92
        $this->initVar('doxcode', \XOBJ_DTYPE_INT, true); // boolean
93
        $this->initVar('doimage', \XOBJ_DTYPE_INT, true); // boolean
94
        $this->initVar('dobr', \XOBJ_DTYPE_INT, true); // boolean
95
96
        //Obsolete
97
        unset($this->vars['ipaddress'], $this->vars['notifypub']);
98
99
        if (null !== $id) {
100
            $item = $this->helper->getHandler('Item')->get($id);
101
            foreach ($item->vars as $k => $v) {
102
                $this->assignVar($k, $v['value']);
103
            }
104
        }
105
    }
106
}
107