-
Notifications
You must be signed in to change notification settings - Fork 1
/
inc-js.php
54 lines (48 loc) · 1.89 KB
/
inc-js.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/*******************************************************************************
*
* LEIDEN OPEN VARIATION DATABASE (LOVD)
*
* Created : 2017-05-10
* Modified : 2017-05-10
* For LOVD : 3.0-19
*
* Copyright : 2004-2017 Leiden University Medical Center; http://www.LUMC.nl/
* Programmer : Ivo F.A.C. Fokkema <[email protected]>
*
*
* This file is part of LOVD.
*
* LOVD is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LOVD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LOVD. If not, see <http://www.gnu.org/licenses/>.
*
*************/
require './inc-init.php';
// Load the remote Javascript libraries.
$aFilesToLoad = array(
'lib/jQuery/jquery.min.js',
'inc-js-viewlist.php?nohistory', // Add ?nohistory to prevent VLs messing with each other through the hash.
'inc-js-tooltip.php',
);
header('Expires: ' . date('r', time()+(180*60)));
header('Content-type: text/javascript; charset=UTF-8');
// FIXME: Add more checks and fallbacks?
$sOutput = '';
foreach ($aFilesToLoad as $sFileToLoad) {
$sOutput .= file_get_contents($_SETT['LOVD_URL'] . $sFileToLoad) . "\n\n\n\n\n";
}
// Now, we need to replace the calls for the VL ajax request to the new URL.
// This doesn't support the download feature yet, which links to 'ajax/viewlist.php' instead of the entire URL, but then again we won't offer downloads.
$sOutput = str_replace($_SETT['LOVD_URL'], lovd_getInstallURL(), $sOutput);
die(rtrim($sOutput));
?>