Code Duplication    Length = 16-16 lines in 2 locations

main/forum/forumfunction.inc.php 1 location

@@ 5537-5552 (lines=16) @@
5534
    $courseInfo = api_get_course_info_by_id($courseId);
5535
5536
    $forumList = array();
5537
    if (!empty($items)) {
5538
        foreach ($items as $forum) {
5539
            $forumInfo = get_forums(
5540
                $forum['ref'],
5541
                $courseInfo['code'],
5542
                true,
5543
                $sessionId
5544
            );
5545
5546
            $forumList[] = array(
5547
                $forumInfo['forum_title'],
5548
                api_get_local_time($forum['insert_date']),
5549
                api_get_local_time($forum['lastedit_date']),
5550
            );
5551
        }
5552
    }
5553
5554
    return $forumList;
5555
}

main/work/work.lib.php 1 location

@@ 5424-5439 (lines=16) @@
5421
    );
5422
5423
    $list = array();
5424
    if (!empty($items)) {
5425
        foreach ($items as $work) {
5426
            $item = get_work_data_by_id(
5427
                $work['ref'],
5428
                $courseId,
5429
                $sessionId
5430
            );
5431
            if (!empty($item)) {
5432
                $list[] = array(
5433
                    $item['title'],
5434
                    api_get_local_time($work['insert_date']),
5435
                    api_get_local_time($work['lastedit_date'])
5436
                );
5437
            }
5438
        }
5439
    }
5440
5441
    return $list;
5442
}