Code Duplication    Length = 10-10 lines in 2 locations

main/admin/course_edit.php 1 location

@@ 282-291 (lines=10) @@
279
    $visual_code_is_used = false;
280
281
    $warn = get_lang('TheFollowingCoursesAlreadyUseThisVisualCode');
282
    if (!empty($visual_code)) {
283
        $list = CourseManager::get_courses_info_from_visual_code($visual_code);
284
        foreach ($list as $course_temp) {
285
            if ($course_temp['code'] != $course_code) {
286
                $visual_code_is_used = true;
287
                $warn .= ' ' . $course_temp['title'] . ' (' . $course_temp['code'] . '),';
288
            }
289
        }
290
        $warn = substr($warn, 0, -1);
291
    }
292
293
    $teachers = isset($course['course_teachers']) ? $course['course_teachers'] : '';
294
    $title = $course['title'];

main/inc/lib/document.lib.php 1 location

@@ 584-593 (lines=10) @@
581
        $condition_session .= self::getSessionFolderFilters($originalPath, $sessionId);
582
583
        $sharedCondition = null;
584
        if ($originalPath == '/shared_folder') {
585
            $students = CourseManager::get_user_list_from_course_code($_course['code'], $sessionId);
586
            if (!empty($students)) {
587
                $conditionList = array();
588
                foreach ($students as $studentId => $studentInfo) {
589
                    $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
590
                }
591
                $sharedCondition .= ' AND docs.path IN ("' . implode('","', $conditionList) . '")';
592
            }
593
        }
594
595
        $sql = "SELECT
596
                    docs.id,