Broken::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace XoopsModules\Tdmdownloads;
6
7
/**
8
 * TDMDownload
9
 *
10
 * You may not change or alter any portion of this comment or credits
11
 * of supporting developers from this source code or any supporting source code
12
 * which is considered copyrighted (c) material of the original comment or credit authors.
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
 *
17
 * @copyright   Gregory Mage (Aka Mage)
18
 * @license     GNU GPL 2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
19
 * @author      Gregory Mage (Aka Mage)
20
 */
21
22
/**
23
 * Class Broken
24
 * @package XoopsModules\Tdmdownloads
25
 */
26
class Broken extends \XoopsObject
27
{
28
    // constructor
29
    public function __construct()
30
    {
31
        parent::__construct();
32
        $this->initVar('reportid', \XOBJ_DTYPE_INT, null, false, 5);
33
        $this->initVar('lid', \XOBJ_DTYPE_INT, null, false, 11);
34
        $this->initVar('sender', \XOBJ_DTYPE_INT, null, false, 11);
35
        $this->initVar('ip', \XOBJ_DTYPE_TXTBOX, null, false);
36
        //pour les jointures:
37
        $this->initVar('title', \XOBJ_DTYPE_TXTBOX, null, false);
38
        $this->initVar('cid', \XOBJ_DTYPE_INT, null, false, 5);
39
    }
40
41
    /**
42
     * @param      $lid
43
     * @param bool $action
44
     *
45
     * @return \XoopsThemeForm
46
     */
47
    public function getForm($lid, $action = false)
48
    {
49
        //        global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
50
        if (!$action) {
51
            $action = $_SERVER['REQUEST_URI'];
0 ignored issues
show
Unused Code introduced by
The assignment to $action is dead and can be removed.
Loading history...
52
        }
53
        $form = new \XoopsThemeForm(_MD_TDMDOWNLOADS_BROKENFILE_REPORTBROKEN, 'brokenform', 'brokenfile.php', 'post');
54
        $form->setExtra('enctype="multipart/form-data"');
55
        $form->addElement(new \XoopsFormCaptcha(), true);
56
        $form->addElement(new \XoopsFormHidden('op', 'save'));
57
        $form->addElement(new \XoopsFormHidden('lid', $lid));
58
        // Submit button
59
        $buttonTray = new \XoopsFormElementTray(_MD_TDMDOWNLOADS_BROKENFILE_REPORTBROKEN, '', '');
60
        $buttonTray->addElement(new \XoopsFormButton('', 'post', _MD_TDMDOWNLOADS_BROKENFILE_REPORTBROKEN, 'submit'));
61
        $form->addElement($buttonTray);
62
        return $form;
63
    }
64
}
65