Code Duplication    Length = 9-11 lines in 2 locations

main/work/downloadfolder.inc.php 1 location

@@ 197-207 (lines=11) @@
194
195
/*	Extra function (only used here) */
196
197
function my_pre_add_callback($p_event, &$p_header)
198
{
199
    global $files;
200
    if (isset($files[basename($p_header['stored_filename'])])) {
201
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])];
202
203
        return 1;
204
    }
205
206
    return 0;
207
}
208
209
/**
210
 * Return the difference between two arrays, as an array of those key/values

main/work/work.lib.php 1 location

@@ 5263-5271 (lines=9) @@
5260
 * @param array $p_header
5261
 * @return int
5262
 */
5263
function preAddAllWorkStudentCallback($p_event, &$p_header)
5264
{
5265
    $files = Session::read('files');
5266
    if (isset($files[basename($p_header['stored_filename'])])) {
5267
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])]['title'];
5268
        return 1;
5269
    }
5270
    return 0;
5271
}
5272
5273
/**
5274
 * Get all work created by a user