Code Duplication    Length = 6-9 lines in 2 locations

main/lp/learnpath.class.php 2 locations

@@ 3277-3282 (lines=6) @@
3274
        if ($this->debug > 0) {
3275
            error_log('New LP - In learnpath::get_link('.$type.','.$item_id.')', 0);
3276
        }
3277
        if (empty($item_id)) {
3278
            if ($this->debug > 2) {
3279
                error_log('New LP - In learnpath::get_link() - no item id given in learnpath::get_link(), using current: '.$this->get_current_item_id(), 0);
3280
            }
3281
            $item_id = $this->get_current_item_id();
3282
        }
3283
3284
        if (empty($item_id)) {
3285
            if ($this->debug > 2) {
@@ 3284-3292 (lines=9) @@
3281
            $item_id = $this->get_current_item_id();
3282
        }
3283
3284
        if (empty($item_id)) {
3285
            if ($this->debug > 2) {
3286
                error_log('New LP - In learnpath::get_link() - no current item id found in learnpath object', 0);
3287
            }
3288
            //still empty, this means there was no item_id given and we are not in an object context or
3289
            //the object property is empty, return empty link
3290
            $item_id = $this->first();
3291
            return '';
3292
        }
3293
3294
        $file = '';
3295
        $lp_table = Database::get_course_table(TABLE_LP_MAIN);