diff --git a/.gitmodules b/.gitmodules index aeb73f157e..9f3b46b589 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "plugins/generic/webFeed"] path = plugins/generic/webFeed url = https://github.com/pkp/webFeed.git +[submodule "plugins/generic/openCitations"] + path = plugins/generic/openCitations + url = https://github.com/pkp/openCitations diff --git a/api/v1/citations/index.php b/api/v1/citations/index.php new file mode 100644 index 0000000000..63c3deb6f0 --- /dev/null +++ b/api/v1/citations/index.php @@ -0,0 +1,19 @@ +getData('citationsRaw')) { - $citationDao = DAORegistry::getDAO('CitationDAO'); /** @var CitationDAO $citationDao */ - $parsedCitations = $citationDao->getByPublicationId($publication->getId()); + if ($publication->getData('citations') || $publication->getData('citationsRaw')) { $templateMgr->assign([ - 'parsedCitations' => $parsedCitations->toArray(), + 'citations' => $publication->getData('citations'), + 'citationsRaw' => $publication->getData('citationsRaw') ]); } diff --git a/templates/frontend/objects/preprint_details.tpl b/templates/frontend/objects/preprint_details.tpl index f23e3d6b21..1f21493d4c 100644 --- a/templates/frontend/objects/preprint_details.tpl +++ b/templates/frontend/objects/preprint_details.tpl @@ -47,7 +47,7 @@ * plugins using the hooks provided: * * @hook Templates::Preprint::Main [] - * @hook Templates::Preprint::Details::Reference [[parsedCitation]] + * @hook Templates::Preprint::Details::Reference [] * @hook Templates::Preprint::Details [] * * @uses $preprint Preprint This preprint @@ -255,18 +255,18 @@ {/if} {* References *} - {if $parsedCitations || $publication->getData('citationsRaw')} + {if $citations || $citationsRaw}

{translate key="submission.citations"}

- {if $parsedCitations} - {foreach from=$parsedCitations item="parsedCitation"} -

{$parsedCitation->getCitationWithLinks()|strip_unsafe_html} {call_hook name="Templates::Preprint::Details::Reference" citation=$parsedCitation}

+ {if $citations} + {foreach from=$citations item="citation"} +

{$citation->getRawCitationWithLinks()|strip_unsafe_html} {call_hook name="Templates::Preprint::Details::Reference" citation=$citation}

{/foreach} {else} - {$publication->getData('citationsRaw')|escape|nl2br} + {$citationsRaw|escape|nl2br} {/if}