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

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