Code Duplication    Length = 4-5 lines in 8 locations

main/newscorm/learnpath.class.php 8 locations

@@ 6488-6491 (lines=4) @@
6485
        $item_description 	= Security::remove_XSS($item_description);
6486
6487
        $legend = '<legend>';
6488
        if ($id != 0 && is_array($extra_info))
6489
            $parent = $extra_info['parent_item_id'];
6490
        else
6491
            $parent = 0;
6492
6493
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6494
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6729-6733 (lines=5) @@
6726
            $item_description = '';
6727
        }
6728
6729
        if ($id != 0 && is_array($extra_info)) {
6730
            $parent = $extra_info['parent_item_id'];
6731
        } else {
6732
            $parent = 0;
6733
        }
6734
6735
        $sql = "SELECT * FROM $tbl_lp_item
6736
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6904-6908 (lines=5) @@
6901
6902
        $legend = '<legend>';
6903
6904
        if ($id != 0 && is_array($extra_info)) {
6905
            $parent = $extra_info['parent_item_id'];
6906
        } else {
6907
            $parent = 0;
6908
        }
6909
6910
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6911
                WHERE
@@ 7095-7099 (lines=5) @@
7092
7093
        $return = null;
7094
7095
        if ($id != 0 && is_array($extra_info)) {
7096
            $parent = $extra_info['parent_item_id'];
7097
        } else {
7098
            $parent = 0;
7099
        }
7100
7101
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7102
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7288-7292 (lines=5) @@
7285
            $item_path_fck = '';
7286
        }
7287
7288
        if ($id != 0 && is_array($extra_info)) {
7289
            $parent = $extra_info['parent_item_id'];
7290
        } else {
7291
            $parent = 0;
7292
        }
7293
7294
        $id  = intval($id);
7295
        $sql = "SELECT * FROM " . $tbl_lp_item . "
@@ 7540-7544 (lines=5) @@
7537
        }
7538
        $return = '<legend>';
7539
7540
        if ($id != 0 && is_array($extra_info)) {
7541
            $parent = $extra_info['parent_item_id'];
7542
        } else {
7543
            $parent = 0;
7544
        }
7545
7546
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7547
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7832-7836 (lines=5) @@
7829
7830
        $legend = '<legend>';
7831
7832
        if ($id != 0 && is_array($extra_info)) {
7833
            $parent = $extra_info['parent_item_id'];
7834
        } else {
7835
            $parent = 0;
7836
        }
7837
7838
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7839
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 8023-8027 (lines=5) @@
8020
            $item_title = get_lang('Student_publication');
8021
        }
8022
8023
        if ($id != 0 && is_array($extra_info)) {
8024
            $parent = $extra_info['parent_item_id'];
8025
        } else {
8026
            $parent = 0;
8027
        }
8028
8029
        $sql = "SELECT * FROM " . $tbl_lp_item . "
8030
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;