Code Duplication    Length = 15-16 lines in 2 locations

main/forum/forumfunction.inc.php 1 location

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

main/work/work.lib.php 1 location

@@ 5063-5077 (lines=15) @@
5060
    );
5061
5062
    $forumList = array();
5063
    if (!empty($items)) {
5064
        foreach ($items as $forum) {
5065
            $item = get_work_data_by_id(
5066
                $forum['ref'],
5067
                $courseId,
5068
                $sessionId
5069
            );
5070
5071
            $forumList[] = array(
5072
                $item['title'],
5073
                api_get_local_time($forum['insert_date']),
5074
                api_get_local_time($forum['lastedit_date'])
5075
            );
5076
        }
5077
    }
5078
5079
    return $forumList;
5080
}