Code Duplication    Length = 15-16 lines in 2 locations

main/forum/forumfunction.inc.php 1 location

@@ 5674-5689 (lines=16) @@
5671
    $courseInfo = api_get_course_info_by_id($courseId);
5672
5673
    $forumList = array();
5674
    if (!empty($items)) {
5675
        foreach ($items as $forum) {
5676
            $forumInfo = get_forums(
5677
                $forum['ref'],
5678
                $courseInfo['code'],
5679
                true,
5680
                $sessionId
5681
            );
5682
5683
            $forumList[] = array(
5684
                $forumInfo['forum_title'],
5685
                api_get_local_time($forum['insert_date']),
5686
                api_get_local_time($forum['lastedit_date']),
5687
            );
5688
        }
5689
    }
5690
5691
    return $forumList;
5692
}

main/work/work.lib.php 1 location

@@ 5094-5108 (lines=15) @@
5091
    );
5092
5093
    $forumList = array();
5094
    if (!empty($items)) {
5095
        foreach ($items as $forum) {
5096
            $item = get_work_data_by_id(
5097
                $forum['ref'],
5098
                $courseId,
5099
                $sessionId
5100
            );
5101
5102
            $forumList[] = array(
5103
                $item['title'],
5104
                api_get_local_time($forum['insert_date']),
5105
                api_get_local_time($forum['lastedit_date'])
5106
            );
5107
        }
5108
    }
5109
5110
    return $forumList;
5111
}