source: extensions/PwgCarbon_dft/template/picture.tpl @ 28566

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