-
Notifications
You must be signed in to change notification settings - Fork 0
/
jafmaexport.php
80 lines (66 loc) · 2.43 KB
/
jafmaexport.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/*
Page for exporting aigaion data to other sites.
Input data (get):
'mode' => 'bytopic', 'byauthor', 'byid'
'idparm' => id of the topic or of the author
['withlinks'] => '1' if we want links in each publication to the aigaion site; '0' (default) if not
'css' => style sheet file, that must be in /_utils/aigaion/export_css/
['filtertype'] => name of the type to filter
['iframe'] => '0' (default) if want the result in a HTML page; a number of pixels to indicate the height of the IFRAME to contain the result
*/
function parmexists($n)
{
//echo 'parmexists';
//echo $_GET[$n];
if (!isset($_GET[$n])) return(FALSE);
if (strlen($_GET[$n])<=0) return(FALSE);
return(TRUE);
}
function withiframe()
{
if ((parmexists('iframe'))&&(intval($_GET['iframe'])>0)) return(TRUE);
return(FALSE);
}
function errorandend($e)
{
if (!withiframe()) echo '<html><body>';
echo 'Error in the aigaion exporting URL: '.$e;
if (!withiframe()) echo '</body></html>';
exit(0);
}
if (!parmexists('mode')) errorandend('MODE not set');
if (!parmexists('idparm')) errorandend('ID not set');
if (!parmexists('css')) errorandend('CSS file not specified');
if (strcmp($_GET['mode'],'bytopic')==0) $mode='bytopic';
else if (strcmp($_GET['mode'],'byauthor')==0) $mode='byauthor';
else if (strcmp($_GET['mode'],'byid')==0) $mode='byid';
else if (strcmp($_GET['mode'],'all')==0) $mode='all';
else errorandend('MODE invalid');
if (intval($_GET['idparm'])<=0) errorandend('ID invalid');
$id=$_GET['idparm'];
if (parmexists('withlinks'))
{
if (intval($_GET['withlinks'])==1) $withlinks='1';
else $withlinks='0';
}
else $withlinks='0';
$css=$_GET['css'];
//$urlcall='http://mapir.isa.uma.es/_utils/aigaion/index.php/export/'.$mode.'/'.$id.'/'.$withlinks.'/'.$css;
$urlcall=AIGAION_ROOT_URL.'index.php/export/'.$mode.'/'.$id.'/'.$withlinks.'/'.$css;
if (parmexists('filtertype')) $urlcall.='/'.$_GET['filtertype'];
?>
<?php if (withiframe()): ?>
<iframe src="<?php echo $urlcall; ?>" width="100%" frameborder="0" height="<?php echo $_GET['iframe']; ?>">
If you are seeing this line of text, then your browser is incapable of showing the list of publications. You can list them <a href="<?php echo $urlcall; ?>" target="_blank">here</a> instead.
</iframe>
<?php else: ?>
<html>
<head>
<meta http-equiv="refresh" content="0;url=<?php echo $urlcall; ?>">
</head>
<body>
Loading list of publications...
</body>
</html>
<?php endif; ?>