-
Notifications
You must be signed in to change notification settings - Fork 0
/
e-RAsearch.php
91 lines (66 loc) · 2.42 KB
/
e-RAsearch.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
81
82
83
84
85
86
87
88
89
90
<?php
/**
* @file seek.php
* @brief Search tool for the metadata.
*
* @author Nathalie Castells
* @version 0.1.0
*
* Tool to search the metadata information and give a list of possible experiments or datasets for the criteria wanted.
* @todo plan and develop this tool
* @date 10/04/2018
*/
// /This will be used to pass the experiment code, or type of page.
$expt = 'default';
include_once 'includes/init.php'; // these are the settings that refer to more than one page
/**
* pageinfo will have the values for the Title or the pages, experiment or farm keyword.
* The array is in settings.inc at the moment but we would also provide this using a json file or calling db.
*
* It has the following keys:
* { ["ExperimentName"]=> string(9) "Broadbalk" : the Long title of the experiment
* ["ExptCode"]=> string(4) "rbk1" : the code. This is what is search for
* ["KeyRef"]=> string(15) "KeyRefBroadbalk" : the keyword associated with the experiment or page to pull out of eRAbib the relevant papers
* ["URLCode"]=> string(9) "Broadbalk" : Previous code used in the URL of old site: we should look for that too.
* }
* @var array $pageinfo
*/
$pageinfo = getPageInfo($expt);
$KeyRef = $pageinfo['KeyRef'];
$page_title .= $pageinfo['ExperimentName'];
$filedatacite= 'metadata/'.$expt.'/info.json';
$datacite = file_get_contents($filedatacite);
if ($datacite) {
$script = "<script type=\"application/ld+json\">" . $datacite . "</script>";
}
?>
<!DOCTYPE html>
<html class="no-js" lang="en">
<head>
<?php
include 'includes/meta.html'; // that is the <meta and link tags> superseeds head.html
$script = ''; // $script is added to the header as the
if (isset($datacite)) {
$script = "<script type=\"application/ld+json\">" . $datacite . "</script>";
echo $script;
}
?>
</head>
<body>
<div class="container bg-white px-0">
<?php
include 'includes/header.html'; // all the menus at the top
// -- start dependant content ---------------------------------------------------------
?>
<div id="idSeek">
<h1>e-RAsearch</h1>
<p>Tool to search the metadata information and give a list of possible experiments or datasets for the criteria wanted.</p>
</div>
<?php
// -- start footers -----------------------------
include_once 'includes/footer.html';
include_once 'includes/finish.inc';
?>
</div>
</body>
</html>