Code Duplication    Length = 6-9 lines in 2 locations

main/newscorm/learnpath.class.php 2 locations

@@ 3356-3361 (lines=6) @@
3353
        if ($this->debug > 0) {
3354
            error_log('New LP - In learnpath::get_link(' . $type . ',' . $item_id . ')', 0);
3355
        }
3356
        if (empty($item_id)) {
3357
            if ($this->debug > 2) {
3358
                error_log('New LP - In learnpath::get_link() - no item id given in learnpath::get_link(), using current: ' . $this->get_current_item_id(), 0);
3359
            }
3360
            $item_id = $this->get_current_item_id();
3361
        }
3362
3363
        if (empty($item_id)) {
3364
            if ($this->debug > 2) {
@@ 3363-3371 (lines=9) @@
3360
            $item_id = $this->get_current_item_id();
3361
        }
3362
3363
        if (empty($item_id)) {
3364
            if ($this->debug > 2) {
3365
                error_log('New LP - In learnpath::get_link() - no current item id found in learnpath object', 0);
3366
            }
3367
            //still empty, this means there was no item_id given and we are not in an object context or
3368
            //the object property is empty, return empty link
3369
            $item_id = $this->first();
3370
            return '';
3371
        }
3372
3373
        $file = '';
3374
        $lp_table = Database::get_course_table(TABLE_LP_MAIN);