Go to the source code of this file.
◆ appendInnerXML()
| appendInnerXML |
( |
|
$elt, |
|
|
|
$xmlString |
|
) |
| |
◆ bib_get()
Definition at line 56 of file grima-util.php.
57 require_once(
"grima-config.php");
58 $url = $hostname .
'/almaws/v1/bibs/{mms_id}';
60 $templateParamNames = array(
'{mms_id}');
61 $templateParamValues = array(urlencode($mms_id));
62 $url = str_replace($templateParamNames, $templateParamValues, $url);
63 $queryParams =
'?view=full&expand=None&apikey=' . urlencode($apikey);
64 curl_setopt($ch, CURLOPT_URL, $url . $queryParams);
65 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
66 curl_setopt($ch, CURLOPT_HEADER, FALSE);
67 curl_setopt($ch, CURLOPT_CUSTOMREQUEST,
'GET');
68 $response = curl_exec($ch);
◆ do_redirect()
Definition at line 45 of file grima-util.php.
Referenced by GrimaTask\call(), and GrimaTask\check_login().
46 if(!headers_sent()) header(
"Location: $url");
47 $url_html = htmlspecialchars($url);
48 echo
"<!DOCTYPE html><html><head><title>Redirect</title><meta http-equiv=refresh content='1; url=$url'></head><body><a href='$url_html'>Go here: $url_html</a></body></html>\n";
◆ importXML()
| importXML |
( |
|
$DOM, |
|
|
|
$xmlString |
|
) |
| |
◆ join_paths()
◆ mfhd_get()
| mfhd_get |
( |
|
$mms_id, |
|
|
|
$holding_id |
|
) |
| |
Definition at line 73 of file grima-util.php.
74 require_once(
"grima-config.php");
75 $url = $hostname .
'/almaws/v1/bibs/{mms_id}/holdings/{holding_id}';
77 $templateParamNames = array(
'{mms_id}',
'{holding_id}');
78 $templateParamValues = array(urlencode($mms_id,$holding_id));
79 $url = str_replace($templateParamNames, $templateParamValues, $url);
80 $queryParams =
'?view=full&expand=None&apikey=' . urlencode($apikey);
81 curl_setopt($ch, CURLOPT_URL, $url . $queryParams);
82 curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
83 curl_setopt($ch, CURLOPT_HEADER, FALSE);
84 curl_setopt($ch, CURLOPT_CUSTOMREQUEST,
'GET');
85 $response = curl_exec($ch);
◆ pauseAndAsk()
Definition at line 32 of file grima-util.php.
33 echo
"Are you sure you want to do this? Type 'yes' to continue: ";
34 $handle = fopen (
"php://stdin",
"r");
35 $line = fgets($handle);
36 if(trim($line) !=
'yes'){
42 echo
"Thank you, continuing...\n";
◆ setInnerXML()
| setInnerXML |
( |
|
$elt, |
|
|
|
$xmlString |
|
) |
| |
Definition at line 26 of file grima-util.php.
References appendInnerXML().
27 while( $elt->hasChildNodes() )
28 $elt->removeChild( $elt->lastChild );
appendInnerXML( $elt, $xmlString)
◆ XMLtoWeb()
Definition at line 7 of file grima-util.php.
8 header(
'Content-Type: text/plain');
9 $DOM->preserveWhiteSpace =
false;
10 $DOM->formatOutput =
true;
11 print $DOM->saveXML();