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

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