Code Duplication    Length = 15-16 lines in 2 locations

main/work/work.lib.php 1 location

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

main/forum/forumfunction.inc.php 1 location

@@ 5656-5671 (lines=16) @@
5653
    $courseInfo = api_get_course_info_by_id($courseId);
5654
5655
    $forumList = array();
5656
    if (!empty($items)) {
5657
        foreach ($items as $forum) {
5658
            $forumInfo = get_forums(
5659
                $forum['ref'],
5660
                $courseInfo['code'],
5661
                true,
5662
                $sessionId
5663
            );
5664
5665
            $forumList[] = array(
5666
                $forumInfo['forum_title'],
5667
                api_get_local_time($forum['insert_date']),
5668
                api_get_local_time($forum['lastedit_date']),
5669
            );
5670
        }
5671
    }
5672
5673
    return $forumList;
5674
}