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

Last change on this file since 21039 was 21039, checked in by rvelices, 11 years ago

on picture.php replace U_ADMIN url with U_PHOTO_ADMIN url to avoid being overriden by menubar and having to redefine it (U_ADMIN still there for 2.5 version for backward compatibility)

  • Property svn:eol-style set to LF
File size: 14.7 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_PHOTO_ADMIN)}
91        <a href="{$U_PHOTO_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"></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"></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) {ldelim}
262                                                                e.innerHTML = "({'%d rate'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
263                                                        } else {ldelim}
264                                                                e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
265              }
266                                                {rdelim}
267                                        {rdelim}{rdelim} );
268                        {/footer_script}
269                        {/strip}
270                        </div>
271                        </form>
272                </dd>
273        </div>
274{/if}
275
276{if $display_info.privacy_level and isset($available_permission_levels)}
277        <div id="Privacy" class="imageInfo"><div class="relSwitchBox">
278                <dt><a id="privacyLevelLink" href="javascript:togglePrivacyLevelBox()">{'Who can see this photo?'|@translate}</a></dt>
279                <dd>
280{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
281{footer_script require='jquery'}
282{literal}function setPrivacyLevel(rootUrl, id, level)
283{
284var y = new PwgWS(rootUrl);
285y.callService(
286        "pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
287        {
288                method: "POST",
289                onFailure: function(num, text) { alert(num + " " + text); },
290                onSuccess: function(result) {
291                          jQuery('#privacyLevelBox .switchCheck').css('visibility','hidden');
292                          jQuery('#levelCheck'+level).css('visibility','visible');
293                }
294        }
295        );
296}
297function togglePrivacyLevelBox()
298{
299        var elt = document.getElementById("privacyLevelBox"),
300                ePos = document.getElementById("privacyLevelLink");
301        if (elt.style.display == "none")
302        {
303                elt.style.left = (ePos.offsetLeft)+"px";
304                elt.style.top = (ePos.offsetTop+ePos.offsetHeight)+"px";
305                elt.style.display="block";
306        }
307        else
308                elt.style.display="none";
309}
310{/literal}
311{/footer_script}
312
313                        <div id="privacyLevelBox" class="switchBox" onclick="togglePrivacyLevelBox()" style="display:none" onmouseout="e=event.toElement||event.relatedTarget;e.parentNode==this||e==this||togglePrivacyLevelBox()">
314                                {foreach from=$available_permission_levels item=label key=level}
315                                        <span id="levelCheck{$level}" class="switchCheck" {if $level != $current.level} style="visibility:hidden"{/if}>&#x2714; </span>
316                                        <a id="switchLevel{$level}" href="javascript:setPrivacyLevel('{$ROOT_URL}', {$current.id}, {$level})">{$label}</a><br>
317                                {/foreach}
318                        </div>
319
320                </dd>
321        </div></div>
322{/if}
323{/strip}
324</dl>
325
326{if isset($metadata)}
327<dl id="Metadata" class="imageInfoTable">
328{foreach from=$metadata item=meta}
329        <h3>{$meta.TITLE}</h3>
330        {foreach from=$meta.lines item=value key=label}
331                <div class="imageInfo">
332                        <dt>{$label}</dt>
333                        <dd>{$value}</dd>
334                </div>
335        {/foreach}
336{/foreach}
337</dl>
338{/if}
339</div>
340</div>
341
342{if isset($COMMENT_COUNT)}
343<div id="comments" {if (!isset($comment_add) && ($COMMENT_COUNT == 0))}class="noCommentContent"{else}class="commentContent"{/if}><div id="commentsSwitcher"></div>
344        <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
345
346        <div id="pictureComments">
347                {if isset($comment_add)}
348                <div id="commentAdd">
349                        <h4>{'Add a comment'|@translate}</h4>
350                        <form method="post" action="{$comment_add.F_ACTION}" id="addComment">
351                                {if $comment_add.SHOW_AUTHOR}
352                                        <p><label for="author">{'Author'|@translate}{if $comment_add.AUTHOR_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
353                                        <p><input type="text" name="author" id="author" value="{$comment_add.AUTHOR}"></p>
354                                {/if}
355                                {if $comment_add.SHOW_EMAIL}
356                                        <p><label for="email">{'Email'|@translate}{if $comment_add.EMAIL_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
357                                        <p><input type="text" name="email" id="email" value="{$comment_add.EMAIL}"></p>
358                                {/if}
359                                <p><label for="website_url">{'Website'|@translate} :</label></p>
360                                <p><input type="text" name="website_url" id="website_url" value="{$comment_add.WEBSITE_URL}"></p>
361                                <p><label for="contentid">{'Comment'|@translate} ({'mandatory'|@translate}) :</label></p>
362                                <p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
363                                <p><input type="hidden" name="key" value="{$comment_add.KEY}">
364                                        <input type="submit" value="{'Submit'|@translate}"></p>
365                        </form>
366                </div>
367                {/if}
368                {if isset($comments)}
369                <div id="pictureCommentList">
370                        {if (($COMMENT_COUNT > 2) || !empty($navbar))}
371                                <div id="pictureCommentNavBar">
372                                        {if $COMMENT_COUNT > 2}
373                                                <a href="{$COMMENTS_ORDER_URL}#comments" rel="nofollow" class="commentsOrder">{$COMMENTS_ORDER_TITLE}</a>
374                                        {/if}
375                                        {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
376                                </div>
377                        {/if}
378                        {include file='comment_list.tpl'}
379                </div>
380                {/if}
381                <div style="clear:both"></div>
382        </div>
383
384</div>
385{/if}{*comments*}
386
387{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
388
389</div>
Note: See TracBrowser for help on using the repository browser.