Code Duplication    Length = 18-18 lines in 2 locations

admin/modifications.php 2 locations

@@ 50-67 (lines=18) @@
47
        echo '<div><b>' . _AM_XOOPSTUBE_MOD_MODPOSTER . '</b> ' . $submittername . '</div>';
48
        $not_allowed = array('lid', 'submitter', 'requestid', 'modifysubmitter');
49
        $sform       = new XoopsThemeForm(_AM_XOOPSTUBE_MOD_ORIGINAL, 'storyform', 'index.php');
50
        foreach ($orig_array as $key => $content) {
51
            if (in_array($key, $not_allowed)) {
52
                continue;
53
            }
54
            $lang_def = constant('_AM_XOOPSTUBE_MOD_' . strtoupper($key));
55
56
            if ($key == 'cid') {
57
                $sql     = 'SELECT title FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' WHERE cid=' . $content;
58
                $row     = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql));
59
                $content = $row['title'];
60
            }
61
62
            if ($key == 'vidsource') {
63
                include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/video.php';
64
                $content = xtubeReturnSource($content);
65
            }
66
            $sform->addElement(new XoopsFormLabel($lang_def, $content));
67
        }
68
        $sform->display();
69
70
        $orig_user      = new XoopsUser($mod_array['modifysubmitter']);
@@ 76-93 (lines=18) @@
73
74
        echo '<div><b>' . _AM_XOOPSTUBE_MOD_MODIFYSUBMITTER . '</b> ' . $submittername . '</div>';
75
        $sform = new XoopsThemeForm(_AM_XOOPSTUBE_MOD_PROPOSED, 'storyform', 'modifications.php');
76
        foreach ($mod_array as $key => $content) {
77
            if (in_array($key, $not_allowed)) {
78
                continue;
79
            }
80
            $lang_def = constant('_AM_XOOPSTUBE_MOD_' . strtoupper($key));
81
82
            if ($key == 'cid') {
83
                $sql     = 'SELECT title FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' WHERE cid=' . $content;
84
                $row     = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql));
85
                $content = $row['title'];
86
            }
87
88
            if ($key == 'vidsource') {
89
                include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/video.php';
90
                $content = xtubeReturnSource($content);
91
            }
92
            $sform->addElement(new XoopsFormLabel($lang_def, $content));
93
        }
94
        $button_tray = new XoopsFormElementTray('', '');
95
        $button_tray->addElement(new XoopsFormHidden('requestid', $requestid));
96
        $button_tray->addElement(new XoopsFormHidden('lid', $mod_array['requestid']));