source: extensions/greydragon/template/picture.tpl @ 30484

Revision 30484, 18.6 KB checked in by SergeD, 5 years ago (diff)

version 1.0.14 - please refer to changelog for details

Line 
1{combine_script id='core.switchbox' load='async' require='jquery' path='themes/default/js/switchbox.js'}
2{combine_script id='picture-js' load='async' require='jquery,core.switchbox' path='themes/greydragon/js/theme.photo.js'}
3{assign var=overlay_mode value="off"}
4{if $greydragon.p_pict_tab_mode == "txt-with-overlay" || $greydragon.p_pict_tab_mode == "ico-with-overlay"}{$overlay_mode="on"}{/if}
5{assign var=ico_mode value="off"}
6{if $greydragon.p_pict_tab_mode == "ico-tab-open" || $greydragon.p_pict_tab_mode == "ico-tab-close" || $greydragon.p_pict_tab_mode == "ico-with-overlay"}{$ico_mode="on"}{/if}
7
8{if isset($MENUBAR)}{$MENUBAR}{/if}
9
10<div id="content"{if isset($MENUBAR)} class="contentWithMenu"{/if}>
11{if isset($errors) or not empty($infos)}
12{include file='infos_errors.tpl'}
13{/if}
14
15{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
16
17<div id="imageHeaderBar">
18  <div class="browsePath">
19    {$SECTION_TITLE}<span class="browsePathSeparator">{$LEVEL_SEPARATOR}</span><h2>{$current.TITLE}</h2>
20  </div>
21</div>
22
23<div id="imageToolBar">
24<div class="imageNumber">{$PHOTO}</div>
25{include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
26
27<div class="actionButtons">
28{if isset($current.unique_derivatives) && count($current.unique_derivatives)>1}
29{footer_script require='jquery'}{literal}
30function changeImgSrc(url,typeSave,typeMap) {
31  var theImg = document.getElementById("theMainImage");
32  if (theImg)
33  {
34    theImg.removeAttribute("width");theImg.removeAttribute("height");
35    theImg.src = url;
36    theImg.useMap = "#map"+typeMap;
37  }
38  jQuery('#derivativeSwitchBox .switchCheck').css('visibility','hidden');
39  jQuery('#derivativeChecked'+typeMap).css('visibility','visible');
40  document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}';
41}
42(SwitchBox=window.SwitchBox||[]).push("#derivativeSwitchLink", "#derivativeSwitchBox");
43{/literal}{/footer_script}
44
45{strip}<a id="derivativeSwitchLink" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
46  <span class="pwg-icon pwg-icon-sizes"></span><span class="pwg-button-text">{'Photo sizes'|@translate}</span>
47</a>
48<div id="derivativeSwitchBox" class="switchBox">
49  <div class="switchBoxTitle">{'Photo sizes'|@translate}</div>
50  {foreach from=$current.unique_derivatives item=derivative key=derivative_type}
51  <span class="switchCheck" id="derivativeChecked{$derivative->get_type()}"{if $derivative->get_type() ne $current.selected_derivative->get_type()} style="visibility:hidden"{/if}>&#x2714; </span>
52  <a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}')">
53    {$derivative->get_type()|@translate}<span class="derivativeSizeDetails"> ({$derivative->get_size_hr()})</span>
54  </a><br>
55  {/foreach}
56  {if isset($U_ORIGINAL)}
57    {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
58  <a href="javascript:phpWGOpenWindow('{$U_ORIGINAL}','xxx','scrollbars=yes,toolbar=no,status=no,resizable=yes')" rel="nofollow">{'Original'|@translate}</a>
59  {/if}
60</div>
61{/strip}
62{/if}
63{strip}{if isset($U_SLIDESHOW_START)}
64  <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
65    <span class="pwg-icon pwg-icon-slideshow"></span><span class="pwg-button-text">{'slideshow'|@translate}</span>
66  </a>
67{/if}{/strip}
68{strip}{if isset($U_METADATA)}
69  <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
70    <span class="pwg-icon pwg-icon-camera-info"></span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
71  </a>
72{/if}{/strip}
73{strip}{if isset($current.U_DOWNLOAD)}
74  <a href="{$current.U_DOWNLOAD}" title="{'Download this file'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
75    <span class="pwg-icon pwg-icon-save"></span><span class="pwg-button-text">{'Download'|@translate}</span>
76  </a>
77{/if}{/strip}
78{if isset($PLUGIN_PICTURE_BUTTONS)}{foreach from=$PLUGIN_PICTURE_BUTTONS item=button}{$button}{/foreach}{/if}
79{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
80{strip}{if isset($favorite)}
81  <a href="{$favorite.U_FAVORITE}" title="{if $favorite.IS_FAVORITE}{'delete this photo from your favorites'|@translate}{else}{'add this photo to your favorites'|@translate}{/if}" class="pwg-state-default pwg-button" rel="nofollow">
82    <span class="pwg-icon pwg-icon-favorite-{if $favorite.IS_FAVORITE}del{else}add{/if}"></span><span class="pwg-button-text">{'Favorites'|@translate}</span>
83  </a>
84{/if}{/strip}
85{strip}{if isset($U_SET_AS_REPRESENTATIVE)}
86  <a id="cmdSetRepresentative" href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
87    <span class="pwg-icon pwg-icon-representative"></span><span class="pwg-button-text">{'representative'|@translate}</span>
88  </a>
89{/if}{/strip}
90{strip}{if isset($U_PHOTO_ADMIN)}
91  <a id="cmdEditPhoto" href="{$U_PHOTO_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
92    <span class="pwg-icon pwg-icon-edit"></span><span class="pwg-button-text">{'Edit'|@translate}</span>
93  </a>
94{/if}{/strip}
95{strip}{if isset($U_CADDIE)}{*caddie management BEGIN*}
96{footer_script}
97{literal}function addToCadie(aElement, rootUrl, id) {
98  if (aElement.disabled) return;
99  aElement.disabled=true;
100  var y = new PwgWS(rootUrl);
101  y.callService("pwg.caddie.add", {image_id: id}, { onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; }, onSuccess: function(result) { aElement.disabled = false; }});
102}{/literal}
103{/footer_script}
104  <a href="{$U_CADDIE}" onclick="addToCadie(this, '{$ROOT_URL}', {$current.id}); return false;" title="{'Add to caddie'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
105    <span class="pwg-icon pwg-icon-caddie-add"> </span><span class="pwg-button-text">{'Caddie'|@translate}</span>
106  </a>
107{/if}{/strip}{*caddie management END*}
108</div>
109</div>{*<!-- imageToolBar -->*}
110
111<div id="theImageAndInfos">
112<div id="theImage">
113{$ELEMENT_CONTENT}
114
115{if isset($U_SLIDESHOW_STOP)}
116<p>
117  [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
118</p>
119{/if}
120
121</div>
122{* {if $DISPLAY_NAV_THUMB}
123<div id="imageInfos">
124  <div class="navThumbs">
125    {if isset($previous)}
126      <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE_ESC}" rel="prev">
127        <span class="thumbHover prevThumbHover"></span>
128        <img src="{$previous.derivatives.square->get_url()}" alt="{$previous.TITLE_ESC}">
129      </a>
130    {elseif isset($U_UP)}
131      <a class="navThumb" id="linkPrev" href="{$U_UP}" title="{'Thumbnails'|@translate}">
132        <div class="thumbHover">{'First Page'|@translate}<br><br>{'Go back to the album'|@translate}</div>
133      </a>
134    {/if}
135    {if isset($next)}
136      <a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE_ESC}" rel="next">
137        <span class="thumbHover nextThumbHover"></span>
138        <img src="{$next.derivatives.square->get_url()}" alt="{$next.TITLE_ESC}">
139      </a>
140    {elseif isset($U_UP)}
141      <a class="navThumb" id="linkNext"  href="{$U_UP}"  title="{'Thumbnails'|@translate}">
142        <div class="thumbHover">{'Last Page'|@translate}<br><br>{'Go back to the album'|@translate}</div>
143      </a>
144    {/if}
145  </div>
146</div>
147{/if} *}
148{if $greydragon.p_pict_tab_mode !== "hide" && $overlay_mode == "on"}
149<div id="image-metadata-ico">
150  <ul class="image-metadata-ico">
151    {if isset($COMMENT_IMG)}<li class="meta-desc{if $ico_mode=="on"} glyphicon glyphicon-eye-open{/if}{if $def_tab == 'desc'} active{/if}">{if $ico_mode=="off"}{'Description'|@translate}{/if}</li>{/if}
152    <li class="meta-info {if $ico_mode=="on"} glyphicon glyphicon-info-sign{/if}{if $def_tab == 'info'} active{/if}">{if $ico_mode=="off"}{'Info'|@translate}{/if}</li>
153    {if isset($metadata)}<li class="meta-exif{if $ico_mode=="on"} glyphicon glyphicon-camera{/if}{if $def_tab == 'exif'} active{/if}">{if $ico_mode=="off"}{'Exif'|@translate}{/if}</li>{/if}
154    <li class="meta-tags{if $ico_mode=="on"} glyphicon glyphicon-tags{/if}{if $def_tab == 'tags'} active{/if}" >{if $ico_mode=="off"}{'Tags'|@translate}{/if}</li>
155    {if isset($COMMENT_COUNT)}<li class="meta-comment{if $ico_mode=="on"} glyphicon glyphicon-comment{/if}{if $def_tab == 'comments'} active{/if}">{if $ico_mode=="off"}{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}{else}&nbsp;{$COMMENT_COUNT}{/if}</li>{/if}
156  </ul>
157</div>
158{/if}
159
160</div>
161
162{assign var=def_tab value="{$greydragon.p_pict_tab_default}"}
163{if !isset($metadata) && $def_tab == 'exif'}{$def_tab="desc"}{/if}
164{if !isset($COMMENT_COUNT) && $def_tab == 'comments'}{$def_tab="desc"}{/if}
165{if !isset($COMMENT_IMG) && $def_tab == 'desc'}{$def_tab="info"}{/if}
166{if $greydragon.p_pict_tab_mode !== "hide" && $overlay_mode == "off"}
167<ul class="image-metadata"> 
168  {if isset($COMMENT_IMG)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-eye-open{/if}{if $def_tab == 'desc'} active{/if}" rel="tab-desc">{if $ico_mode=="off"}{'Description'|@translate}{/if}</li>{/if}
169  <li class="{if $ico_mode=="on"}glyphicon glyphicon-info-sign{/if}{if $def_tab == 'info'} active{/if}" rel="tab-meta">{if $ico_mode=="off"}{'Info'|@translate}{/if}</li>
170  {if isset($metadata)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-camera{/if}{if $def_tab == 'exif'} active{/if}" rel="tab-exif">{if $ico_mode=="off"}{'Exif'|@translate}{/if}</li>{/if}
171  <li class="{if $ico_mode=="on"}glyphicon glyphicon-tags{/if}{if $def_tab == 'tags'} active{/if}" rel="tab-tags">{if $ico_mode=="off"}{'Tags'|@translate}{/if}</li>
172  {if isset($COMMENT_COUNT)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-comment{/if}{if $def_tab == 'comments'} active{/if}" rel="tab-comment">{if $ico_mode=="off"}{$COMMENT_COUNT|@translate_dec:'%d comment':'%d comments'}{else}&nbsp;{$COMMENT_COUNT}{/if}</li>{/if}
173  <li id="image-metadata-toggle" class="glyphicon {if $greydragon.p_pict_tab_mode == "txt-tab-close" || $greydragon.p_pict_tab_mode == "ico-tab-close"}glyphicon-chevron-down{else}glyphicon-chevron-up{/if}" ></li>
174</ul>
175{/if}
176{if $greydragon.p_pict_tab_mode !== "hide"}
177<div class="image-metadata-tabs{if $overlay_mode=="on"} overlay{/if}" {if $greydragon.p_pict_tab_mode == "txt-tab-close" || $greydragon.p_pict_tab_mode == "ico-tab-close" || $overlay_mode=="on"}style="display: none;"{/if}> 
178  {if isset($COMMENT_IMG)}
179  <div id="tab-desc" class="image-metadata-tab">
180    {$COMMENT_IMG}
181  </div>
182  {/if}
183
184  <div id="tab-meta" class="image-metadata-tab">
185    <dl id="standard" class="imageInfoTable dl-horizontal">
186    {strip}
187      {if $display_info.author and isset($INFO_AUTHOR)}
188      <dt id="Author" class="imageInfo">{'Author'|@translate}</dt>
189      <dd>{$INFO_AUTHOR}</dd>
190      {/if}
191      {if $display_info.created_on and isset($INFO_CREATION_DATE)}
192      <dt id="datecreate">{'Created on'|@translate}</dt>
193      <dd>{$INFO_CREATION_DATE}</dd>
194      {/if}
195      {if $display_info.posted_on}
196      <dt id="datepost">{'Posted on'|@translate}</dt>
197      <dd>{$INFO_POSTED_DATE}</dd>
198      {/if}
199      {if $display_info.dimensions and isset($INFO_DIMENSIONS)}
200      <dt id="Dimensions">{'Dimensions'|@translate}</dt>
201      <dd>{$INFO_DIMENSIONS}</dd>
202      {/if}
203      {if $display_info.file}
204      <dt id="File">{'File'|@translate}</dt>
205      <dd>{$INFO_FILE}</dd>
206      {/if}
207      {if $display_info.filesize and isset($INFO_FILESIZE)}
208      <dt id="Filesize">{'Filesize'|@translate}</dt>
209      <dd>{$INFO_FILESIZE}</dd>
210      {/if}
211      {if $display_info.categories and isset($related_categories)}
212      <dt id="Categories">{'Albums'|@translate}</dt>
213      <dd>
214        <ul>
215          {foreach from=$related_categories item=cat}
216          <li>{$cat}</li>
217          {/foreach}
218        </ul>
219      </dd>
220      {/if}
221      {if $display_info.visits}
222      <dt id="Visits">{'Visits'|@translate}</dt>
223      <dd>{$INFO_VISITS}</dd>
224      {/if}
225      {if $display_info.rating_score and isset($rate_summary)}
226      <dt id="Average">{'Rating score'|@translate}</dt>
227      <dd>
228        {if $rate_summary.count}
229        <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:'%d rate':'%d rates'})</span>
230        {else}
231        <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
232        {/if}
233      </dd>
234      {/if}
235
236      {if isset($rating)}
237      <dt id="rating" >
238        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
239      </dt>
240      <dd>
241        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
242          {foreach from=$rating.marks item=mark name=rate_loop}
243            {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
244            <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
245            {else}
246            <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
247            {/if}
248          {/foreach}
249          {strip}{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
250            {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
251            {footer_script}
252              var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
253              _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
254                onSuccess : function(rating) {ldelim}
255                  var e = document.getElementById("updateRate");
256                  if (e) e.innerHTML = "{'Update your rating'|@translate|@escape:'javascript'}";
257                  e = document.getElementById("ratingScore");
258                  if (e) e.innerHTML = rating.score;
259                  e = document.getElementById("ratingCount");
260                  if (e) {ldelim}
261                    if (rating.count == 1) {ldelim}
262                      e.innerHTML = "({'%d rate'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
263                    } else {ldelim}
264                      e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
265                    }
266                  {rdelim}
267              {rdelim}{rdelim} );
268            {/footer_script}
269          {/strip}
270        </form>
271      </dd>
272      {/if}
273
274      {if $display_info.privacy_level and isset($available_permission_levels)}
275      <dt id="Privacy">{'Who can see this photo?'|@translate}</dt>
276      <dd>
277        <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a>
278{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
279{footer_script require='jquery'}{strip}
280  function setPrivacyLevel(id, level){
281    (new PwgWS('{$ROOT_URL}')).callService(
282      "pwg.images.setPrivacyLevel", { image_id:id, level:level},
283        {
284          method: "POST",
285          onFailure: function(num, text) { alert(num + " " + text); },
286          onSuccess: function(result) {
287          jQuery('#privacyLevelBox .switchCheck').css('visibility','hidden');
288          jQuery('#switchLevel'+level).prev('.switchCheck').css('visibility','visible');
289          jQuery('#privacyLevelLink').text(jQuery('#switchLevel'+level).text());
290        }
291      }
292    );
293  }
294  (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox");
295{/strip}{/footer_script}
296        <div id="privacyLevelBox" class="switchBox" style="display:none">
297          {foreach from=$available_permission_levels item=label key=level}
298            <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
299            <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br>
300          {/foreach}
301        </div>
302      </dd>
303      {/if}
304    {/strip}
305    </dl>
306  </div>
307
308  {if isset($metadata)}
309  <div id="tab-exif" class="image-metadata-tab">
310    <dl id="metadata" class="imageInfoTable dl-horizontal">
311    {foreach from=$metadata item=meta}
312      {foreach from=$meta.lines item=value key=label}
313        <dt>{$label}</dt>
314        <dd>{$value}</dd>
315      {/foreach}
316    {/foreach}
317    </dl>
318  </div>
319  {/if}
320
321  <div id="tab-tags" class="image-metadata-tab">
322    {if $display_info.tags and isset($related_tags)}
323    <dd>
324      {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach}
325    </dd>
326    {else}
327    ...
328    {/if}
329  </div>
330
331  {if isset($COMMENT_COUNT)}
332  <div id="tab-comment" class="image-metadata-tab">
333    <div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}>
334      <div id="pictureComments">
335        {if isset($comment_add)}
336        <div id="commentAdd">
337          <h4>{'Add a comment'|@translate}</h4>
338          <form method="post" action="{$comment_add.F_ACTION}" id="addComment">
339            {if $comment_add.SHOW_AUTHOR}
340            <p><label for="author">{'Author'|@translate}{if $comment_add.AUTHOR_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
341            <p><input type="text" name="author" id="author" value="{$comment_add.AUTHOR}"></p>
342            {/if}
343            {if $comment_add.SHOW_EMAIL}
344            <p><label for="email">{'Email address'|@translate}{if $comment_add.EMAIL_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
345            <p><input type="text" name="email" id="email" value="{$comment_add.EMAIL}"></p>
346            {/if}
347            <p><label for="website_url">{'Website'|@translate} :</label></p>
348            <p><input type="text" name="website_url" id="website_url" value="{$comment_add.WEBSITE_URL}"></p>
349            <p><label for="contentid">{'Comment'|@translate} ({'mandatory'|@translate}) :</label></p>
350            <p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
351            <p><input type="hidden" name="key" value="{$comment_add.KEY}">
352            <input type="submit" value="{'Submit'|@translate}"></p>
353          </form>
354        </div>
355        {/if}
356        {if isset($comments)}
357        <div id="pictureCommentList">
358          {if (($COMMENT_COUNT > 2) || !empty($navbar))}
359          <div id="pictureCommentNavBar">
360            {if $COMMENT_COUNT > 2}
361            <a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
362            {/if}
363            {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
364          </div>
365          {/if}
366          {include file='comment_list.tpl'}
367        </div>
368        {/if}
369      </div>
370    </div>
371  </div>
372  {/if}
373</div>
374{/if}
375</div>
376{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
Note: See TracBrowser for help on using the repository browser.