Code Duplication    Length = 4-5 lines in 8 locations

main/newscorm/learnpath.class.php 8 locations

@@ 6904-6908 (lines=5) @@
6901
            $item_description = '';
6902
        }
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
@@ 6485-6488 (lines=4) @@
6482
        $item_title			= Security::remove_XSS($item_title);
6483
        $item_description 	= Security::remove_XSS($item_description);
6484
6485
        if ($id != 0 && is_array($extra_info))
6486
            $parent = $extra_info['parent_item_id'];
6487
        else
6488
            $parent = 0;
6489
6490
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6491
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6731-6735 (lines=5) @@
6728
            $item_description = '';
6729
        }
6730
6731
        if ($id != 0 && is_array($extra_info)) {
6732
            $parent = $extra_info['parent_item_id'];
6733
        } else {
6734
            $parent = 0;
6735
        }
6736
6737
        $sql = "SELECT * FROM $tbl_lp_item
6738
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7104-7108 (lines=5) @@
7101
            $item_description = '';
7102
        }
7103
7104
        if ($id != 0 && is_array($extra_info)) {
7105
            $parent = $extra_info['parent_item_id'];
7106
        } else {
7107
            $parent = 0;
7108
        }
7109
7110
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7111
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7323-7327 (lines=5) @@
7320
            $item_path_fck = '';
7321
        }
7322
7323
        if ($id != 0 && is_array($extra_info)) {
7324
            $parent = $extra_info['parent_item_id'];
7325
        } else {
7326
            $parent = 0;
7327
        }
7328
7329
        $id  = intval($id);
7330
        $sql = "SELECT * FROM " . $tbl_lp_item . "
@@ 7575-7579 (lines=5) @@
7572
        }
7573
        $return = '<legend>';
7574
7575
        if ($id != 0 && is_array($extra_info)) {
7576
            $parent = $extra_info['parent_item_id'];
7577
        } else {
7578
            $parent = 0;
7579
        }
7580
7581
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7582
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7868-7872 (lines=5) @@
7865
        $form = new FormValidator('edit_link', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']);
7866
        $defaults = [];
7867
7868
        if ($id != 0 && is_array($extra_info)) {
7869
            $parent = $extra_info['parent_item_id'];
7870
        } else {
7871
            $parent = 0;
7872
        }
7873
7874
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7875
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 8077-8081 (lines=5) @@
8074
            $item_title = get_lang('Student_publication');
8075
        }
8076
8077
        if ($id != 0 && is_array($extra_info)) {
8078
            $parent = $extra_info['parent_item_id'];
8079
        } else {
8080
            $parent = 0;
8081
        }
8082
8083
        $sql = "SELECT * FROM " . $tbl_lp_item . "
8084
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;