source: extensions/Slim/template/picture.tpl @ 18811

Last change on this file since 18811 was 18811, checked in by Miklfe, 11 years ago
File size: 13.2 KB
Line 
1{* Example of resizeable *}
2{*
3{include file='include/autosize.inc.tpl'}
4*}
5
6
7{if isset($MENUBAR)}{$MENUBAR}{/if}
8<div id="content" {if isset($MENUBAR)}class="contentWithMenu"{/if}>
9
10{if isset($errors)}
11<div class="errors">
12  <ul>
13    {foreach from=$errors item=error}
14    <li>{$error}</li>
15    {/foreach}
16  </ul>
17</div>
18{/if}
19
20
21
22{if isset($infos)}
23<div class="infos">
24  <ul>
25    {foreach from=$infos item=info}
26    <li>{$info}</li>
27    {/foreach}
28  </ul>
29</div>
30{/if}
31
32{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
33
34<div id="imageHeaderBar">
35  <div class="browsePath">
36  <h2>
37    {$SECTION_TITLE}
38    {$LEVEL_SEPARATOR}{$current.TITLE}
39</h2>
40  </div>
41  <div class="imageNumber"> &nbsp{$PHOTO}</div>
42
43</div>
44
45
46
47<div id="theImage">
48
49
50        <div id="imgContainer">
51
52{$ELEMENT_CONTENT}
53       
54
55        {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
56       
57        {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
58
59</div>
60       
61{if isset($COMMENT_COUNT)}
62<div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}><div id="commentsSwitcher"></div>
63        <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
64
65        <div id="pictureComments">
66                {if isset($comment_add)}
67                <div id="commentAdd">
68                        <h4>{'Add a comment'|@translate}</h4>
69                        <form method="post" action="{$comment_add.F_ACTION}" id="addComment">
70                                {if $comment_add.SHOW_AUTHOR}
71                                        <p><label for="author">{'Author'|@translate} :</label></p>
72                                        <p><input type="text" name="author" id="author" value="{$comment_add.AUTHOR}"></p>
73                                        <p><label for="contentid">{'Comment'|@translate} :</label></p>
74                                {/if}
75                                <p><textarea name="content" id="contentid" rows="8" cols="100">{$comment_add.CONTENT}</textarea></p>
76                                <p><input type="hidden" name="key" value="{$comment_add.KEY}">
77                                        <input type="submit" value="{'Submit'|@translate}"></p>
78                        </form>
79                </div>
80                {/if}
81                {if isset($comments)}
82                <div id="pictureCommentList">
83                        {if (($COMMENT_COUNT > 2) || !empty($navbar))}
84                                <div id="pictureCommentNavBar">
85                                        {if $COMMENT_COUNT > 2}
86                                                <a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
87                                        {/if}
88                                        {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
89                                </div>
90                        {/if}
91                        {include file='comment_list.tpl'}
92                </div>
93                {/if}
94                <div style="clear:both"></div>
95        </div>
96
97</div>
98{/if}{*comments*}
99
100
101<!--slideshow-->
102{if isset($U_SLIDESHOW_STOP) }
103<p>
104  [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
105</p>
106{/if}
107
108
109
110
111
112
113
114
115<div class="panel">
116
117<div id="imageToolBar">
118<div class="actionButtons">
119{if count($current.unique_derivatives)>1}
120{footer_script require='jquery'}{literal}
121function changeImgSrc(url,typeSave,typeMap)
122{
123        var theImg = document.getElementById("theMainImage");
124        if (theImg)
125        {
126                theImg.removeAttribute("width");theImg.removeAttribute("height");
127                theImg.src = url;
128                theImg.useMap = "#map"+typeMap;
129        }
130        jQuery('#derivativeSwitchBox .switchCheck').css('visibility','hidden');
131        jQuery('#derivativeChecked'+typeSave).css('visibility','visible');
132        document.cookie = 'picture_deriv='+typeSave+';path={/literal}{$COOKIE_PATH}{literal}';
133}
134jQuery("#derivativeSwitchLink").click(function() {
135        var elt = jQuery("#derivativeSwitchBox");
136        elt.css("left", Math.min( jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5))
137                .toggle();
138});
139jQuery("#derivativeSwitchBox").on("mouseleave click", function() {
140        jQuery(this).hide();
141});
142{/literal}{/footer_script}
143{strip}<a id="derivativeSwitchLink" title="{'Photo sizes'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
144  <span class="pwg-icon pwg-icon-sizes">&nbsp;</span><span class="pwg-button-text">{'Photo sizes'|@translate}</span>
145</a>
146<div id="derivativeSwitchBox" class="switchBox">
147  <div class="switchBoxTitle">{'Photo sizes'|@translate}</div>
148  {foreach from=$current.unique_derivatives item=derivative key=derivative_type}
149  <span class="switchCheck" id="derivativeChecked{$derivative_type}"{if $derivative->get_type() ne $current.selected_derivative->get_type()} style="visibility:hidden"{/if}>&#x2714; </span>
150  <a href="javascript:changeImgSrc('{$derivative->get_url()|@escape:javascript}','{$derivative_type}','{$derivative->get_type()}')">
151    {$derivative->get_type()|@translate}<span class="derivativeSizeDetails"> ({$derivative->get_size_hr()})</span>
152  </a><br>
153  {/foreach}
154  {if isset($U_ORIGINAL)}
155  <a href="javascript:phpWGOpenWindow('{$U_ORIGINAL}','xxx','scrollbars=yes,toolbar=no,status=no,resizable=yes')" rel="nofollow">{'Original'|@translate}</a>
156  {/if}
157</div>
158{/strip}
159{/if}
160{strip}{if isset($U_SLIDESHOW_START)}
161        <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
162                <span class="pwg-icon pwg-icon-slideshow"> </span><span class="pwg-button-text">{'slideshow'|@translate}</span>
163        </a>
164{/if}{/strip}
165{strip}{if isset($U_METADATA)}
166        <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
167                <span class="pwg-icon pwg-icon-camera-info"> </span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
168        </a>
169{/if}{/strip}
170{strip}{if isset($current.U_DOWNLOAD)}
171        <a href="{$current.U_DOWNLOAD}" title="{'Download this file'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
172                <span class="pwg-icon pwg-icon-save"> </span><span class="pwg-button-text">{'Download'|@translate}</span>
173        </a>
174{/if}{/strip}
175{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
176{strip}{if isset($favorite)}
177        <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">
178                <span class="pwg-icon pwg-icon-favorite-{if $favorite.IS_FAVORITE}del{else}add{/if}"> </span><span class="pwg-button-text">{'Favorites'|@translate}</span>
179        </a>
180{/if}{/strip}
181{strip}{if isset($U_SET_AS_REPRESENTATIVE)}
182        <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
183                <span class="pwg-icon pwg-icon-representative"> </span><span class="pwg-button-text">{'representative'|@translate}</span>
184        </a>
185{/if}{/strip}
186{strip}{if isset($U_ADMIN)}
187        <a href="{$U_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
188                <span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'Edit'|@translate}</span>
189        </a>
190{/if}{/strip}
191{strip}{if isset($U_CADDIE)}{*caddie management BEGIN*}
192{footer_script}
193{literal}function addToCadie(aElement, rootUrl, id)
194{
195if (aElement.disabled) return;
196aElement.disabled=true;
197var y = new PwgWS(rootUrl);
198y.callService(
199        "pwg.caddie.add", {image_id: id} ,
200        {
201                onFailure: function(num, text) { alert(num + " " + text); document.location=aElement.href; },
202                onSuccess: function(result) { aElement.disabled = false; }
203        }
204        );
205}{/literal}
206{/footer_script}
207        <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">
208                <span class="pwg-icon pwg-icon-caddie-add"> </span><span class="pwg-button-text">{'Caddie'|@translate}</span>
209        </a>
210{/if}{/strip}{*caddie management END*}
211</div>
212</div>{*<!-- imageToolBar -->*}
213
214
215<table id="standard" class="infoTable" summary="{'Some info about this picture'|@translate}">
216{if $display_info.author}
217  <tr>
218    <td class="label">{'Author'|@translate}</td>
219    <td class="value">{if isset($INFO_AUTHOR)}{$INFO_AUTHOR}{else}{'N/A'|@translate}{/if}</td>
220{/if}
221{if $display_info.created_on}
222    <td class="label">{'Created on'|@translate}</td>
223    <td class="value">{if isset($INFO_CREATION_DATE)}{$INFO_CREATION_DATE}{else}{'N/A'|@translate}{/if}</td>
224  </tr>
225{/if}
226 
227{if $display_info.posted_on}
228  <tr >
229    <td class="label">{'Posted on'|@translate}</td>
230    <td class="value">{$INFO_POSTED_DATE}</td>
231{/if}
232{if $display_info.dimensions}
233    <td class="label">{'Dimensions'|@translate}</td>
234    <td class="value">{if isset($INFO_DIMENSIONS)}{$INFO_DIMENSIONS}{else}{'N/A'|@translate}{/if}</td>
235  </tr>
236{/if}
237
238{if $display_info.file}
239  <tr>
240    <td class="label">{'File'|@translate}</td>
241    <td class="value">{$INFO_FILE}</td>
242{/if}
243{if $display_info.filesize}
244    <td class="label">{'Filesize'|@translate}</td>
245    <td class="value">{if isset($INFO_FILESIZE)}{$INFO_FILESIZE}{else}{'N/A'|@translate}{/if}</td>
246  </tr>
247{/if}
248 
249{if $display_info.tags}
250  <tr>
251    <td class="label">{'Tags'|@translate}</td>
252    <td class="value">
253      {if isset($related_tags)}
254        {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}
255        <a href="{$tag.URL}">{$tag.name}</a>{/foreach}
256      {/if}
257    </td>
258{/if}
259{if $display_info.categories}
260    <td class="label">{'Categories'|@translate}</td>
261    <td class="value">
262      {if isset($related_categories)}
263      <ul>
264        {foreach from=$related_categories item=cat}
265        <li>{$cat}</li>
266        {/foreach}
267      </ul>
268      {/if}
269    </td>
270  </tr>
271{/if}
272 
273{if $display_info.visits}
274  <tr>
275    <td class="label">{'Visits'|@translate}</td>
276    <td class="value">{$INFO_VISITS}</td>
277 
278{/if}
279
280{if $display_info.rating_score and isset($rate_summary)}
281       
282                <td class="label">{'Rating score'|@translate}</td>
283                <td class="value" id="ratingSummary">
284                {if $rate_summary.count}
285                        {$rate_summary.score}({assign var='rate_text' value='%d rates'|@translate}{$pwg->sprintf($rate_text, $rate_summary.count)})
286                        {else}
287                        {'no rate'|@translate}
288                {/if}
289                </td>
290        </tr>
291{/if}
292<tr height="24px">
293{if isset($rating)}
294                <td colspan="2" class="label" >
295                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
296                </td>
297                <td colspan="2" class="value">
298                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
299                        <div>&nbsp;
300                        {foreach from=$rating.marks item=mark name=rate_loop}
301                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
302                          <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
303                        {else}
304                          <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
305                        {/if}
306                        {/foreach}
307                        {strip}{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
308                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
309                        {footer_script}
310                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
311                                _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
312                                        onSuccess : function(rating) {ldelim}
313                                                var e = document.getElementById("updateRate");
314                                                if (e) e.innerHTML = "{'Update your rating'|@translate|@escape:'javascript'}";
315                                                e = document.getElementById("ratingScore");
316                                                if (e) e.innerHTML = rating.score;
317                                                e = document.getElementById("ratingCount");
318                                                if (e) e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
319                                        {rdelim}{rdelim} );
320                        {/footer_script}
321                        {/strip}
322                        </div>
323                        </form>
324                </td>
325        </tr>
326{/if}
327
328{if $display_info.privacy_level and isset($available_permission_levels) }
329        <tr id="Privacy">
330                <td colspan="2" class="label">{'Who can see this photo?'|@translate}</td>
331                <td colspan="2" class="value">
332<script type="text/javascript">
333{literal}function setPrivacyLevel(selectElement, rootUrl, id, level)
334{
335selectElement.disabled = true;
336var y = new PwgWS(rootUrl);
337y.callService(
338        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
339        {
340                method: "POST",
341                onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
342                onSuccess: function(result) { selectElement.disabled = false; }
343        }
344        );
345}{/literal}
346</script>
347        <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)">
348                {foreach from=$available_permission_levels item=label key=level}
349                <option label="{$label}" value="{$level}"{if $level == $current.level} selected="selected"{/if}>{$label}</option>
350                {/foreach}
351        </select>
352        </td></tr>
353{/if}
354
355</table>
356
357{if isset($metadata)}
358<table id="Metadata" class="infoTable2" summary="{'Some more (technical) info about this picture'|@translate}">
359{foreach from=$metadata item=meta}
360  <tr>
361    <th colspan="2">{$meta.TITLE}</th>
362  </tr>
363  {foreach from=$meta.lines item=value key=label}
364  <tr>
365    <td class="label">{$label}</td>
366    <td class="value">{$value}</td>
367  </tr>
368  {/foreach}
369{/foreach}
370</table>
371{/if}
372
373</div> <!-- PANEL -->
374<a class="trigger" href="#">infos</a>
375
376{footer_script}{literal}
377$(document).ready(function(){
378        $(".trigger").click(function(){
379                $(".panel").toggle("fast");
380                $(this).toggleClass("active");
381                return false;
382        });
383});
384{/literal}{/footer_script}
385
386</div>{*image*}
387
388
389
390{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
391
392
393
394</div>
Note: See TracBrowser for help on using the repository browser.