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

@@ 5051-5059 (lines=9) @@
5048
 * @param array $p_header
5049
 * @return int
5050
 */
5051
function preAddAllWorkStudentCallback($p_event, &$p_header)
5052
{
5053
    $files = Session::read('files');
5054
    if (isset($files[basename($p_header['stored_filename'])])) {
5055
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])]['title'];
5056
        return 1;
5057
    }
5058
    return 0;
5059
}
5060
5061
/**
5062
 * Get all work created by a user