Code Duplication    Length = 4-5 lines in 8 locations

main/newscorm/learnpath.class.php 8 locations

@@ 6465-6468 (lines=4) @@
6462
        $item_description 	= Security::remove_XSS($item_description);
6463
6464
        $legend = '<legend>';
6465
        if ($id != 0 && is_array($extra_info))
6466
            $parent = $extra_info['parent_item_id'];
6467
        else
6468
            $parent = 0;
6469
6470
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6471
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6706-6710 (lines=5) @@
6703
            $item_description = '';
6704
        }
6705
6706
        if ($id != 0 && is_array($extra_info)) {
6707
            $parent = $extra_info['parent_item_id'];
6708
        } else {
6709
            $parent = 0;
6710
        }
6711
6712
        $sql = "SELECT * FROM $tbl_lp_item
6713
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6881-6885 (lines=5) @@
6878
6879
        $legend = '<legend>';
6880
6881
        if ($id != 0 && is_array($extra_info)) {
6882
            $parent = $extra_info['parent_item_id'];
6883
        } else {
6884
            $parent = 0;
6885
        }
6886
6887
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6888
                WHERE
@@ 7072-7076 (lines=5) @@
7069
7070
        $return = null;
7071
7072
        if ($id != 0 && is_array($extra_info)) {
7073
            $parent = $extra_info['parent_item_id'];
7074
        } else {
7075
            $parent = 0;
7076
        }
7077
7078
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7079
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7265-7269 (lines=5) @@
7262
            $item_path_fck = '';
7263
        }
7264
7265
        if ($id != 0 && is_array($extra_info)) {
7266
            $parent = $extra_info['parent_item_id'];
7267
        } else {
7268
            $parent = 0;
7269
        }
7270
7271
        $id  = intval($id);
7272
        $sql = "SELECT * FROM " . $tbl_lp_item . "
@@ 7517-7521 (lines=5) @@
7514
        }
7515
        $return = '<legend>';
7516
7517
        if ($id != 0 && is_array($extra_info)) {
7518
            $parent = $extra_info['parent_item_id'];
7519
        } else {
7520
            $parent = 0;
7521
        }
7522
7523
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7524
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7808-7812 (lines=5) @@
7805
7806
        $legend = '<legend>';
7807
7808
        if ($id != 0 && is_array($extra_info)) {
7809
            $parent = $extra_info['parent_item_id'];
7810
        } else {
7811
            $parent = 0;
7812
        }
7813
7814
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7815
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7999-8003 (lines=5) @@
7996
            $item_title = get_lang('Student_publication');
7997
        }
7998
7999
        if ($id != 0 && is_array($extra_info)) {
8000
            $parent = $extra_info['parent_item_id'];
8001
        } else {
8002
            $parent = 0;
8003
        }
8004
8005
        $sql = "SELECT * FROM " . $tbl_lp_item . "
8006
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;