Code Duplication    Length = 7-8 lines in 2 locations

include/storyform.inc.php 1 location

@@ 50-56 (lines=7) @@
47
$allTopics  = $xt->getAllTopics($xoopsModuleConfig['restrictindex'], 'news_submit');
48
$topic_tree = new XoopsObjectTree($allTopics, 'topic_id', 'topic_pid');
49
50
if (NewsUtility::checkVerXoops($GLOBALS['xoopsModule'], '2.5.9')) {
51
    $topic_select = $topic_tree->makeSelectElement('topic_id', 'topic_title', '--', $topicid, false, 0, '', _NW_TOPIC);
52
    $sform->addElement($topic_select);
53
} else {
54
    $topic_select = $topic_tree->makeSelBox('topic_id', 'topic_title', '-- ', $topicid, false);
55
    $sform->addElement(new XoopsFormLabel(_NW_TOPIC, $topic_select));
56
}
57
58
//If admin - show admin form
59
//TODO: Change to "If submit privilege"

include/storyform.original.php 1 location

@@ 54-61 (lines=8) @@
51
$moduleDirName = basename(dirname(__DIR__));
52
xoops_load('utility', $moduleDirName);
53
54
if (NewsUtility::checkVerXoops($GLOBALS['xoopsModule'], '2.5.9')) {
55
    //    $topic_select = $topic_tree->makeSelBox('topic_id', 'topic_title', '-- ', $topicid, false);
56
    $topic_select = $topic_tree->makeSelectElement('topic_id', 'topic_title', '--', $topicid, false, 0, '', _NW_TOPIC);
57
    $sform->addElement($topic_select);
58
} else {
59
    $topic_select = $topic_tree->makeSelBox('topic_id', 'topic_title', '-- ', $topicid, false);
60
    $sform->addElement(new XoopsFormLabel(_NW_TOPIC, $topic_select));
61
}
62
63
//If admin - show admin form
64
//TODO: Change to "If submit privilege"