Code Duplication    Length = 9-11 lines in 2 locations

main/work/downloadfolder.inc.php 1 location

@@ 207-217 (lines=11) @@
204
}
205
206
/*	Extra function (only used here) */
207
function my_pre_add_callback($p_event, &$p_header)
208
{
209
    global $files;
210
    if (isset($files[basename($p_header['stored_filename'])])) {
211
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])];
212
213
        return 1;
214
    }
215
216
    return 0;
217
}
218
219
/**
220
 * Return the difference between two arrays, as an array of those key/values

main/work/work.lib.php 1 location

@@ 5456-5464 (lines=9) @@
5453
 * @param array $p_header
5454
 * @return int
5455
 */
5456
function preAddAllWorkStudentCallback($p_event, &$p_header)
5457
{
5458
    $files = Session::read('files');
5459
    if (isset($files[basename($p_header['stored_filename'])])) {
5460
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])]['title'];
5461
        return 1;
5462
    }
5463
    return 0;
5464
}
5465
5466
/**
5467
 * Get all work created by a user