-
Notifications
You must be signed in to change notification settings - Fork 898
/
article.tpl
131 lines (124 loc) · 5.72 KB
/
article.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
{**
* article.tpl
*
* Copyright (c) 2003-2010 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* Article View.
*
* $Id$
*}
{include file="article/header.tpl"}
{if $galley}
{if $galley->isHTMLGalley()}
{$galley->getHTMLContents()}
{elseif $galley->isPdfGalley()}
{url|assign:"pdfUrl" op="viewFile" path=$articleId|to_array:$galley->getBestGalleyId($currentJournal)}
{translate|assign:"noPluginText" key='article.pdf.pluginMissing'}
<script type="text/javascript">{literal}
$(document).ready(function(){
if ($.browser.webkit) { // PDFObject does not correctly work with safari's built-in PDF viewer
var embedCode = "<object id='pdfObject' type='application/pdf' data='{/literal}{$pdfUrl}{literal}' width='99%' height='99%'><div id='pluginMissing'>{/literal}{$noPluginText}{literal}</div></object>";
$("#articlePdf").html(embedCode);
if($("#pluginMissing").is(":hidden")) {
$('#fullscreenShow').show();
$("#articlePdf").resizable({ containment: 'parent', handles: 'se' });
} else { // Chrome Mac hides the embed object, obscuring the text. Reinsert.
$("#articlePdf").html('{/literal}{$noPluginText}{literal}');
}
} else {
var success = new PDFObject({ url: "{/literal}{$pdfUrl}{literal}" }).embed("articlePdf");
if (success) {
// PDF was embedded; enbale fullscreen mode and the resizable widget
$('#fullscreenShow').show();
$("#articlePdfResizer").resizable({ containment: 'parent', handles: 'se' });
}
}
});
{/literal}</script>
<div id="articlePdfResizer">
<div id="articlePdf" class="ui-widget-content">
{translate key="article.pdf.pluginMissing"}
</div>
</div>
<p>
{* The target="_parent" is for the sake of iphones, which present scroll problems otherwise. *}
<a class="action" target="_parent" href="{url op="download" path=$articleId|to_array:$galley->getBestGalleyId($currentJournal)}">{translate key="article.pdf.download"}</a>
<a class="action" href="#" id="fullscreenShow">{translate key="common.fullscreen"}</a>
<a class="action" href="#" id="fullscreenHide">{translate key="common.fullscreenOff"}</a>
</p>
{/if}
{else}
<div id="topBar">
{assign var=galleys value=$article->getLocalizedGalleys()}
{if $galleys && $subscriptionRequired && $showGalleyLinks}
<div id="accessKey">
<img src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_open_medium.gif" alt="{translate key="article.accessLogoOpen.altText"}" />
{translate key="reader.openAccess"}
<img src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_restricted_medium.gif" alt="{translate key="article.accessLogoRestricted.altText"}" />
{if $purchaseArticleEnabled}
{translate key="reader.subscriptionOrFeeAccess"}
{else}
{translate key="reader.subscriptionAccess"}
{/if}
</div>
{/if}
</div>
{if $coverPagePath}
<div id="articleCoverImage"><img src="{$coverPagePath|escape}{$coverPageFileName|escape}"{if $coverPageAltText != ''} alt="{$coverPageAltText|escape}"{else} alt="{translate key="article.coverPage.altText"}"{/if}{if $width} width="{$width|escape}"{/if}{if $height} height="{$height|escape}"{/if}/>
</div>
{/if}
{call_hook name="Templates::Article::Article::ArticleCoverImage"}
<div id="articleTitle"><h3>{$article->getLocalizedTitle()|strip_unsafe_html}</h3></div>
<div id="authorString"><em>{$article->getAuthorString()|escape}</em></div>
<br />
{if $article->getLocalizedAbstract()}
<div id="articleAbstract">
<h4>{translate key="article.abstract"}</h4>
<br />
<div>{$article->getLocalizedAbstract()|strip_unsafe_html|nl2br}</div>
<br />
</div>
{/if}
{if $citationFactory}
<h4>{translate key="submission.citations"}</h4>
<br />
<div>
{iterate from=citationFactory item=citation}
<p>{$citation->getRawCitation()|strip_unsafe_html}</p>
{/iterate}
</div>
<br />
{/if}
{if (!$subscriptionRequired || $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN || $subscribedUser || $subscribedDomain)}
{assign var=hasAccess value=1}
{else}
{assign var=hasAccess value=0}
{/if}
{if $galleys}
{translate key="reader.fullText"}
{if $hasAccess || ($subscriptionRequired && $showGalleyLinks)}
{foreach from=$article->getLocalizedGalleys() item=galley name=galleyList}
<a href="{url page="article" op="view" path=$article->getBestArticleId($currentJournal)|to_array:$galley->getBestGalleyId($currentJournal)}" class="file" target="_parent">{$galley->getGalleyLabel()|escape}</a>
{if $subscriptionRequired && $showGalleyLinks && $restrictOnlyPdf}
{if $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN || !$galley->isPdfGalley()}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_open_medium.gif" alt="{translate key="article.accessLogoOpen.altText"}" />
{else}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_restricted_medium.gif" alt="{translate key="article.accessLogoRestricted.altText"}" />
{/if}
{/if}
{/foreach}
{if $subscriptionRequired && $showGalleyLinks && !$restrictOnlyPdf}
{if $article->getAccessStatus() == $smarty.const.ARTICLE_ACCESS_OPEN}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_open_medium.gif" alt="{translate key="article.accessLogoOpen.altText"}" />
{else}
<img class="accessLogo" src="{$baseUrl}/lib/pkp/templates/images/icons/fulltext_restricted_medium.gif" alt="{translate key="article.accessLogoRestricted.altText"}" />
{/if}
{/if}
{else}
<a href="{url page="about" op="subscriptions"}" target="_parent">{translate key="reader.subscribersOnly"}</a>
{/if}
{/if}
{/if}
{include file="article/comments.tpl"}
{include file="article/footer.tpl"}