Code Duplication    Length = 15-16 lines in 2 locations

main/forum/forumfunction.inc.php 1 location

@@ 5490-5505 (lines=16) @@
5487
    $courseInfo = api_get_course_info_by_id($courseId);
5488
5489
    $forumList = array();
5490
    if (!empty($items)) {
5491
        foreach ($items as $forum) {
5492
            $forumInfo = get_forums(
5493
                $forum['ref'],
5494
                $courseInfo['code'],
5495
                true,
5496
                $sessionId
5497
            );
5498
5499
            $forumList[] = array(
5500
                $forumInfo['forum_title'],
5501
                api_get_local_time($forum['insert_date']),
5502
                api_get_local_time($forum['lastedit_date']),
5503
            );
5504
        }
5505
    }
5506
5507
    return $forumList;
5508
}

main/work/work.lib.php 1 location

@@ 5029-5043 (lines=15) @@
5026
    );
5027
5028
    $forumList = array();
5029
    if (!empty($items)) {
5030
        foreach ($items as $forum) {
5031
            $item = get_work_data_by_id(
5032
                $forum['ref'],
5033
                $courseId,
5034
                $sessionId
5035
            );
5036
5037
            $forumList[] = array(
5038
                $item['title'],
5039
                api_get_local_time($forum['insert_date']),
5040
                api_get_local_time($forum['lastedit_date'])
5041
            );
5042
        }
5043
    }
5044
5045
    return $forumList;
5046
}