Passed
Push — master ( 93b609...1da0d9 )
by Michael
37s
created

Broken   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getForm() 0 18 2
1
<?php
2
3
namespace XoopsModules\Tdmdownloads;
4
5
/**
6
 * TDMDownload
7
 *
8
 * You may not change or alter any portion of this comment or credits
9
 * of supporting developers from this source code or any supporting source code
10
 * which is considered copyrighted (c) material of the original comment or credit authors.
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 *
15
 * @copyright   Gregory Mage (Aka Mage)
16
 * @license     GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
17
 * @author      Gregory Mage (Aka Mage)
18
 */
19
defined('XOOPS_ROOT_PATH') || die('Restricted access');
20
21
/**
22
 * Class Broken
23
 * @package XoopsModules\Tdmdownloads
24
 */
25
class Broken extends \XoopsObject
26
{
27
    // constructor
28
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 (false === $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
54
        $form = new \XoopsThemeForm(_MD_TDMDOWNLOADS_BROKENFILE_REPORTBROKEN, 'brokenform', 'brokenfile.php', 'post');
55
        $form->setExtra('enctype="multipart/form-data"');
56
        $form->addElement(new \XoopsFormCaptcha(), true);
57
        $form->addElement(new \XoopsFormHidden('op', 'save'));
58
        $form->addElement(new \XoopsFormHidden('lid', $lid));
59
        // Submit button
60
        $button_tray = new \XoopsFormElementTray(_MD_TDMDOWNLOADS_BROKENFILE_REPORTBROKEN, '', '');
61
        $button_tray->addElement(new \XoopsFormButton('', 'post', _MD_TDMDOWNLOADS_BROKENFILE_REPORTBROKEN, 'submit'));
62
        $form->addElement($button_tray);
63
64
        return $form;
65
    }
66
}
67