Code Duplication    Length = 4-5 lines in 8 locations

main/newscorm/learnpath.class.php 8 locations

@@ 6487-6490 (lines=4) @@
6484
        $item_title			= Security::remove_XSS($item_title);
6485
        $item_description 	= Security::remove_XSS($item_description);
6486
6487
        if ($id != 0 && is_array($extra_info))
6488
            $parent = $extra_info['parent_item_id'];
6489
        else
6490
            $parent = 0;
6491
6492
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6493
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6733-6737 (lines=5) @@
6730
            $item_description = '';
6731
        }
6732
6733
        if ($id != 0 && is_array($extra_info)) {
6734
            $parent = $extra_info['parent_item_id'];
6735
        } else {
6736
            $parent = 0;
6737
        }
6738
6739
        $sql = "SELECT * FROM $tbl_lp_item
6740
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 6906-6910 (lines=5) @@
6903
            $item_description = '';
6904
        }
6905
6906
        if ($id != 0 && is_array($extra_info)) {
6907
            $parent = $extra_info['parent_item_id'];
6908
        } else {
6909
            $parent = 0;
6910
        }
6911
6912
        $sql = "SELECT * FROM " . $tbl_lp_item . "
6913
                WHERE
@@ 7106-7110 (lines=5) @@
7103
            $item_description = '';
7104
        }
7105
7106
        if ($id != 0 && is_array($extra_info)) {
7107
            $parent = $extra_info['parent_item_id'];
7108
        } else {
7109
            $parent = 0;
7110
        }
7111
7112
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7113
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7325-7329 (lines=5) @@
7322
            $item_path_fck = '';
7323
        }
7324
7325
        if ($id != 0 && is_array($extra_info)) {
7326
            $parent = $extra_info['parent_item_id'];
7327
        } else {
7328
            $parent = 0;
7329
        }
7330
7331
        $id  = intval($id);
7332
        $sql = "SELECT * FROM " . $tbl_lp_item . "
@@ 7577-7581 (lines=5) @@
7574
        }
7575
        $return = '<legend>';
7576
7577
        if ($id != 0 && is_array($extra_info)) {
7578
            $parent = $extra_info['parent_item_id'];
7579
        } else {
7580
            $parent = 0;
7581
        }
7582
7583
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7584
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 7870-7874 (lines=5) @@
7867
        $form = new FormValidator('edit_link', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']);
7868
        $defaults = [];
7869
7870
        if ($id != 0 && is_array($extra_info)) {
7871
            $parent = $extra_info['parent_item_id'];
7872
        } else {
7873
            $parent = 0;
7874
        }
7875
7876
        $sql = "SELECT * FROM " . $tbl_lp_item . "
7877
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;
@@ 8079-8083 (lines=5) @@
8076
            $item_title = get_lang('Student_publication');
8077
        }
8078
8079
        if ($id != 0 && is_array($extra_info)) {
8080
            $parent = $extra_info['parent_item_id'];
8081
        } else {
8082
            $parent = 0;
8083
        }
8084
8085
        $sql = "SELECT * FROM " . $tbl_lp_item . "
8086
                WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id;