From cc678c7d586ced2a841dff1f115134827502d37b Mon Sep 17 00:00:00 2001 From: Joao Martins Date: Mon, 24 Mar 2025 16:24:33 +0100 Subject: [PATCH 1/6] #10 adds date format modifier --- templates/blockPublishedDate.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()} From c8f78ff7e283a1b694a948cd5a4c06ebd44292bc Mon Sep 17 00:00:00 2001 From: Joao Martins Date: Wed, 7 Jan 2026 10:40:16 +0100 Subject: [PATCH 2/6] #10 fix doi side block --- InlineHtmlGalleySidebarBlockPlugin.php | 18 ------------------ templates/blockDoi.tpl | 23 +++++++---------------- 2 files changed, 7 insertions(+), 34 deletions(-) diff --git a/InlineHtmlGalleySidebarBlockPlugin.php b/InlineHtmlGalleySidebarBlockPlugin.php index a36cdee..6c9f88c 100644 --- a/InlineHtmlGalleySidebarBlockPlugin.php +++ b/InlineHtmlGalleySidebarBlockPlugin.php @@ -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..74e6446 100644 --- a/templates/blockDoi.tpl +++ b/templates/blockDoi.tpl @@ -10,26 +10,17 @@ * *}
- {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="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}
- {/if} - {/foreach} + {/if}
\ No newline at end of file From 984bc3904e353684823e937bb5121d7f24c06a63 Mon Sep 17 00:00:00 2001 From: Joao Martins Date: Wed, 7 Jan 2026 11:52:54 +0100 Subject: [PATCH 3/6] #10 replace url with doi --- templates/blockDoi.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/blockDoi.tpl b/templates/blockDoi.tpl index 74e6446..49d1eb6 100644 --- a/templates/blockDoi.tpl +++ b/templates/blockDoi.tpl @@ -14,12 +14,13 @@ {* 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="doi.readerDisplayName"}{/capture} {translate key="semicolon" label=$translatedDoi} - {$doiUrl} + {$doi}
{/if} From 2331d24de349cb4758e5fa5be24ef82a69605571 Mon Sep 17 00:00:00 2001 From: Joao Martins Date: Wed, 10 Jun 2026 18:53:40 +0200 Subject: [PATCH 4/6] #19 update plugin blocks and templates for OJS 3.5 compatibility --- InlineHtmlGalleyBlockPlugin.php | 5 ++--- InlineHtmlGalleySidebarBlockPlugin.php | 2 +- templates/displayInline.tpl | 21 ++++++++++++--------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/InlineHtmlGalleyBlockPlugin.php b/InlineHtmlGalleyBlockPlugin.php index 286ce94..fb9a971 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,8 +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('galleyId', $galley->getBestGalleyId()); + $templateMgr->assign('submissionId', $submission->getBestId()); $templateMgr->assign('galleyId', $galley->getBestGalleyId()); return parent::getContents($templateMgr); } } diff --git a/InlineHtmlGalleySidebarBlockPlugin.php b/InlineHtmlGalleySidebarBlockPlugin.php index 6c9f88c..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'; } 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 *} From 3ec186e376afe3315101ecfa7475098b4cad624e Mon Sep 17 00:00:00 2001 From: Joao Martins Date: Tue, 14 Jul 2026 17:20:42 +0200 Subject: [PATCH 5/6] #19 fix smarty template to display keywords --- templates/blockKeywords.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}
From 4af90854e074c6034050474f0af95754cf919f1f Mon Sep 17 00:00:00 2001 From: Joao Martins Date: Tue, 14 Jul 2026 17:34:05 +0200 Subject: [PATCH 6/6] fix formating --- InlineHtmlGalleyBlockPlugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InlineHtmlGalleyBlockPlugin.php b/InlineHtmlGalleyBlockPlugin.php index fb9a971..d80f65d 100644 --- a/InlineHtmlGalleyBlockPlugin.php +++ b/InlineHtmlGalleyBlockPlugin.php @@ -119,7 +119,8 @@ function getContents($templateMgr, $request = null) { $submission = $templateMgr->getTemplateVars('article'); $galley = $templateMgr->getTemplateVars('galley'); if ($submission && $galley && $galley->getFileType() == 'text/html') { - $templateMgr->assign('submissionId', $submission->getBestId()); $templateMgr->assign('galleyId', $galley->getBestGalleyId()); + $templateMgr->assign('submissionId', $submission->getBestId()); + $templateMgr->assign('galleyId', $galley->getBestGalleyId()); return parent::getContents($templateMgr); } }