diff --git a/InlineHtmlGalleyBlockPlugin.php b/InlineHtmlGalleyBlockPlugin.php index 286ce94..d80f65d 100644 --- a/InlineHtmlGalleyBlockPlugin.php +++ b/InlineHtmlGalleyBlockPlugin.php @@ -105,7 +105,7 @@ function getPluginPath() { * Get the name of the block template file. * @return String */ - function getBlockTemplateFilename() { + public function getBlockTemplateFilename(): string { return 'blockDownload.tpl'; } @@ -119,7 +119,7 @@ function getContents($templateMgr, $request = null) { $submission = $templateMgr->getTemplateVars('article'); $galley = $templateMgr->getTemplateVars('galley'); if ($submission && $galley && $galley->getFileType() == 'text/html') { - $templateMgr->assign('submissionId', $submission->getBestArticleId()); + $templateMgr->assign('submissionId', $submission->getBestId()); $templateMgr->assign('galleyId', $galley->getBestGalleyId()); return parent::getContents($templateMgr); } diff --git a/InlineHtmlGalleySidebarBlockPlugin.php b/InlineHtmlGalleySidebarBlockPlugin.php index a36cdee..76766f2 100644 --- a/InlineHtmlGalleySidebarBlockPlugin.php +++ b/InlineHtmlGalleySidebarBlockPlugin.php @@ -39,7 +39,7 @@ function getDescription() { * Get the name of the block template file. * @return String */ - function getBlockTemplateFilename() { + public function getBlockTemplateFilename(): string { return 'block' . ucfirst($this->blockName()) . '.tpl'; } @@ -61,24 +61,6 @@ class InlineHtmlGalleyDoiSidebarBlockPlugin extends InlineHtmlGalleySidebarBlock function blockName() { return "doi"; } - - /** - * @copydoc BlockPlugin::getContents() - */ - function getContents($templateMgr, $request = null) { - if ($templateMgr && $request) { - $pubIdPlugins = $templateMgr->getTemplateVars('pubIdPlugins'); - if ($pubIdPlugins) { - foreach ($pubIdPlugins as $pubIdPlugin) { - if ($pubIdPlugin->getPubIdType() == 'doi') { - return parent::getContents($templateMgr, $request); - } - } - } - } - - return false; - } } class InlineHtmlGalleyCoverImageSidebarBlockPlugin extends InlineHtmlGalleySidebarBlockPlugin { diff --git a/templates/blockDoi.tpl b/templates/blockDoi.tpl index 93e7a68..49d1eb6 100644 --- a/templates/blockDoi.tpl +++ b/templates/blockDoi.tpl @@ -10,26 +10,18 @@ * *}
- {translate key="plugins.pubIds.doi.readerDisplayName"} - {* DOI (requires plugin) *} - {foreach from=$pubIdPlugins item=pubIdPlugin} - {if $pubIdPlugin->getPubIdType() != 'doi'} - {continue} - {/if} - {if $issue->getPublished()} - {assign var=pubId value=$article->getStoredPubId($pubIdPlugin->getPubIdType())} - {else} - {assign var=pubId value=$pubIdPlugin->getPubId($article)}{* Preview pubId *} - {/if} - {if $pubId} - {assign var="doiUrl" value=$pubIdPlugin->getResolvingURL($currentJournal->getId(), $pubId)|escape} + {translate key="doi.readerDisplayName"} + {* DOI *} + {assign var=doiObject value=$article->getCurrentPublication()->getData('doiObject')} + {if $doiObject} + {assign var="doi" value=$doiObject->getData('doi')} + {assign var="doiUrl" value=$doiObject->getData('resolvingUrl')|escape}
- {capture assign=translatedDoi}{translate key="plugins.pubIds.doi.readerDisplayName"}{/capture} + {capture assign=translatedDoi}{translate key="doi.readerDisplayName"}{/capture} {translate key="semicolon" label=$translatedDoi} - {$doiUrl} + {$doi}
- {/if} - {/foreach} + {/if}
\ No newline at end of file diff --git a/templates/blockKeywords.tpl b/templates/blockKeywords.tpl index c44cde8..15863b7 100644 --- a/templates/blockKeywords.tpl +++ b/templates/blockKeywords.tpl @@ -21,7 +21,7 @@
{foreach name="keywords" from=$publication->getLocalizedData('keywords') item="keyword"} - {$keyword|escape}{if !$smarty.foreach.keywords.last}{translate key="common.commaListSeparator"}{/if} + {$keyword.name|escape}{if !$smarty.foreach.keywords.last}{translate key="common.commaListSeparator"}{/if} {/foreach}
diff --git a/templates/blockPublishedDate.tpl b/templates/blockPublishedDate.tpl index 04e864d..45c6cf9 100644 --- a/templates/blockPublishedDate.tpl +++ b/templates/blockPublishedDate.tpl @@ -18,7 +18,7 @@
{capture assign=translatedDatePublished}{translate key="submissions.published"}{/capture} {translate key="semicolon" label=$translatedDatePublished} - {$publication->getData('datePublished')|date_format} + {$publication->getData('datePublished')|date_format:$dateFormatShort}
{* If this is an updated version *} {if $firstPublication->getID() !== $publication->getId()} diff --git a/templates/displayInline.tpl b/templates/displayInline.tpl index 248fe4f..579202c 100644 --- a/templates/displayInline.tpl +++ b/templates/displayInline.tpl @@ -16,7 +16,7 @@ * @uses $supplementaryGalleys array List of article galleys that are supplementary * @uses $inlineHtmlGalley string The HTML content of the Article Galley *} -{include file="frontend/components/header.tpl" pageTitleTranslated=$article->getLocalizedTitle()|escape} +{include file="frontend/components/header.tpl" pageTitleTranslated=$publication->getLocalizedFullTitle(null, 'html')|strip_unsafe_html|escape}
{if $section} @@ -30,10 +30,10 @@

- {$article->getLocalizedTitle()|escape} - {if $article->getLocalizedSubtitle()} + {$publication->getLocalizedTitle(null, 'html')|strip_unsafe_html|escape} + {if $publication->getLocalizedData('subtitle')} - {$article->getLocalizedSubtitle()|escape} + {$publication->getLocalizedSubTitle(null, 'html')|strip_unsafe_html|escape} {/if}

@@ -45,9 +45,12 @@ {foreach from=$publication->getData('authors') item=author}
{$author->getFullName()|escape} - {if $author->getLocalizedAffiliation()} + {if count($author->getAffiliations()) > 0} {/if} {if $author->getOrcid()} @@ -64,10 +67,10 @@ {/if} {* Article abstract *} - {if $article->getLocalizedAbstract()} + {if $publication->getLocalizedData('abstract')}
- {$article->getLocalizedAbstract()|strip_unsafe_html|nl2br} + {$publication->getLocalizedData('abstract')|strip_unsafe_html|nl2br}
{call_hook name="Templates::Article::Main"} @@ -76,7 +79,7 @@ {* Provide download link *}