Skip to content

Commit

Permalink
UserGroup and deprecated function updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kaitlinnewson committed Jan 7, 2025
1 parent bdd0454 commit d63ee17
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 31 deletions.
2 changes: 1 addition & 1 deletion PragmaThemePlugin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function addSiteWideData($hookname, $args) {
$orcidImageUrl = $this->getPluginPath() . '/templates/images/orcid.png';

if ($request->getContext()) {
$templateMgr->assign('pragmaHomepageImage', $journal->getLocalizedSetting('homepageImage'));
$templateMgr->assign('pragmaHomepageImage', $journal->getLocalizedData('homepageImage'));
}

$templateMgr->assign(array(
Expand Down
12 changes: 6 additions & 6 deletions templates/frontend/components/registrationFormContexts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
</legend>
<div class="form-check">
{foreach from=$readerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{assign var="userGroupId" value=$userGroup->getId()}
{if $userGroup->permitSelfRegistration}
{assign var="userGroupId" value=$userGroup->id}
<input type="checkbox" class="form-check-input" id="readerGroup[{$userGroupId}]" name="readerGroup[{$userGroupId}]"{if in_array($userGroupId, $userGroupIds)} checked="checked"{/if}>
<label for="readerGroup[{$userGroupId}]" class="form-check-label">
{$userGroup->getLocalizedName()}
{$userGroup->getLocalizedData('name')}
</label>
{if in_array($userGroupId, $userGroupIds)}
{assign var=isSelected value=true}
Expand All @@ -57,11 +57,11 @@
</div>
<div class="form-check">
{foreach from=$reviewerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{assign var="userGroupId" value=$userGroup->getId()}
{if $userGroup->permitSelfRegistration}
{assign var="userGroupId" value=$userGroup->id}
<input type="checkbox" class="form-check-input" id="reviewerGroup[{$userGroupId}]" name="reviewerGroup[{$userGroupId}]"{if in_array($userGroupId, $userGroupIds)} checked="checked"{/if}>
<label for="reviewerGroup[{$userGroupId}]" class="form-check-label">
{$userGroup->getLocalizedName()}
{$userGroup->getLocalizedData('name')}
</label>
{if in_array($userGroupId, $userGroupIds)}
{assign var=isSelected value=true}
Expand Down
6 changes: 3 additions & 3 deletions templates/frontend/objects/article_details.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
{$authorString->getFullName()|escape}
{if $authorString->getData('orcid')}
{if $author->getData('orcidAccessToken')}
<a href="{$authorString->getOrcid()|escape}">
<a href="{$authorString->getData('orcid')|escape}">
{if $orcidIcon}
{$orcidIcon}
{else}
Expand All @@ -154,7 +154,7 @@
{else}
{translate key="user.affiliation"}
{/if}
</button>
</button>
</p>
<div class="collapse metadata" id="authorAffiliations">
{foreach from=$authors item=author}
Expand All @@ -165,7 +165,7 @@
<a class="article__rorImage" href="{$author->getData('rorId')|escape}">{$rorIdIcon}</a>
{/if}
<br><br>
</div>
</div>
{/foreach}
</div>
{/if}
Expand Down
9 changes: 5 additions & 4 deletions templates/frontend/objects/article_summary.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{**
* templates/frontend/objects/article_summary.tpl
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Copyright (c) 2014-2025 Simon Fraser University
* Copyright (c) 2003-2025 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @brief View of an Article summary which is shown within a list of articles.
Expand All @@ -15,9 +15,10 @@
* @uses $hideGalleys bool Hide the article galleys for this article?
* @uses $primaryGenreIds array List of file genre ids for primary file types
*}
{assign var=articlePath value=$article->getBestArticleId()}
{assign var="publication" value=$article->getCurrentPublication()}

{assign var=articlePath value=$publication->getData('urlPath')|default:$article->getId()}

{if (!$section.hideAuthor && $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_DEFAULT) || $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
{/if}
Expand All @@ -39,7 +40,7 @@
{foreach from=$article->getGalleys() item=galley}
{if $primaryGenreIds}
{assign var="file" value=$galley->getFile()}
{if !$galley->getRemoteUrl() && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{if !$galley->getData('urlRemote') && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{continue}
{/if}
{/if}
Expand Down
13 changes: 9 additions & 4 deletions templates/frontend/objects/galley_link.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@
{assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
{else}
{assign var="page" value="article"}
{assign var="parentId" value=$parent->getBestArticleId()}
{if $publication && $publication->getId() !== $parent->getData('currentPublicationId')}
{assign var="path" value=$parentId|to_array:"version":$publication->getId():$galley->getBestGalleyId()}
{if $publication}
{if $publication->getId() !== $parent->getData('currentPublicationId')}
{* Get a versioned link if we have an older publication *}
{assign var="path" value=$parent->getBestId()|to_array:"version":$publication->getId():$galley->getBestGalleyId()}
{else}
{assign var="parentId" value=$publication->getData('urlPath')|default:$article->getId()}
{assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
{/if}
{else}
{assign var="path" value=$parentId|to_array:$galley->getBestGalleyId()}
{assign var="path" value=$parent->getBestId()|to_array:$galley->getBestGalleyId()}
{/if}
{/if}

Expand Down
4 changes: 2 additions & 2 deletions templates/frontend/pages/about.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
{include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="about.aboutContext"}
</header>
<div>
{$currentContext->getLocalizedSetting('description')}
{$currentContext->getLocalizedData('description')}
<hr>
{$currentContext->getLocalizedSetting('about')}
{$currentContext->getLocalizedData('about')}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/frontend/pages/article.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @brief Display the page to view an article with all of it's details.
*
* @uses $article Article This article
* @uses $article Submission This article
* @uses $publication Publication The publication being displayed
* @uses $firstPublication Publication The first published version of this article
* @uses $currentPublication Publication The most recently published version of this article
Expand All @@ -17,7 +17,7 @@
* @uses $primaryGalleys array List of article galleys that are not supplementary or dependent
* @uses $supplementaryGalleys array List of article galleys that are supplementary
*}
{include file="frontend/components/header.tpl" pageTitleTranslated=$article->getLocalizedTitle()|escape}
{include file="frontend/components/header.tpl" pageTitleTranslated=$article->getLocalizedData('title')|escape}

<main class="container main__content" id="main">
<div class="row">
Expand Down
5 changes: 3 additions & 2 deletions templates/frontend/pages/editorialHistory.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@
</ul>
{/if}
{/foreach}

{include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="common.editorialHistory"}
{$currentContext->getLocalizedData('editorialHistory')}
</div>
</div>
{include file="frontend/components/editLink.tpl" page="management" op="settings" path="context" anchor="masthead" sectionTitleKey="common.editorialHistory"}
{$currentContext->getLocalizedData('editorialHistory')}
</main>

{include file="frontend/components/footer.tpl"}
2 changes: 1 addition & 1 deletion templates/frontend/pages/indexSite.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{assign var="countItems" value=count($journals)}
{foreach from=$journals item=journal}
{capture assign="url"}{url journal=$journal->getPath()}{/capture}
{assign var="thumb" value=$journal->getLocalizedSetting('journalThumbnail')}
{assign var="thumb" value=$journal->getLocalizedData('journalThumbnail')}
{assign var="description" value=$journal->getLocalizedDescription()}
{assign var="journalKey" value=$journalKey+1}
<article>
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/orcidAbout.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
{translate key="orcid.about.howAndWhyMemberAPI"}
</p>
{else}
<p>
<p class="description">
{translate key="orcid.about.howAndWhyPublicAPI"}
</p>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/privacy.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</h1>
</header>
<div>
{$currentContext->getLocalizedSetting('privacyStatement')}
{$currentContext->getLocalizedData('privacyStatement')}
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions templates/frontend/pages/userRegister.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{assign var=contextId value=$currentContext->getId()}
{assign var=userCanRegisterReviewer value=0}
{foreach from=$reviewerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{if $userGroup->permitSelfRegistration}
{assign var=userCanRegisterReviewer value=$userCanRegisterReviewer+1}
{/if}
{/foreach}
Expand All @@ -80,16 +80,16 @@
<div class="form-group">
<div id="reviewerOptinGroup" class="form-check optin">
{foreach from=$reviewerUserGroups[$contextId] item=userGroup}
{if $userGroup->getPermitSelfRegistration()}
{if $userGroup->permitSelfRegistration}

{assign var="userGroupId" value=$userGroup->getId()}
{assign var="userGroupId" value=$userGroup->id}
<input type="checkbox"
class="form-check-input"
id="checkbox-reviewer-interests"
name="reviewerGroup[{$userGroupId}]"
value="1"{if in_array($userGroupId, $userGroupIds)} checked="checked"{/if}>
<label for="checkbox-reviewer-interests" class="form-check-label">
{translate key=$checkboxLocaleKey userGroup=$userGroup->getLocalizedName()}
{translate key=$checkboxLocaleKey userGroup=$userGroup->getLocalizedData('name')}
</label>
{/if}
{/foreach}
Expand Down

0 comments on commit d63ee17

Please sign in to comment.