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

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