Code Duplication    Length = 15-16 lines in 2 locations

main/work/work.lib.php 1 location

@@ 5076-5090 (lines=15) @@
5073
    );
5074
5075
    $forumList = array();
5076
    if (!empty($items)) {
5077
        foreach ($items as $forum) {
5078
            $item = get_work_data_by_id(
5079
                $forum['ref'],
5080
                $courseId,
5081
                $sessionId
5082
            );
5083
5084
            $forumList[] = array(
5085
                $item['title'],
5086
                api_get_local_time($forum['insert_date']),
5087
                api_get_local_time($forum['lastedit_date'])
5088
            );
5089
        }
5090
    }
5091
5092
    return $forumList;
5093
}

main/forum/forumfunction.inc.php 1 location

@@ 5509-5524 (lines=16) @@
5506
    $courseInfo = api_get_course_info_by_id($courseId);
5507
5508
    $forumList = array();
5509
    if (!empty($items)) {
5510
        foreach ($items as $forum) {
5511
            $forumInfo = get_forums(
5512
                $forum['ref'],
5513
                $courseInfo['code'],
5514
                true,
5515
                $sessionId
5516
            );
5517
5518
            $forumList[] = array(
5519
                $forumInfo['forum_title'],
5520
                api_get_local_time($forum['insert_date']),
5521
                api_get_local_time($forum['lastedit_date']),
5522
            );
5523
        }
5524
    }
5525
5526
    return $forumList;
5527
}