Code Duplication    Length = 5-5 lines in 2 locations

manager/includes/document.parser.class.inc.php 2 locations

@@ 4578-4582 (lines=5) @@
4575
            if ($tvsort != '') {
4576
                $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4577
            }
4578
            if ($tvidnames == "*") {
4579
                $query = "tv.id<>0";
4580
            } else {
4581
                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')";
4582
            }
4583
4584
            $this->getUserDocGroups();
4585
@@ 4745-4749 (lines=5) @@
4742
            $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
4743
            $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
4744
4745
            if ($idnames == '*') {
4746
                $query = 'tv.id<>0';
4747
            } else {
4748
                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')";
4749
            }
4750
4751
            $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv
4752
                    INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id