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

Revision 13489, 12.2 KB checked in by rvelices, 8 years ago (diff)

added event for src image url
simplify js in picture.tpl
action.php fix history saving

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