Code Duplication    Length = 3-4 lines in 10 locations

main/document/create_audio.php 1 location

@@ 78-81 (lines=4) @@
75
76
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
77
78
if (!is_dir($filepath)) {
79
    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
80
    $dir = '/';
81
}
82
83
//groups //TODO: clean
84
if (!empty($groupId)) {

main/document/create_paint.php 1 location

@@ 72-75 (lines=4) @@
69
70
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
71
72
if (!is_dir($filepath)) {
73
	$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
74
	$dir = '/';
75
}
76
77
$groupId = api_get_group_id();
78

main/document/edit_draw.php 1 location

@@ 82-85 (lines=4) @@
79
80
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
81
82
if (!is_dir($filepath)) {
83
    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
84
    $dir = '/';
85
}
86
87
//groups //TODO:clean
88
if (!empty($group_id)) {

main/document/record_audio.php 1 location

@@ 76-79 (lines=4) @@
73
74
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
75
76
if (!is_dir($filepath)) {
77
    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
78
    $dir = '/';
79
}
80
81
//groups //TODO: clean
82
if (!empty($groupId)) {

main/document/create_document.php 1 location

@@ 196-199 (lines=4) @@
193
194
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
195
196
if (!is_dir($filepath)) {
197
    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
198
    $dir = '/';
199
}
200
201
if (!$is_certificate_mode) {
202
    if (api_is_in_group()) {

main/document/create_draw.php 1 location

@@ 76-79 (lines=4) @@
73
74
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
75
76
if (!is_dir($filepath)) {
77
    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
78
    $dir = '/';
79
}
80
81
$groupId = api_get_group_id();
82

main/document/edit_paint.php 1 location

@@ 78-81 (lines=4) @@
75
}
76
77
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
78
if (!is_dir($filepath)) {
79
    $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
80
    $dir = '/';
81
}
82
83
//groups //TODO:clean
84
if (!empty($groupId)) {

main/document/webcam_clip.php 1 location

@@ 65-68 (lines=4) @@
62
63
$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
64
65
if (!is_dir($filepath)) {
66
	$filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
67
	$dir = '/';
68
}
69
70
$groupId = api_get_group_id();
71

main/lp/learnpath.class.php 2 locations

@@ 6434-6437 (lines=4) @@
6431
        }
6432
6433
        $filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document/'.$dir;
6434
        if (!is_dir($filepath)) {
6435
            $dir = '/';
6436
            $filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document/'.$dir;
6437
        }
6438
6439
        // stripslashes() before calling api_replace_dangerous_char() because $_POST['title']
6440
        // is already escaped twice when it gets here.
@@ 6582-6584 (lines=3) @@
6579
6580
        $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir;
6581
6582
        if (!is_dir($filepath)) {
6583
            $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/';
6584
        }
6585
6586
        $table_doc = Database::get_course_table(TABLE_DOCUMENT);
6587