Code Duplication    Length = 15-18 lines in 2 locations

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

@@ 2025-2042 (lines=18) @@
2022
        $html = '';
2023
        $list = array();
2024
        if (!empty($teacher_list)) {
2025
            foreach ($teacher_list as $teacher) {
2026
                $teacher_name = api_get_person_name(
2027
                    $teacher['firstname'],
2028
                    $teacher['lastname']
2029
                );
2030
                if ($add_link_to_profile) {
2031
                    $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $teacher['user_id'];
2032
                    $teacher_name = Display::url(
2033
                        $teacher_name,
2034
                        $url,
2035
                        [
2036
                            'class' => 'ajax',
2037
                            'data-title' => $teacher_name
2038
                        ]
2039
                    );
2040
                }
2041
                $list[] = $teacher_name;
2042
            }
2043
2044
            if (!empty($list)) {
2045
                if ($orderList === true){
@@ 2127-2141 (lines=15) @@
2124
        $course_coachs = array();
2125
        $html = '';
2126
        if (is_array($coachs_course)) {
2127
            foreach ($coachs_course as $coach_course) {
2128
                $coach_name = api_get_person_name($coach_course['firstname'], $coach_course['lastname']);
2129
                if ($add_link_to_profile) {
2130
                    $url = api_get_path(WEB_AJAX_PATH) . 'user_manager.ajax.php?a=get_user_popup&user_id=' . $coach_course['user_id'];
2131
                    $coach_name = Display::url(
2132
                        $coach_name,
2133
                        $url,
2134
                        [
2135
                            'class' => 'ajax',
2136
                            'data-title' => $coach_name
2137
                        ]
2138
                    );
2139
                }
2140
                $course_coachs[] = $coach_name;
2141
            }
2142
        }
2143
        $coaches_to_string = null;
2144