Code Duplication    Length = 4-5 lines in 8 locations

main/lp/learnpath.class.php 8 locations

@@ 6958-6961 (lines=4) @@
6955
        $item_title = Security::remove_XSS($item_title);
6956
        $item_description = Security::remove_XSS($item_description);
6957
6958
        if ($id != 0 && is_array($extra_info)) {
6959
            $parent = $extra_info['parent_item_id'];
6960
        } else {
6961
            $parent = 0;
6962
        }
6963
6964
        $sql = "SELECT * FROM $tbl_lp_item 
@@ 7172-7176 (lines=5) @@
7169
            $item_description = '';
7170
        }
7171
7172
        if ($id != 0 && is_array($extra_info)) {
7173
            $parent = $extra_info['parent_item_id'];
7174
        } else {
7175
            $parent = 0;
7176
        }
7177
7178
        $sql = "SELECT * FROM $tbl_lp_item
7179
                WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id;
@@ 7347-7351 (lines=5) @@
7344
            $item_description = '';
7345
        }
7346
7347
        if ($id != 0 && is_array($extra_info)) {
7348
            $parent = $extra_info['parent_item_id'];
7349
        } else {
7350
            $parent = 0;
7351
        }
7352
7353
        $sql = "SELECT * FROM ".$tbl_lp_item."
7354
                WHERE
@@ 7555-7559 (lines=5) @@
7552
            $item_description = '';
7553
        }
7554
7555
        if ($id != 0 && is_array($extra_info)) {
7556
            $parent = $extra_info['parent_item_id'];
7557
        } else {
7558
            $parent = 0;
7559
        }
7560
7561
        $sql = "SELECT * FROM ".$tbl_lp_item."
7562
                WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id;
@@ 7768-7772 (lines=5) @@
7765
            $item_path_fck = '';
7766
        }
7767
7768
        if ($id != 0 && is_array($extra_info)) {
7769
            $parent = $extra_info['parent_item_id'];
7770
        } else {
7771
            $parent = 0;
7772
        }
7773
7774
        $id  = intval($id);
7775
        $sql = "SELECT * FROM ".$tbl_lp_item."
@@ 8041-8045 (lines=5) @@
8038
        }
8039
        $return = '<legend>';
8040
8041
        if ($id != 0 && is_array($extra_info)) {
8042
            $parent = $extra_info['parent_item_id'];
8043
        } else {
8044
            $parent = 0;
8045
        }
8046
8047
        $sql = "SELECT * FROM $tbl_lp_item
8048
                WHERE c_id = $course_id AND lp_id = ".$this->lp_id;
@@ 8408-8412 (lines=5) @@
8405
            $this->getCurrentBuildingModeURL()
8406
        );
8407
        $defaults = [];
8408
        if ($id != 0 && is_array($extra_info)) {
8409
            $parent = $extra_info['parent_item_id'];
8410
        } else {
8411
            $parent = 0;
8412
        }
8413
8414
        $sql = "SELECT * FROM ".$tbl_lp_item."
8415
                WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id;
@@ 8613-8617 (lines=5) @@
8610
            $item_title = get_lang('Student_publication');
8611
        }
8612
8613
        if ($id != 0 && is_array($extra_info)) {
8614
            $parent = $extra_info['parent_item_id'];
8615
        } else {
8616
            $parent = 0;
8617
        }
8618
8619
        $sql = "SELECT * FROM $tbl_lp_item 
8620
                WHERE c_id = $course_id AND lp_id = ".$this->lp_id;