Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions InlineHtmlGalleyBlockPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand All @@ -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);
}
Expand Down
20 changes: 1 addition & 19 deletions InlineHtmlGalleySidebarBlockPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand All @@ -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 {
Expand Down
26 changes: 9 additions & 17 deletions templates/blockDoi.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,18 @@
*
*}
<div class="pkp_block block_inline_html_doi">
<span class="title">{translate key="plugins.pubIds.doi.readerDisplayName"}</span>
{* 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}
<span class="title">{translate key="doi.readerDisplayName"}</span>
{* 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}
<div class="list-group-item doi">
{capture assign=translatedDoi}{translate key="plugins.pubIds.doi.readerDisplayName"}{/capture}
{capture assign=translatedDoi}{translate key="doi.readerDisplayName"}{/capture}
<strong>{translate key="semicolon" label=$translatedDoi}</strong>
<a href="{$doiUrl}">
{$doiUrl}
{$doi}
</a>
</div>
{/if}
{/foreach}
{/if}
</div>
2 changes: 1 addition & 1 deletion templates/blockKeywords.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<div class="">
<span class="value">
{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}
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/blockPublishedDate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="list-group-item date-published">
{capture assign=translatedDatePublished}{translate key="submissions.published"}{/capture}
<strong>{translate key="semicolon" label=$translatedDatePublished}</strong>
{$publication->getData('datePublished')|date_format}
{$publication->getData('datePublished')|date_format:$dateFormatShort}
</div>
{* If this is an updated version *}
{if $firstPublication->getID() !== $publication->getId()}
Expand Down
21 changes: 12 additions & 9 deletions templates/displayInline.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}

<div class="page page_article">
{if $section}
Expand All @@ -30,10 +30,10 @@

<header>
<h1 class="page-header">
{$article->getLocalizedTitle()|escape}
{if $article->getLocalizedSubtitle()}
{$publication->getLocalizedTitle(null, 'html')|strip_unsafe_html|escape}
{if $publication->getLocalizedData('subtitle')}
<small>
{$article->getLocalizedSubtitle()|escape}
{$publication->getLocalizedSubTitle(null, 'html')|strip_unsafe_html|escape}
</small>
{/if}
</h1>
Expand All @@ -45,9 +45,12 @@
{foreach from=$publication->getData('authors') item=author}
<div class="author">
<strong>{$author->getFullName()|escape}</strong>
{if $author->getLocalizedAffiliation()}
{if count($author->getAffiliations()) > 0}
<div class="article-author-affilitation">
{$author->getLocalizedAffiliation()|escape}
{foreach name="affiliations" from=$author->getAffiliations() item="affiliation"}
<span>{$affiliation->getLocalizedName()|escape}</span>
{if !$smarty.foreach.affiliations.last}{translate key="common.commaListSeparator"}{/if}
{/foreach}
</div>
{/if}
{if $author->getOrcid()}
Expand All @@ -64,10 +67,10 @@
{/if}

{* Article abstract *}
{if $article->getLocalizedAbstract()}
{if $publication->getLocalizedData('abstract')}
<div class="article-summary" id="summary">
<div class="article-abstract">
{$article->getLocalizedAbstract()|strip_unsafe_html|nl2br}
{$publication->getLocalizedData('abstract')|strip_unsafe_html|nl2br}
</div>
</div>
{call_hook name="Templates::Article::Main"}
Expand All @@ -76,7 +79,7 @@

{* Provide download link *}
<div class="inline_html_galley_download">
<a class="obj_galley_link file" href="{url page="article" op="download" path=$article->getBestArticleId()|to_array:$galley->getBestGalleyId()}">
<a class="obj_galley_link file" href="{url page="article" op="download" path=$article->getBestId()|to_array:$galley->getBestGalleyId()}">
{translate key="common.download"}
</a>
</div>
Expand Down