Code Duplication    Length = 14-15 lines in 2 locations

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

@@ 4880-4893 (lines=14) @@
4877
            } */
4878
4879
            //Course visibility
4880
            if ($access_link && in_array('register', $access_link)) {
4881
                $my_course['register_button'] = Display::url(
4882
                    get_lang('Subscribe') . ' ' .
4883
                    Display::returnFontAwesomeIcon('sign-in'),
4884
                    api_get_path(WEB_COURSE_PATH) . $course_info['path'] .
4885
                     '/index.php?action=subscribe&sec_token=' . $stok,
4886
                    array(
4887
                        'class' => 'btn btn-success btn-sm',
4888
                        'title' => get_lang('Subscribe'),
4889
                        'aria-label' => get_lang('Subscribe')
4890
                    )
4891
                );
4892
4893
            }
4894
4895
            if ($access_link && in_array('enter',
4896
                    $access_link) || $course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD
@@ 4895-4909 (lines=15) @@
4892
4893
            }
4894
4895
            if ($access_link && in_array('enter',
4896
                    $access_link) || $course_info['visibility'] == COURSE_VISIBILITY_OPEN_WORLD
4897
            ) {
4898
                $my_course['go_to_course_button'] = Display::url(
4899
                    get_lang('GoToCourse'). ' ' .
4900
                    Display::returnFontAwesomeIcon('share'),
4901
                    api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php',
4902
                    array(
4903
                        'class' => 'btn btn-default btn-sm',
4904
                        'title' => get_lang('GoToCourse'),
4905
                        'aria-label' => get_lang('GoToCourse')
4906
                    )
4907
                );
4908
4909
            }
4910
4911
            if ($access_link && in_array('unsubscribe', $access_link)) {
4912
                $my_course['unsubscribe_button'] = Display::url(