Code Duplication    Length = 8-12 lines in 2 locations

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

@@ 6149-6156 (lines=8) @@
6146
            }
6147
        } else {
6148
            if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
6149
                if ($loadDirs) {
6150
                    $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon('folder.png', get_lang('Documents'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6151
                    $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container'));
6152
                } else {
6153
                    if ($course_info['status'] == COURSEMANAGER) {
6154
                        $params['right_actions'].= '<a class="btn btn-default btn-sm" title="'.get_lang('Edit').'" href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::returnFontAwesomeIcon('pencil').'</a>';
6155
                    }
6156
                }
6157
            }
6158
        }
6159
@@ 6478-6489 (lines=12) @@
6475
                if ($course_info['status'] == COURSEMANAGER) {
6476
                    //echo Display::return_icon('teachers.gif', get_lang('Status').': '.get_lang('Teacher'), array('style'=>'width: 11px; height: 11px;'));
6477
                }
6478
            } else {
6479
                if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
6480
                    if ($load_dirs) {
6481
                        $params['right_actions'] .= '<a id="document_preview_'.$course_info['real_id'].'_0" class="document_preview" href="javascript:void(0);">'.Display::return_icon(
6482
                                'folder.png',
6483
                                get_lang('Documents'),
6484
                                array('align' => 'absmiddle'),
6485
                                ICON_SIZE_SMALL
6486
                            ).'</a>';
6487
                        $params['right_actions'] .= Display::div(
6488
                            '',
6489
                            array(
6490
                                'id' => 'document_result_'.$course_info['real_id'].'_0',
6491
                                'class' => 'document_preview_container',
6492
                            )