Code Duplication    Length = 4-5 lines in 8 locations

main/newscorm/learnpath.class.php 8 locations

@@ 6457-6460 (lines=4) @@
6454
        $item_description 	= Security::remove_XSS($item_description);
6455
6456
        $legend = '<legend>';
6457
        if ($id != 0 && is_array($extra_info))
6458
            $parent = $extra_info['parent_item_id'];
6459
        else
6460
            $parent = 0;
6461
6462
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6463
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6698-6702 (lines=5) @@
6695
            $item_description = '';
6696
        }
6697
6698
        if ($id != 0 && is_array($extra_info)) {
6699
            $parent = $extra_info['parent_item_id'];
6700
        } else {
6701
            $parent = 0;
6702
        }
6703
6704
        $sql = "SELECT * FROM $tbl_lp_item
6705
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6873-6877 (lines=5) @@
6870
6871
        $legend = '<legend>';
6872
6873
        if ($id != 0 && is_array($extra_info)) {
6874
            $parent = $extra_info['parent_item_id'];
6875
        } else {
6876
            $parent = 0;
6877
        }
6878
6879
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6880
                WHERE
@@ 7064-7068 (lines=5) @@
7061
7062
        $return = null;
7063
7064
        if ($id != 0 && is_array($extra_info)) {
7065
            $parent = $extra_info['parent_item_id'];
7066
        } else {
7067
            $parent = 0;
7068
        }
7069
7070
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7071
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7257-7261 (lines=5) @@
7254
            $item_path_fck = '';
7255
        }
7256
7257
        if ($id != 0 && is_array($extra_info)) {
7258
            $parent = $extra_info['parent_item_id'];
7259
        } else {
7260
            $parent = 0;
7261
        }
7262
7263
        $id  = intval($id);
7264
        $sql = "SELECT * FROM " . $tbl_lp_item . "
@@ 7509-7513 (lines=5) @@
7506
        }
7507
        $return = '<legend>';
7508
7509
        if ($id != 0 && is_array($extra_info)) {
7510
            $parent = $extra_info['parent_item_id'];
7511
        } else {
7512
            $parent = 0;
7513
        }
7514
7515
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7516
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7800-7804 (lines=5) @@
7797
7798
        $legend = '<legend>';
7799
7800
        if ($id != 0 && is_array($extra_info)) {
7801
            $parent = $extra_info['parent_item_id'];
7802
        } else {
7803
            $parent = 0;
7804
        }
7805
7806
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7807
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7991-7995 (lines=5) @@
7988
            $item_title = get_lang('Student_publication');
7989
        }
7990
7991
        if ($id != 0 && is_array($extra_info)) {
7992
            $parent = $extra_info['parent_item_id'];
7993
        } else {
7994
            $parent = 0;
7995
        }
7996
7997
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7998
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;