Code Duplication    Length = 8-12 lines in 2 locations

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

@@ 6097-6104 (lines=8) @@
6094
            }
6095
        } else {
6096
            if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
6097
                if ($loadDirs) {
6098
                    $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>';
6099
                    $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container'));
6100
                } else {
6101
                    if ($course_info['status'] == COURSEMANAGER) {
6102
                        $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>';
6103
                    }
6104
                }
6105
            }
6106
        }
6107
@@ 6249-6260 (lines=12) @@
6246
                if ($course_info['status'] == COURSEMANAGER) {
6247
                    //echo Display::return_icon('teachers.gif', get_lang('Status').': '.get_lang('Teacher'), array('style'=>'width: 11px; height: 11px;'));
6248
                }
6249
            } else {
6250
                if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED) {
6251
                    if ($load_dirs) {
6252
                        $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>';
6253
                        $params['right_actions'] .= Display::div('', array('id' => 'document_result_'.$course_info['real_id'].'_0', 'class'=>'document_preview_container'));
6254
                    } else {
6255
                        if ($course_info['status'] == COURSEMANAGER) {
6256
                            $params['right_actions'].= '<a href="'.api_get_path(WEB_CODE_PATH).'course_info/infocours.php?cidReq='.$course['code'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array('align' => 'absmiddle'),ICON_SIZE_SMALL).'</a>';
6257
                        }
6258
                    }
6259
                }
6260
            }
6261
6262
            $course_title_url = '';
6263
            if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED || $course['status'] == COURSEMANAGER) {