Go to the source code of this file.
Creates Page to generate or display TPPS DOIs.
Definition in file manage_doi.inc.
◆ tpps_manage_doi()
tpps_manage_doi |
( |
|
$accession | ) |
|
This function creates a page to display the DOI of a TPPS submission.
If no DOI exists for the submission, one is automatically generated.
- Parameters
-
string | $accession | The accession number of the TPPS submission. |
- Returns
- string The HTML for the DOI page.
Definition at line 19 of file manage_doi.inc.
24 $token = variable_get(
'tpps_zenodo_api_key', NULL);
25 if (!empty($token) and empty($form_state[
'zenodo_id'])) {
29 $output .=
"<h4>DOI successfully published!</h4>";
31 elseif (!empty($token) and !empty($form_state[
'zenodo_id'])) {
35 if (empty($token) or empty($doi_object) or (isset($doi_object->status) and $doi_object->status != 200)) {
36 $output .=
"<h4>Unable to load Zenodo DOI. There is likely a problem with the Zenodo API key. Please contact your system administrator.</h4>";
39 $doi = $doi_object->doi;
40 $url = $doi_object->doi_url;
41 $badge = $doi_object->links->badge;
42 $output .=
"DOI: <a target=\"blank\" href=\"$url\">$doi</a><br>" 43 .
"DOI Badge: <a target=\"blank\" href=\"$badge\"><img src=\"$badge\"></a><br>";
46 return render($output);
tpps_update_submission(array $state, array $options=array())
tpps_load_submission($accession, $state=TRUE)
tpps_generate_doi($accession)