source: extensions/gally/gally-black-graphite/template/picture.tpl @ 12602

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

feature:2499 - compatibility with Piwigo 2.3

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