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

Last change on this file since 30741 was 30741, checked in by SergeD, 9 years ago

version 1.0.17 - please refer to changelog for more details

File size: 19.4 KB
Line 
1{include file='include/colorbox.inc.tpl'}
2{combine_script id='core.switchbox' load='async' require='jquery' path='themes/default/js/switchbox.js'}
3{combine_script id='picture-js' load='async' require='jquery,jquery.colorbox' path='themes/greydragon/js/theme.photo.js'}
4{assign var=overlay_mode value="off"}
5{if $greydragon.p_pict_tab_mode == "txt-with-overlay" || $greydragon.p_pict_tab_mode == "ico-with-overlay"}{$overlay_mode="on"}{/if}
6{assign var=ico_mode value="off"}
7{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}
8                                                                                           
9{if isset($MENUBAR)}{$MENUBAR}{/if}
10
11<div id="content"{if isset($MENUBAR)} class="contentWithMenu"{/if}>
12{if isset($errors) or not empty($infos)}
13{include file='infos_errors.tpl'}
14{/if}
15
16{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
17
18<div id="imageHeaderBar">
19  <div class="browsePath">
20    {$SECTION_TITLE}<span class="browsePathSeparator">{$LEVEL_SEPARATOR}</span><h2>{$current.TITLE}</h2>
21  </div>
22</div>
23
24<div id="imageToolBar">
25<div class="imageNumber">{$PHOTO}</div>
26{include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
27
28<div class="actionButtons">
29{if isset($current.unique_derivatives) && count($current.unique_derivatives)>1}
30{footer_script require='jquery'}{literal}
31function changeImgSrc(url,typeSave,typeMap) {
32  var theImg = document.getElementById("theMainImage");
33  if (theImg)
34  {
35    theImg.removeAttribute("width");theImg.removeAttribute("height");
36    theImg.src = url;
37    theImg.useMap = "#map"+typeMap;
38  }
39  jQuery('#derivativeSwitchBox .switchCheck').css('visibility','hidden');
40  jQuery('#derivativeChecked'+typeMap).css('visibility','visible');
41  document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}';
42}
43(SwitchBox=window.SwitchBox||[]).push("#derivativeSwitchLink", "#derivativeSwitchBox");
44{/literal}{/footer_script}
45
46{strip}<a id="derivativeSwitchLink" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
47  <span class="pwg-icon pwg-icon-sizes"></span><span class="pwg-button-text">{'Photo sizes'|@translate}</span>
48</a>
49<div id="derivativeSwitchBox" class="switchBox">
50  <div class="switchBoxTitle">{'Photo sizes'|@translate}</div>
51  {foreach from=$current.unique_derivatives item=derivative key=derivative_type}
52  <span class="switchCheck" id="derivativeChecked{$derivative->get_type()}"{if $derivative->get_type() ne $current.selected_derivative->get_type()} style="visibility:hidden"{/if}>&#x2714; </span>
53  <a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}')">
54    {$derivative->get_type()|@translate}<span class="derivativeSizeDetails"> ({$derivative->get_size_hr()})</span>
55  </a><br>
56  {/foreach}
57  {if isset($U_ORIGINAL)}
58    {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
59  <a href="javascript:phpWGOpenWindow('{$U_ORIGINAL}','xxx','scrollbars=yes,toolbar=no,status=no,resizable=yes')" rel="nofollow">{'Original'|@translate}</a>
60  {/if}
61</div>
62{/strip}
63{/if}
64{strip}{if isset($U_SLIDESHOW_START)}
65  <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
66    <span class="pwg-icon pwg-icon-slideshow"></span><span class="pwg-button-text">{'slideshow'|@translate}</span>
67  </a>
68{/if}{/strip}
69{strip}{if isset($current.U_DOWNLOAD)}
70  <a href="{$current.U_DOWNLOAD}" title="{'Download this file'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
71    <span class="pwg-icon pwg-icon-save"></span><span class="pwg-button-text">{'Download'|@translate}</span>
72  </a>
73{/if}{/strip}
74{if isset($PLUGIN_PICTURE_BUTTONS)}{foreach from=$PLUGIN_PICTURE_BUTTONS item=button}{$button}{/foreach}{/if}
75{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
76{strip}{if isset($favorite)}
77  <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">
78    <span class="pwg-icon pwg-icon-favorite-{if $favorite.IS_FAVORITE}del{else}add{/if}"></span><span class="pwg-button-text">{'Favorites'|@translate}</span>
79  </a>
80{/if}{/strip}
81{strip}{if isset($U_SET_AS_REPRESENTATIVE)}
82  <a id="cmdSetRepresentative" href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
83    <span class="pwg-icon pwg-icon-representative"></span><span class="pwg-button-text">{'representative'|@translate}</span>
84  </a>
85{/if}{/strip}
86{strip}{if isset($U_PHOTO_ADMIN)}
87  <a id="cmdEditPhoto" href="{$U_PHOTO_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
88    <span class="pwg-icon pwg-icon-edit"></span><span class="pwg-button-text">{'Edit'|@translate}</span>
89  </a>
90{/if}{/strip}
91{strip}{if isset($U_CADDIE)}{*caddie management BEGIN*}
92{footer_script}
93{literal}function addToCadie(aElement, rootUrl, id) {
94  if (aElement.disabled) return;
95  aElement.disabled=true;
96  var y = new PwgWS(rootUrl);
97  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; }});
98}{/literal}
99{/footer_script}
100  <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">
101    <span class="pwg-icon pwg-icon-caddie-add"> </span><span class="pwg-button-text">{'Caddie'|@translate}</span>
102  </a>
103{/if}{/strip}{*caddie management END*}
104</div>
105</div>{*<!-- imageToolBar -->*}
106
107<div id="theImageAndInfos">
108<div id="theImage">
109{$ELEMENT_CONTENT}
110
111{if isset($U_SLIDESHOW_STOP)}
112<p>
113  [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
114</p>
115{/if}
116
117{if $DISPLAY_NAV_THUMB}
118<div id="imageInfos">
119  <div class="navThumbs">
120    {if isset($previous)}
121      <a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE_ESC}" rel="prev">
122        <span class="thumbHover prevThumbHover"></span>
123        <img src="{$previous.derivatives.square->get_url()}" alt="{$previous.TITLE_ESC}">
124      </a>
125    {elseif isset($U_UP)}
126      <a class="navThumb" id="linkPrev" href="{$U_UP}" title="{'Thumbnails'|@translate}">
127        <div class="thumbHover">{'First Page'|@translate}<br><br>{'Go back to the album'|@translate}</div>
128      </a>
129    {/if}
130    {if isset($next)}
131      <a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE_ESC}" rel="next">
132        <span class="thumbHover nextThumbHover"></span>
133        <img src="{$next.derivatives.square->get_url()}" alt="{$next.TITLE_ESC}">
134      </a>
135    {elseif isset($U_UP)}
136      <a class="navThumb" id="linkNext"  href="{$U_UP}"  title="{'Thumbnails'|@translate}">
137        <div class="thumbHover">{'Last Page'|@translate}<br><br>{'Go back to the album'|@translate}</div>
138      </a>
139    {/if}
140  </div>
141</div>
142{/if}
143
144</div>
145
146{if $greydragon.p_pict_tab_mode !== "hide" && $overlay_mode == "on"}
147<div id="image-metadata-ico" {if $DISPLAY_NAV_THUMB}class="nav-thumb-margin"{/if}>
148  <ul class="image-metadata-ico">
149    {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}
150    <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>
151    {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}
152    {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}<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>{/if}
153    {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}
154    {if isset($ppppp_e_mail)}<li class="meta-cart{if $ico_mode=="on"} glyphicon glyphicon-shopping-cart{/if}{if $def_tab == 'cart'} active{/if}" >{if $ico_mode=="off"}{'Cart'|@translate}{/if}</li>{/if}
155  </ul>
156</div>
157{/if}
158
159</div>
160
161{assign var=def_tab value="{$greydragon.p_pict_tab_default}"}
162{if !isset($metadata) && $def_tab == 'exif'}{$def_tab="desc"}{/if}
163{if !isset($COMMENT_COUNT) && $def_tab == 'comments'}{$def_tab="desc"}{/if}
164{if !isset( $COMMENT_IMG ) && $def_tab == 'desc'}{$def_tab="info"}{/if}
165{if $greydragon.p_pict_tab_mode !== "hide" && $overlay_mode == "off"}
166<ul class="image-metadata"> 
167  {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}
168  <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>
169  {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}
170  {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}<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>{/if}
171  {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}
172  {if isset($ppppp_e_mail)}<li class="{if $ico_mode=="on"}glyphicon glyphicon-shopping-cart{/if}{if $def_tab == 'cart'} active{/if}" rel="tab-cart">{if $ico_mode=="off"}{'Cart'|@translate}{/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  {if ($display_info.tags && (isset($related_tags) || ($greydragon.hasUserTags)))}
322  <div id="tab-tags" class="image-metadata-tab">
323    {if ($greydragon.hasUserTags)}<table id="TagsTable"><tr id="Tags" ><td class="label"></td><td class="value">{/if}
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    {if ($greydragon.hasUserTags)}</td></tr></table>{/if}
326  </div>
327  {/if}
328
329  {if isset($COMMENT_COUNT)}
330  <div id="tab-comment" class="image-metadata-tab">
331    <div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}>
332      <div id="pictureComments">
333        {if isset($comment_add)}
334        <div id="commentAdd">
335          <h4>{'Add a comment'|@translate}</h4>
336          <form method="post" action="{$comment_add.F_ACTION}" id="addComment">
337            {if $comment_add.SHOW_AUTHOR}
338            <p><label for="author">{'Author'|@translate}{if $comment_add.AUTHOR_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
339            <p><input type="text" name="author" id="author" value="{$comment_add.AUTHOR}"></p>
340            {/if}
341            {if $comment_add.SHOW_EMAIL}
342            <p><label for="email">{'Email address'|@translate}{if $comment_add.EMAIL_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
343            <p><input type="text" name="email" id="email" value="{$comment_add.EMAIL}"></p>
344            {/if}
345            <p><label for="website_url">{'Website'|@translate} :</label></p>
346            <p><input type="text" name="website_url" id="website_url" value="{$comment_add.WEBSITE_URL}"></p>
347            <p><label for="contentid">{'Comment'|@translate} ({'mandatory'|@translate}) :</label></p>
348            <p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
349            <p><input type="hidden" name="key" value="{$comment_add.KEY}">
350            <input type="submit" value="{'Submit'|@translate}"></p>
351          </form>
352        </div>
353        {else}
354          {if ($COMMENT_COUNT == 0)}<p>{'No Comments Allowed'|@translate}</p>{/if}
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
374  {if isset($ppppp_e_mail)}
375  <div id="tab-cart" class="image-metadata-tab">
376    {if isset($COMMENT_IMG)}
377    {/if}
378  </div>
379  {/if}
380</div>
381{/if}
382</div>
383{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
Note: See TracBrowser for help on using the repository browser.