Skip to content

Commit 2393c83

Browse files
committed
DONE: #80 Compatability with ojs-3.5
1 parent 472a02d commit 2393c83

File tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

MaterialThemePlugin.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use APP\core\Application;
1717
use APP\file\PublicFileManager;
1818
use PKP\config\Config;
19-
use PKP\session\SessionManager;
19+
use PKP\core\PKPSessionGuard;
2020
use APP\template\TemplateManager;
2121

2222
class MaterialThemePlugin extends \PKP\plugins\ThemePlugin
@@ -25,7 +25,7 @@ class MaterialThemePlugin extends \PKP\plugins\ThemePlugin
2525
* @copydoc ThemePlugin::isActive()
2626
*/
2727
public function isActive() {
28-
if (SessionManager::isDisabled()) {
28+
if (PKPSessionGuard::isSessionDisable()) {
2929
return true;
3030
}
3131
return parent::isActive();
@@ -263,8 +263,9 @@ public function getDescription() {
263263
* @return string
264264
*/
265265
public function getJqueryPath($request) {
266+
// Load jQuery from a CDN or, if CDNs are disabled, from a local copy.
266267
$min = Config::getVar('general', 'enable_minified') ? '.min' : '';
267-
return $request->getBaseUrl() . '/lib/pkp/lib/vendor/components/jquery/jquery' . $min . '.js';
268+
return $request->getBaseUrl() . '/js/build/jquery/jquery' . $min . '.js';
268269
}
269270

270271
/**
@@ -274,7 +275,7 @@ public function getJqueryPath($request) {
274275
*/
275276
public function getJqueryUIPath($request) {
276277
$min = Config::getVar('general', 'enable_minified') ? '.min' : '';
277-
return $request->getBaseUrl() . '/lib/pkp/lib/vendor/components/jqueryui/jquery-ui' . $min . '.js';
278+
return $request->getBaseUrl() . '/js/build/jquery-ui/jquery-ui' . $min . '.js';
278279
}
279280

280281
public function smartyMaterialButtonPrimary($params, $content, $smarty, &$repeat) {

templates/frontend/objects/article_details.tpl

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
{$author->getFullName()|escape}
124124
</p>
125125

126-
{if $author->getLocalizedData('affiliation')}
126+
{if count($author->getAffiliations()) > 0}
127127
<div class="text-sm/6 text-slate-900 dark:text-slate-400 flex space-x-1 items-center">
128128
<svg xmlns="http://www.w3.org/2000/svg"
129129
viewBox="0 0 24 24" class="w-4 h-4"
@@ -133,16 +133,19 @@
133133
<path d="M9 22V12h6v10M2 10.6L12 2l10 8.6"/>
134134
</svg>
135135
<div>
136-
{$author->getLocalizedData('affiliation')|escape}
137-
{if $author->getData('rorId')}
138-
<a href="{$author->getData('rorId')|escape}">{$rorIdIcon}</a>
139-
{/if}
136+
<span class="affiliation">
137+
{foreach name="affiliations" from=$author->getAffiliations() item="affiliation"}
138+
<span>{$affiliation->getLocalizedName()|escape}</span>
139+
{if $affiliation->getRor()}<a href="{$affiliation->getRor()|escape}">{$rorIdIcon}</a>{/if}
140+
{if !$smarty.foreach.affiliations.last}{translate key="common.commaListSeparator"}{/if}
141+
{/foreach}
142+
</span>
140143
</div>
141144
</div>
142145
{/if}
143146

144147
{assign var=authorUserGroup value=$userGroupsById[$author->getData('userGroupId')]}
145-
{if $authorUserGroup->getShowTitle()}
148+
{if $authorUserGroup->showTitle}
146149
<div class="text-sm/6 text-slate-900 dark:text-slate-400 flex space-x-1 items-center">
147150
<svg xmlns="http://www.w3.org/2000/svg" class="w-4 h-4"
148151
viewBox="0 0 24 24"
@@ -154,20 +157,20 @@
154157
<circle cx="12" cy="12" r="10"/>
155158
</svg>
156159
<div class="userGroup">
157-
{$authorUserGroup->getLocalizedName()|escape}
160+
{$authorUserGroup->getLocalizedData('name')|escape}
158161
</div>
159162
</div>
160163
{/if}
161164

162165
{if $author->getData('orcid')}
163166
<div class="text-sm/6 text-slate-900 dark:text-slate-400 flex space-x-1 items-center">
164-
{if $author->getData('orcidAccessToken')}
167+
{if $author->hasVerifiedOrcid()}
165168
{$orcidIcon}
166169
{else}
167170
{include file="frontend/components/ui/material_icon_orcid.tpl"}
168171
{/if}
169172
<a href="{$author->getData('orcid')|escape}" target="_blank" class="break-words text-{$activeTheme->getOption('baseColour')}-400 ">
170-
{$author->getData('orcid')|escape}
173+
{$author->getOrcidDisplayValue()|escape}
171174
</a>
172175
</div>
173176
{/if}
@@ -264,10 +267,10 @@
264267
{if $author->getLocalizedData('biography')}
265268
<li class="sub_item">
266269
<div class="label text-sm/6 font-semibold text-slate-900 dark:text-slate-300">
267-
{if $author->getLocalizedData('affiliation')}
270+
{if $author->getLocalizedAffiliationNamesAsString()}
268271
{capture assign="authorName"}{$author->getFullName()|escape}{/capture}
269-
{capture assign="authorAffiliation"} {$author->getLocalizedData('affiliation')|escape} {/capture}
270-
{translate key="submission.authorWithAffiliation" name=$authorName affiliation=$authorAffiliation}
272+
{capture assign="authorAffiliations"} {$author->getLocalizedAffiliationNamesAsString(null, ', ')|escape} {/capture}
273+
{translate key="submission.authorWithAffiliation" name=$authorName affiliation=$authorAffiliations}
271274
{else}
272275
{$author->getFullName()|escape}
273276
{/if}
@@ -512,11 +515,11 @@
512515
</dd>
513516
</div>
514517
{/if}
515-
516-
{call_hook name="Templates::Article::Details"}
517-
</dl>
518+
</dl>
518519
</div>
519520

521+
{call_hook name="Templates::Article::Details"}
522+
520523
</div>
521524

522525
</div><!-- .row -->

templates/frontend/objects/article_summary.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{assign var="showAuthor" value=true}
2727
{/if}
2828

29-
<div class="flex md:space-x-4">
29+
<div class="flex md:space-x-4 w-full">
3030
{if $publication->getLocalizedData('coverImage')}
3131
<div class="w-32 flex-shrink-0 md:block hidden">
3232
<a {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if}>
@@ -37,7 +37,7 @@
3737
{/if}
3838

3939
<div class="flex-1">
40-
<div class="flex space-x-2">
40+
<div class="flex justify-between space-x-2">
4141
<{$heading} class="text-base font-semibold text-gray-900" style="margin-top: 0;">
4242
<a id="article-{$article->getId()}" {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if} class="hover:underline">
4343
{$publication->getLocalizedTitle(null, 'html')|strip_unsafe_html}
@@ -85,7 +85,7 @@
8585
{foreach from=$article->getGalleys() item=galley}
8686
{if $primaryGenreIds}
8787
{assign var="file" value=$galley->getFile()}
88-
{if !$galley->getRemoteUrl() && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
88+
{if !$galley->getData('urlRemote') && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
8989
{continue}
9090
{/if}
9191
{/if}

0 commit comments

Comments
 (0)