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

Last change on this file since 23263 was 23263, checked in by mistic100, 11 years ago

feature:2785 Improve template method to sort actions buttons
+ add default rank = 50

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