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

Last change on this file since 13489 was 13489, checked in by rvelices, 12 years ago

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

  • Property svn:eol-style set to LF
File size: 12.2 KB
RevLine 
[8378]1{* Example of resizeable
[2721]2{include file='include/autosize.inc.tpl'}
3*}
[13474]4{if isset($MENUBAR)}{$MENUBAR}{/if}
5<div id="content" {if isset($MENUBAR)}class="contentWithMenu"{/if}>
[13074]6{if isset($errors) or not empty($infos)}
[12764]7{include file='infos_errors.tpl'}
[13074]8{/if}
[2902]9{if !empty($PLUGIN_PICTURE_BEFORE)}{$PLUGIN_PICTURE_BEFORE}{/if}
10
[859]11<div id="imageHeaderBar">
[8378]12        <div class="browsePath">
[13474]13                {$SECTION_TITLE}<span class="browsePathSeparator">{$LEVEL_SEPARATOR}</span><h2>{$current.TITLE}</h2>
[8378]14        </div>
15        <div class="imageNumber">{$PHOTO}</div>
[859]16</div>
17
18<div id="imageToolBar">
[8378]19<div class="actionButtons">
[13474]20
21{if count($current.unique_derivatives)>1}
22{footer_script}{literal}
[13489]23function changeImgSrc(url,typeSave,typeMap)
[13474]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}
[13489]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>
[13474]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
[8757]63{strip}{if isset($U_SLIDESHOW_START)}
[8378]64        <a href="{$U_SLIDESHOW_START}" title="{'slideshow'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]65                <span class="pwg-icon pwg-icon-slideshow"> </span><span class="pwg-button-text">{'slideshow'|@translate}</span>
[8378]66        </a>
[8757]67{/if}{/strip}
68{strip}{if isset($U_METADATA)}
[8378]69        <a href="{$U_METADATA}" title="{'Show file metadata'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]70                <span class="pwg-icon pwg-icon-camera-info"> </span><span class="pwg-button-text">{'Show file metadata'|@translate}</span>
[8378]71        </a>
[8757]72{/if}{/strip}
73{strip}{if isset($current.U_DOWNLOAD)}
[12681]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>
[8378]76        </a>
[8757]77{/if}{/strip}
[8119]78{if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if}
[8757]79{strip}{if isset($favorite)}
[8665]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">
[8774]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>
[8378]82        </a>
[8757]83{/if}{/strip}
84{strip}{if isset($U_SET_AS_REPRESENTATIVE)}
[8378]85        <a href="{$U_SET_AS_REPRESENTATIVE}" title="{'set as album representative'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[8774]86                <span class="pwg-icon pwg-icon-representative"> </span><span class="pwg-button-text">{'representative'|@translate}</span>
[8378]87        </a>
[8757]88{/if}{/strip}
89{strip}{if isset($U_ADMIN)}
[8378]90        <a href="{$U_ADMIN}" title="{'Modify information'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
[12677]91                <span class="pwg-icon pwg-icon-edit"> </span><span class="pwg-button-text">{'Edit'|@translate}</span>
[8378]92        </a>
[8757]93{/if}{/strip}
94{strip}{if isset($U_CADDIE)}{*caddie management BEGIN*}
[8299]95{footer_script}
[2429]96{literal}function addToCadie(aElement, rootUrl, id)
97{
98if (aElement.disabled) return;
[8119]99aElement.disabled=true;
[2429]100var y = new PwgWS(rootUrl);
101y.callService(
[8119]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        );
[2429]108}{/literal}
[8299]109{/footer_script}
[12677]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>
[8378]112        </a>
[8757]113{/if}{/strip}{*caddie management END*}
[8378]114</div>
[8119]115
116        {include file='picture_nav_buttons.tpl'|@get_extent:'picture_nav_buttons'}
[8757]117</div>{*<!-- imageToolBar -->*}
[859]118
[13474]119<div id="theImageAndInfos">
[12881]120<div id="theImage">
[2227]121{$ELEMENT_CONTENT}
122
123{if isset($COMMENT_IMG)}
[11062]124<p class="imageComment">{$COMMENT_IMG}</p>
[2227]125{/if}
126
[8378]127{if isset($U_SLIDESHOW_STOP)}
[859]128<p>
[8378]129        [ <a href="{$U_SLIDESHOW_STOP}">{'stop the slideshow'|@translate}</a> ]
[859]130</p>
[2227]131{/if}
132
[859]133</div>
134
[10804]135<div id="imageInfos">
[5293]136{if $DISPLAY_NAV_THUMB}
[8378]137{if isset($previous)}
[5021]138<a class="navThumb" id="linkPrev" href="{$previous.U_IMG}" title="{'Previous'|@translate} : {$previous.TITLE}" rel="prev">
[8378]139        <img src="{$previous.THUMB_SRC}" alt="{$previous.TITLE}">
[859]140</a>
[2227]141{/if}
[8378]142{if isset($next)}
[5021]143<a class="navThumb" id="linkNext" href="{$next.U_IMG}" title="{'Next'|@translate} : {$next.TITLE}" rel="next">
[8378]144        <img src="{$next.THUMB_SRC}" alt="{$next.TITLE}">
[859]145</a>
[2227]146{/if}
[5293]147{/if}
[859]148
[8711]149<table id="standard" class="infoTable">
[8757]150{strip}
[8378]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}
[2480]217
[11893]218{if $display_info.rating_score and isset($rate_summary)}
[5108]219        <tr id="Average">
[11839]220                <td class="label">{'Rating score'|@translate}</td>
221                <td class="value">
[2594]222                {if $rate_summary.count}
[11839]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>
[2594]224                {else}
[11839]225                        <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
[2594]226                {/if}
227                </td>
228        </tr>
229{/if}
[8378]230
[2480]231{if isset($rating)}
[5108]232        <tr id="rating">
[2480]233                <td class="label">
[8665]234                        <span id="updateRate">{if isset($rating.USER_RATE)}{'Update your rating'|@translate}{else}{'Rate this photo'|@translate}{/if}</span>
[2480]235                </td>
236                <td class="value">
237                        <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;">
[8378]238                        <div>
[2480]239                        {foreach from=$rating.marks item=mark name=rate_loop}
240                        {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE}
[8378]241                                <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}">
[2480]242                        {else}
[8378]243                                <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}">
[2480]244                        {/if}
245                        {/foreach}
[8757]246                        {strip}{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
[7975]247                        {combine_script id='rating' load='async' require='core.scripts' path='themes/default/js/rating.js'}
[8378]248                        {footer_script}
249                                var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[];
250                                _pwgRatingAutoQueue.push( {ldelim}rootUrl: '{$ROOT_URL}', image_id: {$current.id},
[11839]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} );
[8378]259                        {/footer_script}
[8757]260                        {/strip}
[2480]261                        </div>
262                        </form>
263                </td>
264        </tr>
265{/if}
266
[8378]267{if $display_info.privacy_level and isset($available_permission_levels)}
[5108]268        <tr id="Privacy">
[6025]269                <td class="label">{'Who can see this photo?'|@translate}</td>
[8378]270                <td class="value">
[7975]271{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
[8299]272{footer_script}
[2594]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        {
[4513]280                method: "POST",
[2594]281                onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); },
282                onSuccess: function(result) { selectElement.disabled = false; }
283        }
284        );
285}{/literal}
[8299]286{/footer_script}
[8378]287        <select onchange="setPrivacyLevel(this, '{$ROOT_URL}', {$current.id}, this.options[selectedIndex].value)">
[6507]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}
[2594]291        </select>
292        </td></tr>
293{/if}
[8757]294{/strip}
[859]295</table>
296
[2227]297{if isset($metadata)}
[8711]298<table id="Metadata" class="infoTable2">
[2227]299{foreach from=$metadata item=meta}
[8378]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}
[2227]309{/foreach}
[859]310</table>
[2227]311{/if}
[10804]312</div>
[13474]313</div>
[859]314
[2227]315{if isset($COMMENT_COUNT)}
[859]316<div id="comments">
[8378]317        {if $COMMENT_COUNT > 0}
[2780]318                <h3>{$pwg->l10n_dec('%d comment', '%d comments',$COMMENT_COUNT)}</h3>
[13474]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>
[8378]324        {/if}
325        {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
[859]326
[2481]327        {if isset($comments)}
[3445]328                {include file='comment_list.tpl'}
[2481]329        {/if}
[859]330
[2481]331        {if isset($comment_add)}
[8378]332        <form method="post" action="{$comment_add.F_ACTION}" class="filter" id="addComment">
[2481]333        <fieldset>
[5021]334                <legend>{'Add a comment'|@translate}</legend>
[2481]335                {if $comment_add.SHOW_AUTHOR}
[5021]336                <label>{'Author'|@translate}<input type="text" name="author"></label>
[2481]337                {/if}
[5178]338                <label>{'Comment'|@translate}<textarea name="content" id="contentid" rows="5" cols="80">{$comment_add.CONTENT}</textarea></label>
[3185]339                <input type="hidden" name="key" value="{$comment_add.KEY}">
[8774]340                <input type="submit" value="{'Submit'|@translate}">
[2481]341        </fieldset>
342        </form>
343        {/if}
[1167]344</div>
[8378]345{/if}{*comments*}
[2205]346
[2352]347{if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if}
[10812]348
349</div>
Note: See TracBrowser for help on using the repository browser.