Code Duplication    Length = 15-18 lines in 2 locations

main/inc/lib/course.lib.php 2 locations

@@ 1857-1874 (lines=18) @@
1854
        $html = '';
1855
        $list = array();
1856
        if (!empty($teacher_list)) {
1857
            foreach ($teacher_list as $teacher) {
1858
                $teacher_name = api_get_person_name(
1859
                    $teacher['firstname'],
1860
                    $teacher['lastname']
1861
                );
1862
                if ($add_link_to_profile) {
1863
                    $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $teacher['user_id'];
1864
                    $teacher_name = Display::url(
1865
                        $teacher_name,
1866
                        $url,
1867
                        [
1868
                            'class' => 'ajax',
1869
                            'data-title' => $teacher_name
1870
                        ]
1871
                    );
1872
                }
1873
                $list[] = $teacher_name;
1874
            }
1875
1876
            if (!empty($list)) {
1877
                if ($orderList === true){
@@ 1959-1973 (lines=15) @@
1956
        $course_coachs = array();
1957
        $html = '';
1958
        if (is_array($coachs_course)) {
1959
            foreach ($coachs_course as $coach_course) {
1960
                $coach_name = api_get_person_name($coach_course['firstname'], $coach_course['lastname']);
1961
                if ($add_link_to_profile) {
1962
                    $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $coach_course['user_id'];
1963
                    $coach_name = Display::url(
1964
                        $coach_name,
1965
                        $url,
1966
                        [
1967
                            'class' => 'ajax',
1968
                            'data-title' => $coach_name
1969
                        ]
1970
                    );
1971
                }
1972
                $course_coachs[] = $coach_name;
1973
            }
1974
        }
1975
        $coaches_to_string = null;
1976