source: trunk/themes/default/template/picture.tpl @ 13736

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