source: extensions/gally/gally-default/template/picture.tpl @ 16016

Last change on this file since 16016 was 16016, checked in by grum, 12 years ago

feature:2664- compatibility with Piwigo 2.4

  • Property svn:executable set to *
File size: 18.2 KB
Line 
1<!-- **GBL** >PICTURE> -->
2
3{include file='infos_errors.tpl'}
4
5<div id="content" {if isset($MENUBAR)}class="pictureContent"{/if}>
6
7  <div id="theImageHigh" style="display:none;">
8    <div id="theImgHighBg"></div>
9    <div id="theImgHighContainer">
10      <div id="theImgHighCloseButton" onclick="gallyPP.closeDisplayHigh();"></div>
11      <div id="theImgHighZoomButton" class="fit" onclick="gallyPP.switchZoomHigh();"></div>
12      <div id="theImgHighContainer2">
13        <img id="theImgHigh" src="" style="display:none;" alt="{$ALT_IMG}">
14      </div>
15    </div>
16  </div>
17
18{if isset($MENUBAR)}
19  <div id="imageHeaderBar" class="menu">
20    <div class="titrePage" id='titrePageID'>
21      {if #menuAnimated# == "noswitch"}
22          {$MENUBAR}
23      {else}
24        <div id="menuswitcher">
25          <a id="icon_menu" class="button" onclick="gallyCP.switchmenu('', '{$ROOT_URL}{$themeconf.icon_dir}/');">&nbsp;
26          </a>
27        </div>
28        {$MENUBAR}
29      {/if}
30    </div>
31{else}
32  <div id="imageHeaderBar">
33{/if}
34
35
36
37    <div class="browsePath">
38      <h2>
39      [ {$SECTION_TITLE}{$LEVEL_SEPARATOR}{$current.TITLE} ]
40      </h2>
41    </div>
42    <div class="imageNumber">{$PHOTO}</div>
43    <h2>&nbsp;</h2>
44  </div>
45
46  {if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
47
48  {if $DISPLAY_NAV_THUMB}
49    {if isset($previous) }
50    <div id="navThumbPrev">
51      <table id="navThumbPrevContainer" class="uiImg"><tr><td>
52        <div class="navThumbPrevBg">&nbsp;</div>
53        <div class="navThumbPrevContent">
54          <a class="navThumb" id="thumbPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev">
55            <img src="{$previous.derivatives.square->get_url()}" class="thumbLink" id="linkPrev" alt="{$previous.TITLE}">
56          </a>
57        </div>
58      </td></tr></table>
59    </div> <!-- navThumbPrev -->
60    {/if}
61
62    {if isset($next) }
63    <div id="navThumbNext">
64      <table id="navThumbNextContainer" class="uiImg"><tr><td>
65        <div class="navThumbNextBg">&nbsp;</div>
66        <div class="navThumbNextContent">
67          <a class="navThumb" id="thumbNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE}" rel="next">
68            <img src="{$next.derivatives.square->get_url()}" class="thumbLink" id="linkNext" alt="{$next.TITLE}">
69          </a>
70        </div>
71      </td></tr></table>
72    </div> <!-- navThumbNext -->
73    {/if}
74  {/if}
75
76  <div id="imageToolBar">
77        <div id="imageToolBarContainer" class="uiImg">
78        <div class="imageToolBarBg">&nbsp;</div>
79
80        {if count($current.unique_derivatives)>1}
81        <div id="derivativeSwitchBox" class="switchBox">
82        <div class="switchBoxTitle">{'Photo sizes'|@translate}</div>
83        {foreach from=$current.unique_derivatives item=derivative key=derivative_type}
84        <span class="switchCheck" id="derivativeChecked{$derivative_type}"{if $derivative->get_type() ne $current.selected_derivative->get_type()} style="visibility:hidden"{/if}>&#x2714; </span>
85        <a onclick="gallyPP.changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}', '{$COOKIE_PATH}')">
86          {$derivative->get_type()|@translate}<span class="derivativeSizeDetails"> ({$derivative->get_size_hr()})</span>
87        </a><br>
88        {/foreach}
89        {if isset($U_ORIGINAL)}
90        <span class="switchCheck" style="visibility:hidden">&#x2714; </span><a onclick="gallyPP.openDisplayHigh('{$U_ORIGINAL}');">{'Original'|@translate}</a>
91        {/if}
92        </div>
93        {/if}
94
95        <div class="randomButtons">
96
97          {if count($current.unique_derivatives)>1}
98            <a id="icon_derivatives" title="{'Photo sizes'|@translate}" rel="nofollow" class="button" ></a>
99          {/if}
100
101          {if isset($U_SLIDESHOW_START)}
102            <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" rel="nofollow" id="icon_start_slideshow" class="button" ></a>
103          {/if}
104
105          {if isset($U_METADATA)}
106            <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" rel="nofollow" id="icon_metadata" class="button" ></a>
107          {/if}
108
109          {if isset($current.U_DOWNLOAD)}
110            <a href="{$current.U_DOWNLOAD}" title="{'Download this file'|@translate}" id="icon_save" class="button" ></a>
111          {/if}
112
113          {if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
114
115          {if isset($favorite)}
116            <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}" id="icon_{if $favorite.IS_FAVORITE}del_{/if}favorite" class="button"></a>
117          {/if}
118          {if isset($U_SET_AS_REPRESENTATIVE)}
119            <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" id="icon_representative" class="button" ></a>
120          {/if}
121          {if isset($U_ADMIN)}
122            <a href="{$U_ADMIN}" title="{'Modify information'|@translate}" id="icon_preferences" class="button"></a>
123          {/if}
124          {if isset($U_CADDIE) }{*caddie management BEGIN*}
125          {footer_script}
126          {literal}function addToCadie(aElement, rootUrl, id)
127          {
128            if (aElement.disabled) return;
129            aElement.disabled=true;
130            var y = new PwgWS(rootUrl);
131            y.callService(
132              "pwg.caddie.add", {image_id: id} ,
133              {
134                onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; },
135                onSuccess: function(result) { aElement.disabled = false; }
136              }
137            );
138          }{/literal}
139          {/footer_script}
140          <a onclick="addToCadie(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}); return false;" title="{'Add to caddie'|@translate}" id="icon_caddie" class="button"></a>
141          {/if}{*caddie management END*}
142          {footer_script}
143            $('div.randomButtons a.button').addClass('sTipOnTop');
144          {/footer_script}
145        </div>
146
147        {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
148
149    </div>
150  </div>{*<!-- imageToolBar -->*}
151
152  <div id="theImage">
153    {$ELEMENT_CONTENT}
154
155    {if isset($COMMENT_IMG)}
156    <p class="imageComment">{$COMMENT_IMG}</p>
157    {else}
158    <p>&nbsp;</p>
159    {/if}
160    {if isset($U_SLIDESHOW_STOP)}
161    <p>
162      [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
163    </p>
164    {/if}
165  </div> <!-- theImage -->
166
167  <div id="theTabsContainer">
168  <div id="theTabs" class="uiImg">
169    {assign var='display_info_panel' value=false}
170    {foreach from=$display_info item=displayitem}
171      {if $displayitem}
172        {assign var='display_info_panel' value=true}
173      {/if}
174    {/foreach}
175
176    <ul id="theTabsheets">
177      {if $display_info_panel}
178        <li class="tab" id="tabImageInfos"><a href="#imageInfos">{'Informations'|@translate}</a></li>
179      {/if}
180
181      {if isset($metadata)}
182        {foreach from=$metadata item=meta key=id}
183          <li class="tab" id="tabImageMeta{$id}"><a href="#imageMeta{$id}">{$meta.TITLE|@translate}</a></li>
184        {/foreach}
185      {/if}
186
187      {if (isset($COMMENT_COUNT) and ($COMMENT_COUNT>0)) or isset($comment_add) }
188        <li class="tab" id="tabTheComment">
189          <a href="#theComments">{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</a>
190        </li>
191      {/if}
192
193    </ul>
194
195    <div id="theTabsBg"></div>
196
197
198
199    {if $display_info_panel}
200      <div id="imageInfos" class="tabPanel">
201        <div id="imageInfosContainer">
202        <div class="imageInfosBg">&nbsp;</div>
203
204          <table class="infoTable">
205            <tr  class="emptyrow" style="line-height:0px;">
206              <td colspan="2">&nbsp;</td>
207              <td class='cTitle'>&nbsp;</td>
208              <td class='cNfo' >&nbsp;</td>
209              <td class='cTitle'>&nbsp;</td>
210              <td class='cNfo' >&nbsp;</td>
211            </tr>
212
213            {if $display_info.author or $display_info.created_on or $display_info.posted_on}
214            <tr>
215              {assign var='colspan' value=6}
216              {if $display_info.author}
217                {assign var='colspan' value=`$colspan-2`}
218                <td class="label">{'Author'|@translate}</td>
219                <td class="value" style="min-width:214px;">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
220              {/if}
221
222              {if $display_info.created_on}
223                {assign var='colspan' value=`$colspan-2`}
224                <td class="label">{'Created on'|@translate}</td>
225                <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
226              {/if}
227
228              {if $display_info.posted_on}
229                {assign var='colspan' value=`$colspan-2`}
230                <td class="label">{'Posted on'|@translate}</td>
231                <td class="value">{$INFO_POSTED_DATE}</td>
232              {/if}
233
234              {if $colspan!=0}
235                <td colspan="{$colspan}">&nbsp;</td>
236              {/if}
237
238            </tr>
239            {/if}
240
241            {if $display_info.dimensions or $display_info.file or $display_info.filesize}
242            <tr>
243              {assign var='colspan' value=6}
244
245              {if $display_info.dimensions}
246                {assign var='colspan' value=`$colspan-2`}
247                <td class="label">{'Dimensions'|@translate}</td>
248                <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS|@replace:"*":"x"}{else}{'N/A'|@translate}{/if}</td>
249              {/if}
250
251              {if $display_info.file}
252                {assign var='colspan' value=`$colspan-2`}
253                <td class="label">{'File'|@translate}</td>
254                <td class="value">{$INFO_FILE}</td>
255              {/if}
256
257              {if $display_info.filesize}
258                {assign var='colspan' value=`$colspan-2`}
259                <td class="label">{'Filesize'|@translate}</td>
260                <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
261              {/if}
262
263              {if $colspan!=0}
264                <td colspan="{$colspan}">&nbsp;</td>
265              {/if}
266            </tr>
267            {/if}
268
269            {if isset($related_tags) and $display_info.tags}
270              <tr class="emptyrow"><td colspan="6">&nbsp;</td></tr>
271              <tr id="infoTags">
272                <td class="label">{'Tags'|@translate}</td>
273                <td colspan="5" class="value">
274                    {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}
275                    <a href="{$tag.URL}">{$tag.name}</a>{/foreach}
276                </td>
277              </tr>
278            {/if}
279
280            {if isset($related_categories) and $display_info.categories}
281              <tr class="emptyrow"><td colspan="6">&nbsp;</td></tr>
282              <tr id="infoCats">
283                <td class="label">{'Albums'|@translate}</td>
284                <td colspan="5" class="value">
285                  {foreach from=$related_categories item=cat name=tag_loop}{if !$smarty.foreach.tag_loop.first},&nbsp;{/if}
286                  {$cat}
287                  {/foreach}
288                </td>
289              </tr>
290            {/if}
291            {if $display_info.visits}
292              <tr class="emptyrow"><td colspan="6">&nbsp;</td><tr>
293              <tr>
294                <td class="label">{'Visits'|@translate}</td>
295                <td {if !($display_info.privacy_level and isset($available_permission_levels))}colspan="5"{/if} class="value">{$INFO_VISITS}</td>
296
297                  {if $display_info.privacy_level and isset($available_permission_levels)}
298                      <td colspan="4" class="label"><a id="iPrivacyLevelLink">{'Who can see this photo?'|@translate}</a>
299
300                        <div id="privacyLevelBox" class="switchBox">
301                          {foreach from=$available_permission_levels item=label key=level}
302                          <span id="levelCheck{$level}" class="switchCheck" {if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
303                          <a id="switchLevel{$level}" onclick="gallyPP.setPrivacyLevel('{$ROOT_URL}', {$current.id}, {$level})">{$label}</a><br>
304                          {/foreach}
305                        </div>
306                     </td>
307                  {/if}
308
309              </tr>
310            {/if}
311
312            {if (isset($rate_summary) or isset($rating)) and  $display_info.rating_score}
313              <tr id="rating">
314                {if isset($rate_summary)}
315                  <td class="label">{'Rating score'|@translate}</td>
316                  <td class="value">
317                  {if $rate_summary.count}
318                    <span id="ratingScore">{$rate_summary.score}</span>
319                    <span id="ratingCount">({assign var='rate_text' value='%d rates'|@translate}{$pwg->sprintf($rate_text, $rate_summary.count)})</span>
320                  {else}
321                    <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
322                  {/if}
323                  </td>
324                {else}
325                  <td colspan="2">&nbsp;</td>
326                {/if}
327
328                {if isset($rating)}
329                  <td class="label" colspan="4">
330                    <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
331
332                    <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
333                      <div>&nbsp;
334                      {foreach from=$rating.marks item=mark name=rate_loop}
335                        {if !$smarty.foreach.rate_loop.first} | {/if}
336
337                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
338                          <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}" />
339                        {else}
340                          <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}" />
341                        {/if}
342
343                      {/foreach}
344
345                      {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
346                      {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
347
348
349                      {footer_script}
350                        var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
351                        _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
352                          onSuccess : function(rating) {ldelim}
353                            var e = document.getElementById("updateRate");
354                            if (e) e.innerHTML = "{'Update your rating'|@translate|@escape:'javascript'}";
355                            e = document.getElementById("ratingScore");
356                            if (e) e.innerHTML = rating.score;
357                            e = document.getElementById("ratingCount");
358                            if (e) e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
359                          {rdelim}{rdelim} );
360                      {/footer_script}
361
362                      </div>
363                    </form>
364                  </td>
365                {else}
366                  <td colspan="4">&nbsp;</td>
367                {/if}
368            </tr>
369          {/if}
370
371          </table>
372
373        </div>
374      </div> <!-- imageInfos -->
375    {/if}
376
377    {if isset($metadata)}
378    {foreach from=$metadata item=meta key=id}
379    <div id="imageMeta{$id}" class="imageMeta tabPanel">
380      <div id="imageMetaContainer{$id}">
381        <div class="imageMetaBg">&nbsp;</div>
382
383        {if count($meta.lines)>0 and !array_key_exists('<!--rawContent-->', $meta.lines)}
384          <table id="displaymeta{$id}" class="displaymeta infoTable">
385            {foreach from=$meta.lines item=value key=label name=metaloop}
386              {if ($smarty.foreach.metaloop.iteration-1) % #metaNumCols# == 0}
387                {if !$smarty.foreach.metaloop.first}</tr>{/if}
388                {if !$smarty.foreach.metaloop.last}<tr>{/if}
389              {/if}
390              <td class="label">{$label|@translate}</td>
391              <td class="value">{$value}</td>
392            {/foreach}
393          </table>
394        {else}
395          {assign var='empty' value='<!--rawContent-->'}
396          {$meta.lines.$empty}
397        {/if}
398      </div>
399    </div> <!-- imageMeta -->
400    {/foreach}
401    {/if}
402
403
404    {if (isset($COMMENT_COUNT) and ($COMMENT_COUNT>0)) or isset($comment_add) }
405    <div id="theComments" class="tabPanel">
406      <div id='theCommentBG'>&nbsp;</div>
407
408      {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
409
410      {if isset($comment_add) or isset($comments)}
411      <table id="theCommentContainer">
412        <tr style="vertical-align:top;">
413          {if isset($comment_add)}
414          {if isset($comments)}
415          <td width="50%">
416          {else}
417          <td>
418          {/if}
419            <h4>{'Add a comment'|@translate}</h4>
420            <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
421              <table>
422                {if $comment_add.SHOW_AUTHOR}
423                <tr>
424                  <td>{'Author'|@translate}</td>
425                  <td><input type="text" name="author"></td>
426                </tr>
427                {/if}
428                <tr>
429                  <td {if $comment_add.SHOW_AUTHOR}colspan="2"{/if}><textarea name="content" id="contentid" rows="7" cols="80">{$comment_add.CONTENT}</textarea></td>
430                </tr>
431                <tr>
432                  <td {if $comment_add.SHOW_AUTHOR}colspan="2"{/if}>
433                    <input type="hidden" name="key" value="{$comment_add.KEY}">
434                    <input class="submit" type="submit" value="{'Submit'|@translate}">
435                  </td>
436                </tr>
437              </table>
438            </form>
439          </td>
440          {/if}
441
442          {if isset($comments)}
443          {if isset($comment_add)}
444          <td width="50%">
445          {else}
446          <td>
447          {/if}
448            <div id="theCommentList">
449              {include file='comment_list.tpl' comment_separator=true}
450            </div>
451          </td>
452          {/if}
453
454        </tr>
455      </table>
456      {/if}
457    </div>
458    {/if} {*comments*}
459
460  </div><!-- theTabs -->
461  </div>
462
463  {if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
464
465</div>
466
467<!-- **GBL** <PICTURE< -->
468
Note: See TracBrowser for help on using the repository browser.