Code Duplication    Length = 7-11 lines in 2 locations

admin/entry.php 1 location

@@ 219-225 (lines=7) @@
216
        $categoryselect = new XoopsFormSelect(_AM_LEXIKON_CATNAME, 'categoryID', $categoryID);
217
        $tbl = array();
218
        $tbl = $mytree->getChildTreeArray(0,'name');
219
        foreach($tbl as $oneline) {
220
            if ($oneline['prefix']=='.') {
221
                $oneline['prefix']='';
222
            }
223
            $oneline['prefix'] = str_replace('.','-',$oneline['prefix']);
224
            $categoryselect->addOption($oneline['categoryID'], $oneline['prefix'].' '.$oneline['name']);
225
        }
226
        $sform->addElement($categoryselect,true);
227
    }
228

include/storyform.inc.php 1 location

@@ 33-43 (lines=11) @@
30
        $categoryselect = new XoopsFormSelect(_MD_LEXIKON_ENTRYCATEGORY, 'categoryID', $allowed_cats);
31
        $tbl = array();
32
        $tbl = $mytree->getChildTreeArray(0,'name');
33
        foreach($tbl as $oneline) {
34
            if (in_array($oneline['categoryID'], $allowed_cats)) {
35
                if ($oneline['prefix']=='.') {
36
                    $oneline['prefix']='';
37
                }
38
        
39
                $oneline['prefix'] = str_replace('.','-',$oneline['prefix']);
40
                //if (in_array($oneline['categoryID'], $allowed_cats)) {
41
                    $categoryselect->addOption($oneline['categoryID'], $oneline['prefix'].' '.$oneline['name']);
42
                    }
43
                }
44
        }
45
    $sform->addElement( $categoryselect, true );
46
/*    ob_start();