Code Duplication    Length = 16-17 lines in 2 locations

main/forum/forumfunction.inc.php 1 location

@@ 5580-5596 (lines=17) @@
5577
5578
    $courseInfo = api_get_course_info_by_id($courseId);
5579
    $forumList = array();
5580
    if (!empty($items)) {
5581
        foreach ($items as $forum) {
5582
            $forumInfo = get_forums(
5583
                $forum['ref'],
5584
                $courseInfo['code'],
5585
                true,
5586
                $sessionId
5587
            );
5588
            if (!empty($forumInfo)) {
5589
                $forumList[] = array(
5590
                    $forumInfo['forum_title'],
5591
                    api_get_local_time($forum['insert_date']),
5592
                    api_get_local_time($forum['lastedit_date']),
5593
                );
5594
            }
5595
        }
5596
    }
5597
5598
    return $forumList;
5599
}

main/work/work.lib.php 1 location

@@ 5483-5498 (lines=16) @@
5480
    );
5481
5482
    $list = array();
5483
    if (!empty($items)) {
5484
        foreach ($items as $work) {
5485
            $item = get_work_data_by_id(
5486
                $work['ref'],
5487
                $courseId,
5488
                $sessionId
5489
            );
5490
            if (!empty($item)) {
5491
                $list[] = array(
5492
                    $item['title'],
5493
                    api_get_local_time($work['insert_date']),
5494
                    api_get_local_time($work['lastedit_date'])
5495
                );
5496
            }
5497
        }
5498
    }
5499
5500
    return $list;
5501
}