Skip to content

Commit

Permalink
ArticleHandler, article_details
Browse files Browse the repository at this point in the history
  • Loading branch information
bozana committed Jan 31, 2025
1 parent 2a37483 commit 7d3f394
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions pages/article/ArticleHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ public function view($args, $request)
]);
}

$rorIconPath = Core::getBaseDir() . '/' . PKP_LIB_PATH . '/templates/images/ror.svg';
$rorIdIcon = file_exists($rorIconPath) ? file_get_contents($rorIconPath) : '';

// Assign deprecated values to the template manager for
// compatibility with older themes
$templateMgr->assign([
Expand All @@ -313,6 +316,7 @@ public function view($args, $request)
'keywords' => $publication->getData('keywords'),
'orcidIcon' => OrcidManager::getIcon(),
'orcidUnauthenticatedIcon' => OrcidManager::getUnauthenticatedIcon(),
'rorIdIcon' => $rorIdIcon
]);

// Fetch and assign the galley to the template
Expand Down Expand Up @@ -362,10 +366,6 @@ public function view($args, $request)
$templateMgr->assign('purchaseArticleEnabled', true);
}

$rorIconPath = Core::getBaseDir() . '/' . PKP_LIB_PATH . '/templates/images/ror.svg';
$rorIdIcon = file_exists($rorIconPath) ? file_get_contents($rorIconPath) : '';
$templateMgr->assign('rorIdIcon', $rorIdIcon);

if (!Hook::call('ArticleHandler::view', [&$request, &$issue, &$article, $publication])) {
$templateMgr->display('frontend/pages/article.tpl');
event(new UsageEvent(Application::ASSOC_TYPE_SUBMISSION, $context, $article, null, null, $this->issue));
Expand Down
16 changes: 9 additions & 7 deletions templates/frontend/objects/article_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,15 @@
<span class="name">
{$author->getFullName()|escape}
</span>
<span class="affiliation">
{foreach name="affiliations" from=$author->getAffiliations() item="affiliation"}
{$affiliation->getLocalizedName()|escape}
{if $affiliation->getRor()}<a href="{$affiliation->getRor()|escape}">{$rorIdIcon}</a>{/if}
{if !$smarty.foreach.affiliations.last}{translate key="common.commaListSeparator"}{/if}
{/foreach}
</span>
{if count($author->getAffiliations()) > 0}
<span class="affiliation">
{foreach name="affiliations" from=$author->getAffiliations() item="affiliation"}
{$affiliation->getLocalizedName()|escape}
{if $affiliation->getRor()}<a href="{$affiliation->getRor()|escape}">{$rorIdIcon}</a>{/if}
{if !$smarty.foreach.affiliations.last}{translate key="common.commaListSeparator"}{/if}
{/foreach}
</span>
{/if}
{assign var=authorUserGroup value=$userGroupsById[$author->getData('userGroupId')]}
{if $authorUserGroup->showTitle}
<span class="userGroup">
Expand Down

0 comments on commit 7d3f394

Please sign in to comment.