Code Duplication    Length = 15-16 lines in 2 locations

main/forum/forumfunction.inc.php 1 location

@@ 5501-5516 (lines=16) @@
5498
    $courseInfo = api_get_course_info_by_id($courseId);
5499
5500
    $forumList = array();
5501
    if (!empty($items)) {
5502
        foreach ($items as $forum) {
5503
            $forumInfo = get_forums(
5504
                $forum['ref'],
5505
                $courseInfo['code'],
5506
                true,
5507
                $sessionId
5508
            );
5509
5510
            $forumList[] = array(
5511
                $forumInfo['forum_title'],
5512
                api_get_local_time($forum['insert_date']),
5513
                api_get_local_time($forum['lastedit_date']),
5514
            );
5515
        }
5516
    }
5517
5518
    return $forumList;
5519
}

main/work/work.lib.php 1 location

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