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

Last change on this file since 17979 was 17979, checked in by plg, 12 years ago

merge r17978 from branch 2.4 to trunk

bug 2748 fixed: make sure scripts.js is loaded when we need phpWGOpenWindow

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