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

@@ 5002-5010 (lines=9) @@
4999
 * @param array $p_header
5000
 * @return int
5001
 */
5002
function preAddAllWorkStudentCallback($p_event, &$p_header)
5003
{
5004
    $files = Session::read('files');
5005
    if (isset($files[basename($p_header['stored_filename'])])) {
5006
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])]['title'];
5007
        return 1;
5008
    }
5009
    return 0;
5010
}
5011
5012
/**
5013
 * Get all work created by a user