Code Duplication    Length = 9-11 lines in 2 locations

main/work/downloadfolder.inc.php 1 location

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

main/work/work.lib.php 1 location

@@ 5079-5087 (lines=9) @@
5076
 * @param array $p_header
5077
 * @return int
5078
 */
5079
function preAddAllWorkStudentCallback($p_event, &$p_header)
5080
{
5081
    $files = Session::read('files');
5082
    if (isset($files[basename($p_header['stored_filename'])])) {
5083
        $p_header['stored_filename'] = $files[basename($p_header['stored_filename'])]['title'];
5084
        return 1;
5085
    }
5086
    return 0;
5087
}
5088
5089
/**
5090
 * Get all work created by a user