[30631] | 1 | <?php |
---|
[31409] | 2 | // +-----------------------------------------------------------------------+ |
---|
[32135] | 3 | // | Manage Properties Photos plugin for Piwigo by TEMMII | |
---|
[31409] | 4 | // +-----------------------------------------------------------------------+ |
---|
[32902] | 5 | // | Copyright(C) 2007-2023 ddtddt http://temmii.com/piwigo/ | |
---|
[31409] | 6 | // +-----------------------------------------------------------------------+ |
---|
| 7 | // | This program is free software; you can redistribute it and/or modify | |
---|
| 8 | // | it under the terms of the GNU General Public License as published by | |
---|
| 9 | // | the Free Software Foundation | |
---|
| 10 | // | | |
---|
| 11 | // | This program is distributed in the hope that it will be useful, but | |
---|
| 12 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
| 13 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
| 14 | // | General Public License for more details. | |
---|
| 15 | // | | |
---|
| 16 | // | You should have received a copy of the GNU General Public License | |
---|
| 17 | // | along with this program; if not, write to the Free Software | |
---|
| 18 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
| 19 | // | USA. | |
---|
| 20 | // +-----------------------------------------------------------------------+ |
---|
[30631] | 21 | |
---|
| 22 | //Ajout du prefiltre |
---|
[30702] | 23 | add_event_handler('loc_begin_picture', 'add_info_photo_pre', 05); |
---|
[32735] | 24 | add_event_handler('loc_end_picture', 'add_info_photo_pre2', 95); |
---|
[30631] | 25 | |
---|
| 26 | function add_info_photo_pre() { |
---|
| 27 | global $template; |
---|
[32735] | 28 | $template->set_prefilter('picture', 'add_info_photo_preT'); |
---|
[30631] | 29 | } |
---|
| 30 | |
---|
[32735] | 31 | function add_info_photo_pre2() { |
---|
| 32 | global $template,$pwg_loaded_plugins; |
---|
| 33 | if (isset($pwg_loaded_plugins['ColorPalette'])){ |
---|
| 34 | $template->set_prefilter('picture', 'color_palette_picture_prefilter',0); |
---|
| 35 | } |
---|
[32741] | 36 | if (isset($pwg_loaded_plugins['Copyrights'])){ |
---|
| 37 | $template->set_prefilter('picture', 'copyrights_add_to_pic_info',0); |
---|
| 38 | } |
---|
[32735] | 39 | } |
---|
| 40 | |
---|
[32650] | 41 | function add_info_photo_preT($content) { |
---|
[30631] | 42 | |
---|
[32135] | 43 | global $conf, $user; |
---|
| 44 | |
---|
[32151] | 45 | $replastandard='<dl id="standard" class="imageInfoTable">{strip} |
---|
[30631] | 46 | {foreach from=$add_info_photos item=addinfophotos} |
---|
[31553] | 47 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
[32135] | 48 | <div id="Author" class="imageInfo"> |
---|
[30631] | 49 | <dt>{\'Author\'|@translate}</dt> |
---|
| 50 | <dd>{$INFO_AUTHOR}</dd> |
---|
| 51 | </div> |
---|
[31553] | 52 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
[32135] | 53 | <div id="datecreate" class="imageInfo"> |
---|
[30631] | 54 | <dt>{\'Created on\'|@translate}</dt> |
---|
| 55 | <dd>{$INFO_CREATION_DATE}</dd> |
---|
| 56 | </div> |
---|
[31553] | 57 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
[30631] | 58 | <div id="datepost" class="imageInfo"> |
---|
| 59 | <dt>{\'Posted on\'|@translate}</dt> |
---|
| 60 | <dd>{$INFO_POSTED_DATE}</dd> |
---|
| 61 | </div> |
---|
[31553] | 62 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
[30631] | 63 | <div id="Dimensions" class="imageInfo"> |
---|
| 64 | <dt>{\'Dimensions\'|@translate}</dt> |
---|
| 65 | <dd>{$INFO_DIMENSIONS}</dd> |
---|
| 66 | </div> |
---|
[31553] | 67 | {else if $addinfophotos.AIPID == 5} |
---|
[30631] | 68 | <div id="File" class="imageInfo"> |
---|
| 69 | <dt>{\'File\'|@translate}</dt> |
---|
| 70 | <dd>{$INFO_FILE}</dd> |
---|
| 71 | </div> |
---|
[31553] | 72 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
[30631] | 73 | <div id="Filesize" class="imageInfo"> |
---|
| 74 | <dt>{\'Filesize\'|@translate}</dt> |
---|
| 75 | <dd>{$INFO_FILESIZE}</dd> |
---|
| 76 | </div> |
---|
[31553] | 77 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
[30703] | 78 | <div id="Tags" class="imageInfo"> |
---|
[30631] | 79 | <dt>{\'Tags\'|@translate}</dt> |
---|
| 80 | <dd> |
---|
| 81 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
| 82 | </dd> |
---|
| 83 | </div> |
---|
[31553] | 84 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
[30631] | 85 | <div id="Categories" class="imageInfo"> |
---|
| 86 | <dt>{\'Albums\'|@translate}</dt> |
---|
| 87 | <dd> |
---|
| 88 | <ul> |
---|
| 89 | {foreach from=$related_categories item=cat} |
---|
| 90 | <li>{$cat}</li> |
---|
| 91 | {/foreach} |
---|
| 92 | </ul> |
---|
| 93 | </dd> |
---|
| 94 | </div> |
---|
[31553] | 95 | {else if $addinfophotos.AIPID == 9} |
---|
[30631] | 96 | <div id="Visits" class="imageInfo"> |
---|
| 97 | <dt>{\'Visits\'|@translate}</dt> |
---|
| 98 | <dd>{$INFO_VISITS}</dd> |
---|
| 99 | </div> |
---|
[31553] | 100 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
[30631] | 101 | <div id="Average" class="imageInfo"> |
---|
| 102 | <dt>{\'Rating score\'|@translate}</dt> |
---|
| 103 | <dd> |
---|
| 104 | {if $rate_summary.count} |
---|
| 105 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
| 106 | {else} |
---|
| 107 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
| 108 | {/if} |
---|
| 109 | </dd> |
---|
| 110 | </div> |
---|
| 111 | {if isset($rating)} |
---|
| 112 | <div id="rating" class="imageInfo"> |
---|
| 113 | <dt> |
---|
| 114 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
| 115 | </dt> |
---|
| 116 | <dd> |
---|
| 117 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
| 118 | <div> |
---|
| 119 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
| 120 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
| 121 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
| 122 | {else} |
---|
| 123 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
| 124 | {/if} |
---|
| 125 | {/foreach} |
---|
| 126 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
| 127 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
| 128 | {footer_script} |
---|
| 129 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
| 130 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
| 131 | onSuccess : function(rating) {ldelim} |
---|
| 132 | var e = document.getElementById("updateRate"); |
---|
| 133 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
| 134 | e = document.getElementById("ratingScore"); |
---|
| 135 | if (e) e.innerHTML = rating.score; |
---|
| 136 | e = document.getElementById("ratingCount"); |
---|
| 137 | if (e) {ldelim} |
---|
| 138 | if (rating.count == 1) {ldelim} |
---|
| 139 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
| 140 | } else {ldelim} |
---|
| 141 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
| 142 | } |
---|
| 143 | {rdelim} |
---|
| 144 | {rdelim}{rdelim} ); |
---|
| 145 | {/footer_script} |
---|
| 146 | {/strip} |
---|
| 147 | </div> |
---|
| 148 | </form> |
---|
| 149 | </dd> |
---|
| 150 | </div> |
---|
| 151 | {/if} |
---|
| 152 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
| 153 | <div id="Privacy" class="imageInfo"> |
---|
| 154 | <dt>{\'Who can see this photo?\'|@translate}</dt> |
---|
| 155 | <dd> |
---|
| 156 | <div> |
---|
| 157 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
| 158 | </div> |
---|
| 159 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
| 160 | {footer_script require=\'jquery\'}{strip} |
---|
| 161 | function setPrivacyLevel(id, level){ |
---|
| 162 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
| 163 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
| 164 | { |
---|
| 165 | method: "POST", |
---|
| 166 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
| 167 | onSuccess: function(result) { |
---|
| 168 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
| 169 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
| 170 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
| 171 | } |
---|
| 172 | } |
---|
| 173 | ); |
---|
| 174 | } |
---|
| 175 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
| 176 | {/strip}{/footer_script} |
---|
| 177 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
| 178 | {foreach from=$available_permission_levels item=label key=level} |
---|
| 179 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
| 180 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
| 181 | {/foreach} |
---|
| 182 | </div> |
---|
| 183 | </dd> |
---|
| 184 | </div> |
---|
[31342] | 185 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
| 186 | <div id="Description" class="imageInfo"> |
---|
| 187 | <dt>{\'Description\'|@translate}</dt> |
---|
| 188 | <dd> |
---|
| 189 | {$COMMENT_IMG} |
---|
| 190 | </dd> |
---|
| 191 | </div> |
---|
| 192 | {footer_script} |
---|
| 193 | jQuery(document).ready(function(){ |
---|
| 194 | jQuery(".imageComment").hide(); |
---|
| 195 | }); |
---|
| 196 | {/footer_script} |
---|
[32180] | 197 | {else if $addinfophotos.AIPWORDING == \'ID\'} |
---|
| 198 | <div id="ImageId" class="imageInfo"> |
---|
| 199 | <dt>{\'Image id\'|@translate}</dt> |
---|
| 200 | <dd>{$addinfophotos.AIPDATA}</dd> |
---|
| 201 | </div> |
---|
| 202 | {else if $addinfophotos.AIPWORDING == \'addedby\'} |
---|
| 203 | <div id="pab1" class="imageInfo"> |
---|
| 204 | <dt>{\'Photo added by\'|@translate}</dt> |
---|
| 205 | <dd>{$PAB}</dd> |
---|
| 206 | </div> |
---|
| 207 | {else if $addinfophotos.AIPWORDING == \'Download Counter\'} |
---|
| 208 | <div id="DownloadCounter" class="imageInfo"> |
---|
| 209 | <dt>{\'Downloads\'|@translate}</dt> |
---|
| 210 | <dd>{$DOWNLOAD_COUNTER}</dd> |
---|
| 211 | </div> |
---|
[32735] | 212 | {else if $addinfophotos.AIPWORDING == \'ColorPalette\'} |
---|
| 213 | {$INFO_PALETTE} |
---|
| 214 | {else if $addinfophotos.AIPWORDING == \'expiry_date\'} |
---|
| 215 | {if isset($expiry_date)} |
---|
| 216 | <div id="expd_expiry_date" class="imageInfo"> |
---|
| 217 | <dt>{\'Expiry date\'|@translate}</dt> |
---|
| 218 | <dd>{\'%s, in %s days\'|@translate:$expiry_date:$expd_days}</dd> |
---|
| 219 | </div> |
---|
| 220 | {/if} |
---|
| 221 | {if isset($expired_on_date)} |
---|
| 222 | <div id="expd_expired_on_date" class="imageInfo"> |
---|
| 223 | <dt>{\'expired on\'|@translate}</dt> |
---|
| 224 | <dd>{$expired_on_date}</dd> |
---|
| 225 | </div> |
---|
| 226 | {/if} |
---|
[32740] | 227 | {else if $addinfophotos.AIPWORDING == \'Copyrights\'} |
---|
| 228 | <div id="Copyrights_name" class="imageInfo"> |
---|
| 229 | <dt>{\'Copyright\'|@translate}</dt> |
---|
| 230 | <dd> |
---|
| 231 | {if $CR_INFO_NAME} |
---|
| 232 | <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}: {$CR_INFO_DESCR}">{$CR_INFO_NAME}</a> |
---|
| 233 | {else} |
---|
| 234 | {\'N/A\'|@translate} |
---|
| 235 | {/if} |
---|
| 236 | </dd> |
---|
| 237 | </div> |
---|
[33046] | 238 | {else if isset($addinfophotos.AIPDATA)} |
---|
[30702] | 239 | <div id="add_info" class="imageInfo"> |
---|
| 240 | <dt class="label">{$addinfophotos.AIPWORDING}</dt> |
---|
[30631] | 241 | <dd class="value">{$addinfophotos.AIPDATA}</dd> |
---|
| 242 | </div> |
---|
| 243 | {/if} |
---|
| 244 | {/foreach} |
---|
[32151] | 245 | {/strip} |
---|
[30637] | 246 | </dl> |
---|
[32135] | 247 | {if isset($metadata)}'; |
---|
| 248 | |
---|
| 249 | $repladarkroomcards=' |
---|
| 250 | <div id="infopanel-left" class="col-lg-6 col-12"> |
---|
| 251 | <!-- Picture infos --> |
---|
| 252 | <div id="card-informations" class="card mb-2"> |
---|
| 253 | <div class="card-body"> |
---|
| 254 | <h5 class="card-title">{\'Information\'|@translate}</h5> |
---|
| 255 | <div id="info-content" class="d-flex flex-column"> |
---|
[32151] | 256 | {foreach from=$add_info_photos item=addinfophotos} |
---|
| 257 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
| 258 | <div id="Author" class="imageInfo"> |
---|
| 259 | <dl class="row mb-0"> |
---|
| 260 | <dt class="col-sm-5">{\'Author\'|@translate}</dt> |
---|
| 261 | <dd class="col-sm-7">{$INFO_AUTHOR}</dd> |
---|
| 262 | </dl> |
---|
| 263 | </div> |
---|
| 264 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
| 265 | <div id="datecreate" class="imageInfo"> |
---|
| 266 | <dl class="row mb-0"> |
---|
| 267 | <dt class="col-sm-5">{\'Created on\'|@translate}</dt> |
---|
| 268 | <dd class="col-sm-7">{$INFO_CREATION_DATE}</dd> |
---|
| 269 | </dl> |
---|
| 270 | </div> |
---|
| 271 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
| 272 | <div id="datepost" class="imageInfo"> |
---|
| 273 | <dl class="row mb-0"> |
---|
| 274 | <dt class="col-sm-5">{\'Posted on\'|@translate}</dt> |
---|
| 275 | <dd class="col-sm-7">{$INFO_POSTED_DATE}</dd> |
---|
| 276 | </dl> |
---|
| 277 | </div> |
---|
| 278 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
| 279 | <div id="Dimensions" class="imageInfo"> |
---|
| 280 | <dl class="row mb-0"> |
---|
| 281 | <dt class="col-sm-5">{\'Dimensions\'|@translate}</dt> |
---|
| 282 | <dd class="col-sm-7">{$INFO_DIMENSIONS}</dd> |
---|
| 283 | </dl> |
---|
| 284 | </div> |
---|
| 285 | {else if $addinfophotos.AIPID == 5} |
---|
| 286 | <div id="File" class="imageInfo"> |
---|
| 287 | <dl class="row mb-0"> |
---|
| 288 | <dt class="col-sm-5">{\'File\'|@translate}</dt> |
---|
| 289 | <dd class="col-sm-7">{$INFO_FILE}</dd> |
---|
| 290 | </dl> |
---|
| 291 | </div> |
---|
| 292 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
| 293 | <div id="Filesize" class="imageInfo"> |
---|
| 294 | <dl class="row mb-0"> |
---|
| 295 | <dt class="col-sm-5">{\'Filesize\'|@translate}</dt> |
---|
| 296 | <dd class="col-sm-7">{$INFO_FILESIZE}</dd> |
---|
| 297 | </dl> |
---|
| 298 | </div> |
---|
| 299 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
| 300 | {if $TAGAFF == 0} |
---|
| 301 | <div id="Tags" class="imageInfo"> |
---|
| 302 | <dl class="row mb-0"> |
---|
| 303 | <dt class="col-sm-5">{\'Tags\'|@translate}</dt> |
---|
| 304 | <dd class="col-sm-7"> |
---|
| 305 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
| 306 | </dd> |
---|
| 307 | </dl> |
---|
| 308 | </div> |
---|
| 309 | {/if} |
---|
| 310 | {if $TAGAFF == 1} |
---|
| 311 | </div> |
---|
| 312 | </div> |
---|
| 313 | </div> |
---|
| 314 | <div id="card-tags" class="card mb-2"> |
---|
| 315 | <div class="card-body"> |
---|
| 316 | <h5 class="card-title">{\'Tags\'|@translate}</h5> |
---|
| 317 | <div id="Tags" class="imageInfo"> |
---|
| 318 | {foreach from=$related_tags item=tag name=tag_loop}<a class="btn btn-primary btn-raised mr-1" href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
| 319 | </div> |
---|
| 320 | </div> |
---|
| 321 | </div> |
---|
| 322 | {/if} |
---|
| 323 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
| 324 | <div id="Categories" class="imageInfo"> |
---|
| 325 | <dl class="row mb-0"> |
---|
| 326 | <dt class="col-sm-5">{\'Albums\'|@translate}</dt> |
---|
| 327 | <dd class="col-sm-7"> |
---|
[32176] | 328 | {foreach from=$related_categories item=cat name=cat_loop} |
---|
| 329 | {if !$smarty.foreach.cat_loop.first}<br />{/if}{$cat} |
---|
| 330 | {/foreach} |
---|
[32151] | 331 | </dd> |
---|
| 332 | </dl> |
---|
| 333 | </div> |
---|
| 334 | {else if $addinfophotos.AIPID == 9} |
---|
| 335 | <div id="Visits" class="imageInfo"> |
---|
| 336 | <dl class="row mb-0"> |
---|
| 337 | <dt class="col-sm-5">{\'Visits\'|@translate}</dt> |
---|
| 338 | <dd class="col-sm-7">{$INFO_VISITS}</dd> |
---|
| 339 | </dl> |
---|
| 340 | </div> |
---|
| 341 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
| 342 | <div id="Average" class="imageInfo"> |
---|
| 343 | <dl class="row mb-0"> |
---|
| 344 | <dt class="col-sm-5">{\'Rating score\'|@translate}</dt> |
---|
| 345 | <dd class="col-sm-7"> |
---|
| 346 | {if $rate_summary.count} |
---|
| 347 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
| 348 | {else} |
---|
| 349 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
| 350 | {/if} |
---|
| 351 | </dd> |
---|
| 352 | </dl> |
---|
| 353 | </div> |
---|
| 354 | {if isset($rating)} |
---|
[32176] | 355 | <div id="rating" class="imageInfo"> |
---|
| 356 | <dl class="row mb-0"> |
---|
| 357 | <dt class="col-sm-5" id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</dt> |
---|
| 358 | <dd class="col-sm-7"> |
---|
| 359 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
| 360 | <div> |
---|
| 361 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
| 362 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
| 363 | <span class="rateButtonStarFull" data-value="{$mark}"></span> |
---|
| 364 | {else} |
---|
| 365 | <span class="rateButtonStarEmpty" data-value="{$mark}"></span> |
---|
| 366 | {/if} |
---|
| 367 | {/foreach} |
---|
| 368 | {strip}{combine_script id=\'core.scripts\' path=\'themes/default/js/scripts.js\' load=\'async\'} |
---|
| 369 | {combine_script id=\'rating\' require=\'core.scripts\' path=\'themes/bootstrap_darkroom/js/rating.js\' load=\'async\'} |
---|
| 370 | {footer_script require=\'jquery\'} |
---|
| 371 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
| 372 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
| 373 | onSuccess : function(rating) {ldelim} |
---|
| 374 | var e = document.getElementById("updateRate"); |
---|
| 375 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
| 376 | e = document.getElementById("ratingScore"); |
---|
| 377 | if (e) e.innerHTML = rating.score; |
---|
| 378 | e = document.getElementById("ratingCount"); |
---|
| 379 | if (e) {ldelim} |
---|
| 380 | if (rating.count == 1) {ldelim} |
---|
| 381 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
| 382 | {rdelim} else {ldelim} |
---|
| 383 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
| 384 | {rdelim} |
---|
| 385 | {rdelim} |
---|
| 386 | $(\'#averageRate\').find(\'span\').each(function() {ldelim} |
---|
| 387 | $(this).addClass(rating.average > $(this).data(\'value\') - 0.5 ? \'rateButtonStarFull\' : \'rateButtonStarEmpty\'); |
---|
| 388 | $(this).removeClass(rating.average > $(this).data(\'value\') - 0.5 ? \'rateButtonStarEmpty\' : \'rateButtonStarFull\'); |
---|
| 389 | {rdelim}); |
---|
| 390 | {rdelim} |
---|
| 391 | {rdelim}); |
---|
| 392 | {/footer_script} |
---|
| 393 | {/strip} |
---|
| 394 | </div> |
---|
| 395 | </form> |
---|
| 396 | </dd> |
---|
| 397 | </dl> |
---|
| 398 | </div> |
---|
| 399 | {/if} |
---|
[32151] | 400 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
| 401 | <div id="Privacy" class="imageInfo"> |
---|
| 402 | <dl class="row mb-0"> |
---|
| 403 | <dt class="col-sm-5">{\'Who can see this photo?\'|@translate}</dt> |
---|
| 404 | <dd class="col-sm-7"> |
---|
| 405 | <div> |
---|
| 406 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
| 407 | </div> |
---|
| 408 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
| 409 | {footer_script require=\'jquery\'}{strip} |
---|
| 410 | function setPrivacyLevel(id, level){ |
---|
| 411 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
| 412 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
| 413 | { |
---|
| 414 | method: "POST", |
---|
| 415 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
| 416 | onSuccess: function(result) { |
---|
| 417 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
| 418 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
| 419 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
| 420 | } |
---|
| 421 | } |
---|
| 422 | ); |
---|
| 423 | } |
---|
| 424 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
| 425 | {/strip}{/footer_script} |
---|
| 426 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
| 427 | {foreach from=$available_permission_levels item=label key=level} |
---|
| 428 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
| 429 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
| 430 | {/foreach} |
---|
| 431 | </div> |
---|
| 432 | </dd> |
---|
| 433 | </dl> |
---|
| 434 | </div> |
---|
| 435 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
| 436 | <div id="Description" class="imageInfo"> |
---|
| 437 | <dl class="row mb-0"> |
---|
| 438 | <dt class="col-sm-5">{\'Description\'|@translate}</dt> |
---|
| 439 | <dd class="col-sm-7"> |
---|
| 440 | {$COMMENT_IMG} |
---|
| 441 | </dd> |
---|
| 442 | </dl> |
---|
| 443 | </div> |
---|
| 444 | {footer_script} |
---|
| 445 | jQuery(document).ready(function(){ |
---|
| 446 | jQuery(".imageComment").hide(); |
---|
| 447 | }); |
---|
| 448 | {/footer_script} |
---|
[32180] | 449 | {else if $addinfophotos.AIPWORDING == \'ID\'} |
---|
| 450 | <div id="ImageId" class="imageInfo"> |
---|
| 451 | <dl class="row mb-0"> |
---|
| 452 | <dt class="col-sm-5">{\'Image id\'|@translate}</dt> |
---|
[32195] | 453 | <dd class="col-sm-7">{$addinfophotos.AIPDATA}</dd> |
---|
[32180] | 454 | </dl> |
---|
| 455 | </div> |
---|
| 456 | {else if $addinfophotos.AIPWORDING == \'addedby\'} |
---|
| 457 | <div id="pab1" class="imageInfo"> |
---|
| 458 | <dl class="row mb-0"> |
---|
| 459 | <dt class="col-sm-5">{\'Photo added by\'|@translate}</dt> |
---|
[32195] | 460 | <dd class="col-sm-7">{$PAB}</dd> |
---|
[32180] | 461 | </dl> |
---|
| 462 | </div> |
---|
| 463 | {else if $addinfophotos.AIPWORDING == \'Download Counter\'} |
---|
| 464 | <div id="DownloadCounter" class="imageInfo"> |
---|
| 465 | <dl class="row mb-0"> |
---|
| 466 | <dt class="col-sm-5">{\'Downloads\'|@translate}</dt> |
---|
[32195] | 467 | <dd class="col-sm-7">{$DOWNLOAD_COUNTER}</dd> |
---|
[32180] | 468 | </dl> |
---|
| 469 | </div> |
---|
[32735] | 470 | {else if $addinfophotos.AIPWORDING == \'ColorPalette\'} |
---|
| 471 | {strip} |
---|
| 472 | {combine_css id="colorpalette.paletteinfo_css" path=$COLOR_PALETTE_PATH|cat:"template/palette_info.css"} |
---|
| 473 | {combine_script id="colorpalette.paletteinfo_js" require="jquery" load="async" path=$COLOR_PALETTE_PATH|cat:"template/palette_info.js"} |
---|
| 474 | {footer_script} |
---|
| 475 | var paletteUrl = \'{$palette_url}\'; |
---|
| 476 | {/footer_script} |
---|
| 477 | <div id="color_palette" class="imageInfo"> |
---|
| 478 | <dl class="row mb-0"> |
---|
| 479 | <dt class="col-sm-5">{\'Palette\'|@translate}</dt> |
---|
| 480 | <dd class="col-sm-7" id="palette_colors"> |
---|
| 481 | {foreach |
---|
| 482 | from=$palette_colors item=color name=color_loop} |
---|
| 483 | <div class="color_palette_item" |
---|
| 484 | style="background-color: #{$color.hex};" |
---|
| 485 | data-color="{$color.rgb}" |
---|
| 486 | onclick="paletteItemClick(this);" |
---|
| 487 | title="#{$color.hex}"></div> |
---|
| 488 | {/foreach} |
---|
| 489 | <a id="palette_search" href="#" style="display: none;">{\'Search\'|@translate}</a> |
---|
| 490 | <div style="clear: both"/> |
---|
| 491 | </dd> |
---|
| 492 | </dl> |
---|
| 493 | </div> |
---|
| 494 | {/strip} |
---|
| 495 | {else if $addinfophotos.AIPWORDING == \'expiry_date\'} |
---|
| 496 | {if isset($expiry_date)} |
---|
| 497 | <div id="expd_expiry_date" class="imageInfo"> |
---|
| 498 | <dl class="row mb-0"> |
---|
| 499 | <dt class="col-sm-5">{\'Expiry date\'|@translate}</dt> |
---|
| 500 | <dd class="col-sm-7">{\'%s, in %s days\'|@translate:$expiry_date:$expd_days}</dd> |
---|
| 501 | </dl> |
---|
| 502 | </div> |
---|
| 503 | {/if} |
---|
| 504 | {if isset($expired_on_date)} |
---|
| 505 | <div id="expd_expired_on_date" class="imageInfo"> |
---|
| 506 | <dl class="row mb-0"> |
---|
| 507 | <dt class="col-sm-5">{\'expired on\'|@translate}</dt> |
---|
| 508 | <dd class="col-sm-7">{$expired_on_date}</dd> |
---|
| 509 | </dl> |
---|
| 510 | </div> |
---|
| 511 | {/if} |
---|
[32740] | 512 | {else if $addinfophotos.AIPWORDING == \'Copyrights\'} |
---|
| 513 | <div id="Copyrights_name" class="imageInfo"> |
---|
| 514 | <dl class="row mb-0"> |
---|
| 515 | <dt class="col-sm-5">{\'Copyright\'|@translate}</dt> |
---|
| 516 | <dd class="col-sm-7"> |
---|
| 517 | {if $CR_INFO_NAME} |
---|
| 518 | <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}: {$CR_INFO_DESCR}">{$CR_INFO_NAME}</a> |
---|
| 519 | {else} |
---|
| 520 | {\'N/A\'|@translate} |
---|
| 521 | {/if} |
---|
| 522 | </dd> |
---|
| 523 | </dl> |
---|
| 524 | </div> |
---|
[33046] | 525 | {else if isset($addinfophotos.AIPDATA)} |
---|
[32151] | 526 | <div id="add_info" class="imageInfo"> |
---|
| 527 | <dl class="row mb-0"> |
---|
| 528 | <dt class="label col-sm-5">{$addinfophotos.AIPWORDING}</dt> |
---|
| 529 | <dd class="value col-sm-7">{$addinfophotos.AIPDATA}</dd> |
---|
| 530 | </dl> |
---|
| 531 | </div> |
---|
| 532 | {/if} |
---|
| 533 | {/foreach} |
---|
| 534 | {if $TAGAFF == 0} |
---|
| 535 | </div></div></div> |
---|
| 536 | {/if} |
---|
| 537 | </div> |
---|
[33046] | 538 | {if isset($metadata) || (isset($comment_add) || isset($COMMENT_COUNT))} |
---|
[32135] | 539 | <div id="infopanel-right" class="col-lg-6 col-12"> |
---|
| 540 | <!-- metadata --> |
---|
[30637] | 541 | {if isset($metadata)} |
---|
[32135] | 542 | {if isset($loaded_plugins[\'exif_view\'])} |
---|
| 543 | {assign var="exif_make" value="{\'exif_field_Make\'|@translate}"} |
---|
| 544 | {assign var="exif_model" value="{\'exif_field_Model\'|@translate}"} |
---|
| 545 | {assign var="exif_lens" value="{\'exif_field_UndefinedTag:0xA434\'|@translate}"} |
---|
| 546 | {assign var="exif_fnumber" value="{\'exif_field_FNumber\'|@translate}"} |
---|
| 547 | {assign var="exif_iso" value="{\'exif_field_ISOSpeedRatings\'|@translate}"} |
---|
| 548 | {assign var="exif_focal_length" value="{\'exif_field_FocalLength\'|@translate}"} |
---|
| 549 | {assign var="exif_flash" value="{\'exif_field_Flash\'|@translate}"} |
---|
| 550 | {assign var="exif_exposure_time" value="{\'exif_field_ExposureTime\'|@translate}"} |
---|
| 551 | {assign var="exif_exposure_bias" value="{\'exif_field_ExposureBiasValue\'|@translate}"} |
---|
| 552 | {else} |
---|
| 553 | {assign var="exif_make" value="Make"} |
---|
| 554 | {assign var="exif_model" value="Model"} |
---|
| 555 | {assign var="exif_lens" value="UndefinedTag:0xA434"} |
---|
| 556 | {assign var="exif_fnumber" value="FNumber"} |
---|
| 557 | {assign var="exif_iso" value="ISOSpeedRatings"} |
---|
| 558 | {assign var="exif_focal_length" value="FocalLength"} |
---|
| 559 | {assign var="exif_flash" value="Flash"} |
---|
| 560 | {assign var="exif_exposure_time" value="ExposureTime"} |
---|
| 561 | {assign var="exif_exposure_bias" value="ExposureBiasValue"} |
---|
| 562 | {/if} |
---|
[30631] | 563 | |
---|
[32135] | 564 | <div id="card-metadata" class="card mb-2"> |
---|
| 565 | <div class="card-body"> |
---|
| 566 | <h5 class="card-title">{\'EXIF Metadata\'|@translate}</h5> |
---|
| 567 | <div id="metadata"> |
---|
| 568 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_make}", $metadata.0.lines) || array_key_exists("{$exif_model}", $metadata.0.lines))} |
---|
| 569 | <div class="row" style="line-height: 40px"> |
---|
| 570 | <div class="col-12"> |
---|
| 571 | <span class="camera-compact fa-3x mr-3" title="{$exif_make} & {$exif_model}"></span> |
---|
| 572 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_make}", $metadata.0.lines))}{$metadata.0.lines[{$exif_make}]}{/if} |
---|
| 573 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_model}", $metadata.0.lines))}{$metadata.0.lines[{$exif_model}]}{/if} |
---|
| 574 | </div> |
---|
| 575 | </div> |
---|
| 576 | {/if} |
---|
| 577 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_lens}", $metadata.0.lines))} |
---|
| 578 | <div class="row" style="line-height: 40px"> |
---|
| 579 | <div class="col-12"> |
---|
| 580 | <span class="camera-lens-h fa-3x mr-3" title="{$exif_lens}"></span> |
---|
| 581 | {$metadata.0.lines[{$exif_lens}]} |
---|
| 582 | </div> |
---|
| 583 | </div> |
---|
| 584 | {/if} |
---|
| 585 | <div class="row"> |
---|
| 586 | <div class="col-12{if $theme_config->fluid_width} col-xl-10{/if}"> |
---|
| 587 | <div class="row"> |
---|
| 588 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_fnumber}", $metadata.0.lines))} |
---|
| 589 | <div class="col-6 col-sm-4"> |
---|
| 590 | <span class="camera-aperture fa-2x pr-2" title="{$exif_fnumber}"></span> f/{$metadata.0.lines[{$exif_fnumber}]} |
---|
| 591 | </div> |
---|
| 592 | {/if} |
---|
| 593 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_focal_length}", $metadata.0.lines))} |
---|
| 594 | <div class="col-6 col-sm-4"> |
---|
| 595 | <span class="camera-focal-length fa-2x pr-2" title="{$exif_focal_length}"></span> {$metadata.0.lines[{$exif_focal_length}]} |
---|
| 596 | </div> |
---|
| 597 | {/if} |
---|
| 598 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_exposure_time}", $metadata.0.lines))} |
---|
| 599 | <div class="col-6 col-sm-4"> |
---|
| 600 | <span class="camera-shutter-speed fa-2x pr-2" title="{$exif_exposure_time}"></span> {$metadata.0.lines[{$exif_exposure_time}]} |
---|
| 601 | </div> |
---|
| 602 | {/if} |
---|
| 603 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_iso}", $metadata.0.lines))} |
---|
| 604 | <div class="col-6 col-sm-4"> |
---|
| 605 | <span class="camera-iso fa-2x pr-2" title="{$exif_iso}"></span> {$metadata.0.lines[{$exif_iso}]} |
---|
| 606 | </div> |
---|
| 607 | {/if} |
---|
| 608 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_exposure_bias}", $metadata.0.lines))} |
---|
| 609 | <div class="col-6 col-sm-4"> |
---|
| 610 | <span class="camera-exposure fa-2x pr-2" title="{$exif_exposure_bias}"></span> {$metadata.0.lines[{$exif_exposure_bias}]} |
---|
| 611 | </div> |
---|
| 612 | {/if} |
---|
| 613 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_flash}", $metadata.0.lines))} |
---|
| 614 | <div class="col-6 col-sm-4"> |
---|
| 615 | <span class="camera-flash fa-2x pr-2 float-left h-100" title="{$exif_flash}"></span><div> {$metadata.0.lines[{$exif_flash}]}</div> |
---|
| 616 | </div> |
---|
| 617 | {/if} |
---|
| 618 | </div> |
---|
| 619 | </div> |
---|
| 620 | </div> |
---|
| 621 | </div> |
---|
| 622 | <button id="show_exif_data" class="btn btn-primary btn-raised mt-1" style="text-transform: none;"><i class="fas fa-info mr-1"></i> {\'Show EXIF data\'|@translate}</button> |
---|
| 623 | {footer_script require=\'jquery\'} |
---|
| 624 | $(\'#show_exif_data\').on(\'click\', function() { |
---|
| 625 | if ($(\'#full_exif_data\').hasClass(\'d-none\')) { |
---|
| 626 | $(\'#full_exif_data\').addClass(\'d-flex\').removeClass(\'d-none\'); |
---|
| 627 | $(\'#show_exif_data\').html(\'<i class="fas fa-info mr-1"></i> {"Hide EXIF data"|@translate}\'); |
---|
| 628 | } else { |
---|
| 629 | $(\'#full_exif_data\').addClass(\'d-none\').removeClass(\'d-flex\'); |
---|
| 630 | $(\'#show_exif_data\').html(\'<i class="fas fa-info mr-1"></i> {"Show EXIF data"|@translate}\'); |
---|
| 631 | } |
---|
| 632 | }); |
---|
| 633 | {/footer_script} |
---|
| 634 | <div id="full_exif_data" class="d-none flex-column mt-2"> |
---|
| 635 | {foreach from=$metadata item=meta} |
---|
| 636 | {foreach from=$meta.lines item=value key=label} |
---|
| 637 | <div> |
---|
| 638 | <dl class="row mb-0"> |
---|
| 639 | <dt class="col-sm-6">{$label}</dt> |
---|
| 640 | <dd class="col-sm-6">{$value}</td> |
---|
| 641 | </tr> |
---|
| 642 | </dl> |
---|
| 643 | </div> |
---|
| 644 | {/foreach} |
---|
| 645 | {/foreach} |
---|
| 646 | </div> |
---|
| 647 | </div> |
---|
| 648 | </div> |
---|
| 649 | {/if} |
---|
| 650 | <div id="card-comments" class="ml-2"> |
---|
| 651 | {include file=\'picture_info_comments.tpl\'} |
---|
| 652 | </div> |
---|
| 653 | </div> |
---|
| 654 | {/if} |
---|
| 655 | '; |
---|
| 656 | |
---|
| 657 | $repladarkroomtabs=' |
---|
| 658 | <div id="infopanel" class="col-lg-8 col-md-10 col-12 mx-auto"> |
---|
| 659 | <!-- Nav tabs --> |
---|
| 660 | <ul class="nav nav-tabs nav-justified flex-column flex-sm-row" role="tablist"> |
---|
| 661 | {if $theme_config->picture_info == \'tabs\' || (get_device() != \'desktop\' && $theme_config->picture_info != \'disabled\')} |
---|
| 662 | <li class="nav-item"><a class="flex-sm-fill text-sm-center nav-link active" href="#tab_info" aria-controls="tab_info" role="tab" data-toggle="tab">{\'Information\'|@translate}</a></li> |
---|
| 663 | {if isset($metadata)} |
---|
| 664 | <li class="nav-item"><a class="flex-sm-fill text-sm-center nav-link" href="#tab_metadata" aria-controls="tab_metadata" role="tab" data-toggle="tab">{\'EXIF Metadata\'|@translate}</a></li> |
---|
| 665 | {/if} |
---|
| 666 | {/if} |
---|
[33046] | 667 | {if isset($comment_add) || isset($COMMENT_COUNT))} |
---|
[32135] | 668 | <li class="nav-item{if $theme_config->picture_info == \'disabled\' || ($theme_config->picture_info != \'tabs\' && get_device() == \'desktop\')} active{/if}"><a class="flex-sm-fill text-sm-center nav-link" href="#tab_comments" aria-controls="tab_comments" role="tab" data-toggle="tab">{\'Comments\'|@translate} <span class="badge badge-secondary">{$COMMENT_COUNT}</span></a></li> |
---|
| 669 | {/if} |
---|
| 670 | </ul> |
---|
| 671 | |
---|
| 672 | <!-- Tab panes --> |
---|
| 673 | <div class="tab-content d-flex justify-content-center"> |
---|
| 674 | {if $theme_config->picture_info === \'tabs\' || (get_device() != \'desktop\' && $theme_config->picture_info != \'disabled\')} |
---|
| 675 | <div role="tabpanel" class="tab-pane active" id="tab_info"> |
---|
| 676 | <div id="info-content" class="info"> |
---|
| 677 | <div class="table-responsive"> |
---|
| 678 | <table class="table table-sm"> |
---|
| 679 | <colgroup> |
---|
| 680 | <col class="w-50"> |
---|
| 681 | <col class="w-50"> |
---|
| 682 | </colgroup> |
---|
| 683 | <tbody> |
---|
| 684 | <!--mpp --> |
---|
| 685 | {foreach from=$add_info_photos item=addinfophotos} |
---|
| 686 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
| 687 | <div id="Author" class="imageInfo"> |
---|
| 688 | <tr> |
---|
| 689 | <th scope="row">{\'Author\'|@translate}</th> |
---|
| 690 | <td>{$INFO_AUTHOR}</td> |
---|
| 691 | </tr> |
---|
| 692 | </div> |
---|
| 693 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
| 694 | <div id="datecreate" class="imageInfo"> |
---|
| 695 | <tr> |
---|
| 696 | <th scope="row">{\'Created on\'|@translate}</th> |
---|
| 697 | <td>{$INFO_CREATION_DATE}</td> |
---|
| 698 | </tr> |
---|
| 699 | </div> |
---|
| 700 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
| 701 | <div id="datepost" class="imageInfo"> |
---|
| 702 | <tr> |
---|
| 703 | <th scope="row">{\'Posted on\'|@translate}</th> |
---|
| 704 | <td>{$INFO_POSTED_DATE}</td> |
---|
| 705 | </tr> |
---|
| 706 | </div> |
---|
| 707 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
| 708 | <div id="Dimensions" class="imageInfo"> |
---|
| 709 | <tr> |
---|
| 710 | <th scope="row">{\'Dimensions\'|@translate}</th> |
---|
| 711 | <td>{$INFO_DIMENSIONS}</td> |
---|
| 712 | </tr> |
---|
| 713 | </div> |
---|
| 714 | {else if $addinfophotos.AIPID == 5} |
---|
| 715 | <div id="File" class="imageInfo"> |
---|
| 716 | <tr> |
---|
| 717 | <th scope="row">{\'File\'|@translate}</th> |
---|
| 718 | <td>{$INFO_FILE}</td> |
---|
| 719 | </tr> |
---|
| 720 | </div> |
---|
| 721 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
| 722 | <div id="Filesize" class="imageInfo"> |
---|
| 723 | <tr> |
---|
| 724 | <th scope="row">{\'Filesize\'|@translate}</th> |
---|
| 725 | <td>{$INFO_FILESIZE}</td> |
---|
| 726 | </tr> |
---|
| 727 | </div> |
---|
| 728 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
| 729 | <div id="Tags" class="imageInfo"> |
---|
| 730 | <tr> |
---|
| 731 | <th scope="row">{\'Tags\'|@translate}</th> |
---|
| 732 | <td> |
---|
| 733 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
| 734 | </td> |
---|
| 735 | </tr> |
---|
| 736 | </div> |
---|
| 737 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
| 738 | <div id="Categories" class="imageInfo"> |
---|
| 739 | <tr> |
---|
| 740 | <th scope="row">{\'Albums\'|@translate}</th> |
---|
| 741 | <td> |
---|
[32176] | 742 | {foreach from=$related_categories item=cat name=cat_loop} |
---|
| 743 | {if !$smarty.foreach.cat_loop.first}<br />{/if}{$cat} |
---|
| 744 | {/foreach} |
---|
[32135] | 745 | </td> |
---|
| 746 | </tr> |
---|
| 747 | </div> |
---|
| 748 | {else if $addinfophotos.AIPID == 9} |
---|
| 749 | <div id="Visits" class="imageInfo"> |
---|
| 750 | <tr> |
---|
| 751 | <th scope="row">{\'Visits\'|@translate}</th> |
---|
| 752 | <td>{$INFO_VISITS}</td> |
---|
| 753 | </tr> |
---|
| 754 | </div> |
---|
| 755 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
| 756 | <div id="Average" class="imageInfo"> |
---|
| 757 | <tr> |
---|
| 758 | <th scope="row">{\'Rating score\'|@translate}</th> |
---|
| 759 | <td> |
---|
| 760 | {if $rate_summary.count} |
---|
| 761 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
| 762 | {else} |
---|
| 763 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
| 764 | {/if} |
---|
| 765 | </td> |
---|
| 766 | </tr> |
---|
| 767 | </div> |
---|
| 768 | {if isset($rating)} |
---|
| 769 | <div id="rating" class="imageInfo"> |
---|
| 770 | <tr> |
---|
[32176] | 771 | <th scope="row" id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</th> |
---|
[32135] | 772 | <td> |
---|
[32176] | 773 | <div id="rating" class="imageInfo"> |
---|
| 774 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
| 775 | <div> |
---|
| 776 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
| 777 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
| 778 | <span class="rateButtonStarFull" data-value="{$mark}"></span> |
---|
| 779 | {else} |
---|
| 780 | <span class="rateButtonStarEmpty" data-value="{$mark}"></span> |
---|
| 781 | {/if} |
---|
| 782 | {/foreach} |
---|
| 783 | {strip}{combine_script id=\'core.scripts\' path=\'themes/default/js/scripts.js\' load=\'async\'} |
---|
| 784 | {combine_script id=\'rating\' require=\'core.scripts\' path=\'themes/bootstrap_darkroom/js/rating.js\' load=\'async\'} |
---|
| 785 | {footer_script require=\'jquery\'} |
---|
| 786 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
| 787 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
[32135] | 788 | onSuccess : function(rating) {ldelim} |
---|
[32176] | 789 | var e = document.getElementById("updateRate"); |
---|
| 790 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
| 791 | e = document.getElementById("ratingScore"); |
---|
| 792 | if (e) e.innerHTML = rating.score; |
---|
| 793 | e = document.getElementById("ratingCount"); |
---|
| 794 | if (e) {ldelim} |
---|
| 795 | if (rating.count == 1) {ldelim} |
---|
| 796 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
| 797 | {rdelim} else {ldelim} |
---|
[32135] | 798 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
[32176] | 799 | {rdelim} |
---|
| 800 | {rdelim} |
---|
| 801 | $(\'#averageRate\').find(\'span\').each(function() {ldelim} |
---|
| 802 | $(this).addClass(rating.average > $(this).data(\'value\') - 0.5 ? \'rateButtonStarFull\' : \'rateButtonStarEmpty\'); |
---|
| 803 | $(this).removeClass(rating.average > $(this).data(\'value\') - 0.5 ? \'rateButtonStarEmpty\' : \'rateButtonStarFull\'); |
---|
| 804 | {rdelim}); |
---|
| 805 | {rdelim} |
---|
| 806 | {rdelim}); |
---|
| 807 | {/footer_script} |
---|
| 808 | {/strip} |
---|
| 809 | </div> |
---|
| 810 | </form> |
---|
[32135] | 811 | </div> |
---|
| 812 | </td> |
---|
[32176] | 813 | </tr> |
---|
[32135] | 814 | </div> |
---|
| 815 | {/if} |
---|
| 816 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
| 817 | <div id="Privacy" class="imageInfo"> |
---|
| 818 | <tr> |
---|
| 819 | <th scope="row">{\'Who can see this photo?\'|@translate}</th> |
---|
| 820 | <td> |
---|
| 821 | <div> |
---|
| 822 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
| 823 | </div> |
---|
| 824 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
| 825 | {footer_script require=\'jquery\'}{strip} |
---|
| 826 | function setPrivacyLevel(id, level){ |
---|
| 827 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
| 828 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
| 829 | { |
---|
| 830 | method: "POST", |
---|
| 831 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
| 832 | onSuccess: function(result) { |
---|
| 833 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
| 834 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
| 835 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
| 836 | } |
---|
| 837 | } |
---|
| 838 | ); |
---|
[30631] | 839 | } |
---|
[32135] | 840 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
| 841 | {/strip}{/footer_script} |
---|
| 842 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
| 843 | {foreach from=$available_permission_levels item=label key=level} |
---|
| 844 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
| 845 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
| 846 | {/foreach} |
---|
| 847 | </div> |
---|
| 848 | </td> |
---|
| 849 | </tr> |
---|
| 850 | </div> |
---|
| 851 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
| 852 | <div id="Description" class="imageInfo"> |
---|
| 853 | <tr> |
---|
| 854 | <th scope="row">{\'Description\'|@translate}</th> |
---|
| 855 | <td> |
---|
| 856 | {$COMMENT_IMG} |
---|
| 857 | </td> |
---|
| 858 | </tr> |
---|
| 859 | </div> |
---|
| 860 | {footer_script} |
---|
| 861 | jQuery(document).ready(function(){ |
---|
| 862 | jQuery(".imageComment").hide(); |
---|
| 863 | }); |
---|
| 864 | {/footer_script} |
---|
[32180] | 865 | {else if $addinfophotos.AIPWORDING == \'ID\'} |
---|
| 866 | <div id="ImageId" class="imageInfo"> |
---|
| 867 | <tr> |
---|
| 868 | <th scope="row">{\'Image id\'|@translate}</th> |
---|
| 869 | <td>{$addinfophotos.AIPDATA}</td> |
---|
| 870 | </tr> |
---|
| 871 | </div> |
---|
| 872 | {else if $addinfophotos.AIPWORDING == \'addedby\'} |
---|
| 873 | <div id="pab1" class="imageInfo"> |
---|
| 874 | <tr> |
---|
| 875 | <th scope="row">{\'Photo added by\'|@translate}</th> |
---|
| 876 | <td>{$PAB}</td> |
---|
| 877 | </tr> |
---|
| 878 | </div> |
---|
| 879 | {else if $addinfophotos.AIPWORDING == \'Download Counter\'} |
---|
| 880 | <div id="DownloadCounter" class="imageInfo"> |
---|
| 881 | <tr> |
---|
| 882 | <th scope="row">{\'Downloads\'|@translate}</th> |
---|
| 883 | <td>{$DOWNLOAD_COUNTER}</td> |
---|
| 884 | </tr> |
---|
| 885 | </div> |
---|
[32735] | 886 | {else if $addinfophotos.AIPWORDING == \'ColorPalette\'} |
---|
| 887 | {strip} |
---|
| 888 | {combine_css id="colorpalette.paletteinfo_css" path=$COLOR_PALETTE_PATH|cat:"template/palette_info.css"} |
---|
| 889 | {combine_script id="colorpalette.paletteinfo_js" require="jquery" load="async" path=$COLOR_PALETTE_PATH|cat:"template/palette_info.js"} |
---|
| 890 | {footer_script} |
---|
| 891 | var paletteUrl = \'{$palette_url}\'; |
---|
| 892 | {/footer_script} |
---|
| 893 | <div id="color_palette" class="imageInfo"> |
---|
| 894 | <tr> |
---|
| 895 | <th scope="row">{\'Palette\'|@translate}</th> |
---|
| 896 | <td id="palette_colors"> |
---|
| 897 | {foreach |
---|
| 898 | from=$palette_colors item=color name=color_loop} |
---|
| 899 | <div class="color_palette_item" |
---|
| 900 | style="background-color: #{$color.hex};" |
---|
| 901 | data-color="{$color.rgb}" |
---|
| 902 | onclick="paletteItemClick(this);" |
---|
| 903 | title="#{$color.hex}"></div> |
---|
| 904 | {/foreach} |
---|
| 905 | <a id="palette_search" href="#" style="display: none;">{\'Search\'|@translate}</a> |
---|
| 906 | <div style="clear: both"/> |
---|
| 907 | </td> |
---|
| 908 | </div> |
---|
| 909 | {/strip} |
---|
| 910 | {else if $addinfophotos.AIPWORDING == \'expiry_date\'} |
---|
| 911 | {if isset($expiry_date)} |
---|
| 912 | <div id="expd_expiry_date" class="imageInfo"> |
---|
| 913 | <tr> |
---|
| 914 | <th scope="row">{\'Expiry date\'|@translate}</th> |
---|
| 915 | <td>{\'%s, in %s days\'|@translate:$expiry_date:$expd_days}</td> |
---|
| 916 | </tr> |
---|
| 917 | </div> |
---|
| 918 | {/if} |
---|
| 919 | {if isset($expired_on_date)} |
---|
| 920 | <div id="expd_expired_on_date" class="imageInfo"> |
---|
| 921 | <tr> |
---|
| 922 | <th scope="row">{\'expired on\'|@translate}</th> |
---|
| 923 | <td>{$expired_on_date}</td> |
---|
| 924 | </tr> |
---|
| 925 | </div> |
---|
| 926 | {/if} |
---|
[32740] | 927 | {else if $addinfophotos.AIPWORDING == \'Copyrights\'} |
---|
| 928 | <div id="Copyrights_name" class="imageInfo"> |
---|
| 929 | <tr> |
---|
| 930 | <th>{\'Copyright\'|@translate}</th> |
---|
| 931 | <td> |
---|
| 932 | {if $CR_INFO_NAME} |
---|
| 933 | <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}: {$CR_INFO_DESCR}">{$CR_INFO_NAME}</a> |
---|
| 934 | {else} |
---|
| 935 | {\'N/A\'|@translate} |
---|
| 936 | {/if} |
---|
| 937 | </td> |
---|
| 938 | </tr> |
---|
| 939 | </div> |
---|
[33046] | 940 | {else if isset($addinfophotos.AIPDATA)} |
---|
[32180] | 941 | <div id="add_info" class="imageInfo"> |
---|
| 942 | <tr> |
---|
| 943 | <th scope="row label">{$addinfophotos.AIPWORDING}</th> |
---|
| 944 | <td class="value">{$addinfophotos.AIPDATA}</td> |
---|
| 945 | </tr> |
---|
| 946 | </div> |
---|
[32135] | 947 | {/if} |
---|
| 948 | {/foreach} |
---|
| 949 | <!--and mpp --> |
---|
| 950 | </tbody> |
---|
| 951 | </table> |
---|
| 952 | </div> |
---|
| 953 | </div> |
---|
| 954 | </div> |
---|
| 955 | <!-- metadata --> |
---|
| 956 | {if isset($metadata)} |
---|
| 957 | <div role="tabpanel" class="tab-pane" id="tab_metadata"> |
---|
| 958 | <div id="metadata" class="info"> |
---|
| 959 | <div class="table-responsive"> |
---|
| 960 | <table class="table table-sm"> |
---|
| 961 | <colgroup> |
---|
| 962 | <col class="w-50"> |
---|
| 963 | <col class="w-50"> |
---|
| 964 | </colgroup> |
---|
| 965 | <tbody> |
---|
| 966 | {foreach from=$metadata item=meta} |
---|
| 967 | {foreach from=$meta.lines item=value key=label} |
---|
| 968 | <tr> |
---|
| 969 | <th scope="row">{$label}</th> |
---|
| 970 | <td>{$value}</td> |
---|
| 971 | </tr> |
---|
| 972 | {/foreach} |
---|
| 973 | {/foreach} |
---|
| 974 | </tbody> |
---|
| 975 | </table> |
---|
| 976 | </div> |
---|
| 977 | </div> |
---|
| 978 | </div> |
---|
| 979 | {/if} |
---|
| 980 | {/if} |
---|
[30631] | 981 | |
---|
[32135] | 982 | <!-- comments --> |
---|
[33046] | 983 | {if isset($comment_add) || isset($COMMENT_COUNT))} |
---|
[32135] | 984 | <div role="tabpanel" class="tab-pane" id="tab_comments"> |
---|
| 985 | {include file=\'picture_info_comments.tpl\'} |
---|
| 986 | </div> |
---|
| 987 | {/if} |
---|
| 988 | </div> |
---|
| 989 | </div> |
---|
| 990 | |
---|
| 991 | '; |
---|
| 992 | |
---|
| 993 | $replasmart=' |
---|
| 994 | <ul data-role="listview" data-inset="true" id="PictureInfo"> |
---|
| 995 | {strip} |
---|
| 996 | <!--mpp --> |
---|
| 997 | {foreach from=$add_info_photos item=addinfophotos} |
---|
| 998 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
| 999 | <li id="Author" class="imageInfo"> |
---|
| 1000 | <dt>{\'Author\'|@translate}</dt> |
---|
| 1001 | <dd>{$INFO_AUTHOR}</dd> |
---|
| 1002 | </li> |
---|
| 1003 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
| 1004 | <li id="datecreate" class="imageInfo"> |
---|
| 1005 | <dt>{\'Created on\'|@translate}</dt> |
---|
| 1006 | <dd>{$INFO_CREATION_DATE}</dd> |
---|
| 1007 | </li> |
---|
| 1008 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
| 1009 | <li id="datepost" class="imageInfo"> |
---|
| 1010 | <dt>{\'Posted on\'|@translate}</dt> |
---|
| 1011 | <dd>{$INFO_POSTED_DATE}</dd> |
---|
| 1012 | </li> |
---|
| 1013 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
| 1014 | <li id="Dimensions" class="imageInfo"> |
---|
| 1015 | <dt>{\'Dimensions\'|@translate}</dt> |
---|
| 1016 | <dd>{$INFO_DIMENSIONS}</dd> |
---|
| 1017 | </li> |
---|
| 1018 | {else if $addinfophotos.AIPID == 5} |
---|
| 1019 | <li id="File" class="imageInfo"> |
---|
| 1020 | <dt>{\'File\'|@translate}</dt> |
---|
| 1021 | <dd>{$INFO_FILE}</dd> |
---|
| 1022 | </li> |
---|
| 1023 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
| 1024 | <li id="Filesize" class="imageInfo"> |
---|
| 1025 | <dt>{\'Filesize\'|@translate}</dt> |
---|
| 1026 | <dd>{$INFO_FILESIZE}</dd> |
---|
| 1027 | </li> |
---|
| 1028 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
| 1029 | <li id="Tags" class="imageInfo"> |
---|
| 1030 | <dt>{\'Tags\'|@translate}</dt> |
---|
| 1031 | <dd> |
---|
| 1032 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
| 1033 | </dd> |
---|
| 1034 | </li> |
---|
| 1035 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
| 1036 | <li id="Categories" class="imageInfo"> |
---|
| 1037 | <dt>{\'Albums\'|@translate}</dt> |
---|
| 1038 | <dd> |
---|
| 1039 | <ul> |
---|
| 1040 | {foreach from=$related_categories item=cat} |
---|
| 1041 | <li>{$cat}</li> |
---|
| 1042 | {/foreach} |
---|
| 1043 | </ul> |
---|
| 1044 | </dd> |
---|
| 1045 | </li> |
---|
| 1046 | {else if $addinfophotos.AIPID == 9} |
---|
| 1047 | <li id="Visits" class="imageInfo"> |
---|
| 1048 | <dt>{\'Visits\'|@translate}</dt> |
---|
| 1049 | <dd>{$INFO_VISITS}</dd> |
---|
| 1050 | </li> |
---|
| 1051 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
| 1052 | <li id="Average" class="imageInfo"> |
---|
| 1053 | <dt>{\'Rating score\'|@translate}</dt> |
---|
| 1054 | <dd> |
---|
| 1055 | {if $rate_summary.count} |
---|
| 1056 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
| 1057 | {else} |
---|
| 1058 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
| 1059 | {/if} |
---|
| 1060 | </dd> |
---|
| 1061 | </li> |
---|
| 1062 | {if isset($rating)} |
---|
| 1063 | <li id="rating" class="imageInfo"> |
---|
| 1064 | <dt> |
---|
| 1065 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
| 1066 | </dt> |
---|
| 1067 | <dd> |
---|
| 1068 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
| 1069 | <div> |
---|
| 1070 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
| 1071 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
| 1072 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
| 1073 | {else} |
---|
| 1074 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
| 1075 | {/if} |
---|
| 1076 | {/foreach} |
---|
| 1077 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
| 1078 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
| 1079 | {footer_script} |
---|
| 1080 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
| 1081 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
| 1082 | onSuccess : function(rating) {ldelim} |
---|
| 1083 | var e = document.getElementById("updateRate"); |
---|
| 1084 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
| 1085 | e = document.getElementById("ratingScore"); |
---|
| 1086 | if (e) e.innerHTML = rating.score; |
---|
| 1087 | e = document.getElementById("ratingCount"); |
---|
| 1088 | if (e) {ldelim} |
---|
| 1089 | if (rating.count == 1) {ldelim} |
---|
| 1090 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
| 1091 | } else {ldelim} |
---|
| 1092 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
| 1093 | } |
---|
| 1094 | {rdelim} |
---|
| 1095 | {rdelim}{rdelim} ); |
---|
| 1096 | {/footer_script} |
---|
| 1097 | {/strip} |
---|
| 1098 | </div> |
---|
| 1099 | </form> |
---|
| 1100 | </dd> |
---|
| 1101 | </li> |
---|
| 1102 | {/if} |
---|
| 1103 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
| 1104 | <li id="Privacy" class="imageInfo"> |
---|
| 1105 | <dt>{\'Who can see this photo?\'|@translate}</dt> |
---|
| 1106 | <dd> |
---|
| 1107 | <div> |
---|
| 1108 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
| 1109 | </div> |
---|
| 1110 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
| 1111 | {footer_script require=\'jquery\'}{strip} |
---|
| 1112 | function setPrivacyLevel(id, level){ |
---|
| 1113 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
| 1114 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
| 1115 | { |
---|
| 1116 | method: "POST", |
---|
| 1117 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
| 1118 | onSuccess: function(result) { |
---|
| 1119 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
| 1120 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
| 1121 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
| 1122 | } |
---|
| 1123 | } |
---|
| 1124 | ); |
---|
| 1125 | } |
---|
| 1126 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
| 1127 | {/strip}{/footer_script} |
---|
| 1128 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
| 1129 | {foreach from=$available_permission_levels item=label key=level} |
---|
| 1130 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
| 1131 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
| 1132 | {/foreach} |
---|
| 1133 | </div> |
---|
| 1134 | </dd> |
---|
| 1135 | </li> |
---|
| 1136 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
| 1137 | <li id="Description" class="imageInfo"> |
---|
| 1138 | <dt>{\'Description\'|@translate}</dt> |
---|
| 1139 | <dd> |
---|
| 1140 | {$COMMENT_IMG} |
---|
| 1141 | </dd> |
---|
| 1142 | </li> |
---|
| 1143 | {footer_script} |
---|
| 1144 | jQuery(document).ready(function(){ |
---|
| 1145 | jQuery(".imageComment").hide(); |
---|
| 1146 | }); |
---|
| 1147 | {/footer_script} |
---|
[32180] | 1148 | {else if $addinfophotos.AIPWORDING == \'ID\'} |
---|
| 1149 | <li id="ImageId" class="imageInfo"> |
---|
| 1150 | <dt>{\'Image id\'|@translate}</dt> |
---|
| 1151 | <dd>{$addinfophotos.AIPDATA}</dd> |
---|
| 1152 | </li> |
---|
| 1153 | {else if $addinfophotos.AIPWORDING == \'addedby\'} |
---|
| 1154 | <li id="pab1" class="imageInfo"> |
---|
| 1155 | <dt>{\'Photo added by\'|@translate}</dt> |
---|
| 1156 | <dd>{$PAB}</dd> |
---|
| 1157 | </li> |
---|
| 1158 | {else if $addinfophotos.AIPWORDING == \'Download Counter\'} |
---|
| 1159 | <li id="DownloadCounter" class="imageInfo"> |
---|
| 1160 | <dt>{\'Downloads\'|@translate}</dt> |
---|
| 1161 | <dd>{$DOWNLOAD_COUNTER}</dd> |
---|
| 1162 | </li> |
---|
[32735] | 1163 | {else if $addinfophotos.AIPWORDING == \'ColorPalette\'} |
---|
| 1164 | {$INFO_PALETTE} |
---|
| 1165 | {else if $addinfophotos.AIPWORDING == \'expiry_date\'} |
---|
| 1166 | {if isset($expiry_date)} |
---|
| 1167 | <li id="expd_expiry_date" class="imageInfo"> |
---|
| 1168 | <dt>{\'Expiry date\'|@translate}</dt> |
---|
| 1169 | <dd">{\'%s, in %s days\'|@translate:$expiry_date:$expd_days}</dd> |
---|
| 1170 | </li> |
---|
| 1171 | {/if} |
---|
| 1172 | {if isset($expired_on_date)} |
---|
| 1173 | <li id="expd_expired_on_date" class="imageInfo"> |
---|
| 1174 | <dt>{\'expired on\'|@translate}</dt> |
---|
| 1175 | <dd>{$expired_on_date}</dd> |
---|
| 1176 | </li> |
---|
| 1177 | {/if} |
---|
[32740] | 1178 | {else if $addinfophotos.AIPWORDING == \'Copyrights\'} |
---|
| 1179 | <li id="Copyrights_name" class="imageInfo"> |
---|
| 1180 | <dt>{\'Copyright\'|@translate}</dt> |
---|
| 1181 | <dd> |
---|
| 1182 | {if $CR_INFO_NAME} |
---|
| 1183 | <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}: {$CR_INFO_DESCR}">{$CR_INFO_NAME}</a> |
---|
| 1184 | {else} |
---|
| 1185 | {\'N/A\'|@translate} |
---|
| 1186 | {/if} |
---|
| 1187 | </dd> |
---|
| 1188 | </li> |
---|
[33046] | 1189 | {else if isset($addinfophotos.AIPDATA)} |
---|
[32135] | 1190 | <li id="add_info" class="imageInfo"> |
---|
| 1191 | <dt class="label">{$addinfophotos.AIPWORDING}</dt> |
---|
| 1192 | <dd class="value">{$addinfophotos.AIPDATA}</dd> |
---|
| 1193 | </li> |
---|
| 1194 | {/if} |
---|
| 1195 | {/foreach} |
---|
| 1196 | <!--and mpp --> |
---|
| 1197 | {if isset($metadata)} |
---|
| 1198 | '; |
---|
| 1199 | |
---|
| 1200 | $repladarkroom='<div id="theImageInfos" class="row justify-content-center"> |
---|
| 1201 | {if $theme_config->picture_info == \'cards\'}' |
---|
| 1202 | .$repladarkroomcards.' |
---|
| 1203 | {elseif $theme_config->picture_info == \'tabs\'}' |
---|
| 1204 | .$repladarkroomtabs.' |
---|
| 1205 | {elseif $theme_config->picture_info == \'sidebar\' || $theme_config->picture_info == \'disabled\'} |
---|
| 1206 | <div class="col-lg-8 col-md-10 col-12 mx-auto"> |
---|
| 1207 | {include file=\'picture_info_comments.tpl\'} |
---|
| 1208 | </div> |
---|
| 1209 | {/if} |
---|
| 1210 | </div> |
---|
| 1211 | |
---|
| 1212 | {if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if} |
---|
| 1213 | '; |
---|
| 1214 | if ($user['theme'] == 'bootstrap_darkroom'){ |
---|
| 1215 | $themeconfig = new \BootstrapDarkroom\Config(); |
---|
| 1216 | if($themeconfig->picture_info=='sidebar'){ |
---|
| 1217 | $search = '/(<dl id="standard" class="imageInfoTable">).*({if isset\(\$metadata\)})/is'; |
---|
| 1218 | return preg_replace($search, $replastandard , $content); |
---|
| 1219 | }else{ |
---|
| 1220 | $search = '/(<div id="theImageInfos" class="row justify-content-center">).*({if \!empty\(\$PLUGIN_PICTURE_AFTER\)}{\$PLUGIN_PICTURE_AFTER}{\/if})/is'; |
---|
| 1221 | return preg_replace($search, $repladarkroom , $content); |
---|
| 1222 | } |
---|
| 1223 | }else if ($user['theme'] == 'smartpocket'){ |
---|
| 1224 | $search = '/(<ul data-role="listview" data-inset="true" id="PictureInfo">).*({if isset\(\$metadata\)})/is'; |
---|
| 1225 | return preg_replace($search, $replasmart , $content); |
---|
| 1226 | }else{ |
---|
| 1227 | $search = '/(<dl id="standard" class="imageInfoTable">).*({if isset\(\$metadata\)})/is'; |
---|
| 1228 | return preg_replace($search, $replastandard , $content); |
---|
| 1229 | } |
---|
| 1230 | } |
---|
| 1231 | |
---|
[30631] | 1232 | add_event_handler('loc_begin_picture', 'add_InfoT'); |
---|
| 1233 | |
---|
| 1234 | function add_InfoT() { |
---|
[32151] | 1235 | global $conf, $page, $template, $lang, $pwg_loaded_plugins,$user; |
---|
[30631] | 1236 | |
---|
| 1237 | if (!empty($page['image_id'])) { |
---|
[32151] | 1238 | |
---|
| 1239 | if ($user['theme'] == 'bootstrap_darkroom'){ |
---|
| 1240 | $themeconfig = new \BootstrapDarkroom\Config(); |
---|
| 1241 | if($themeconfig->picture_info=='cards'){ |
---|
| 1242 | $tagaff = pwg_db_fetch_assoc(pwg_query('SELECT wording FROM '. ADD_PROP_PHOTO_TABLE.' ORDER BY orderprop DESC LIMIT 1')); |
---|
| 1243 | if($tagaff['wording']=='Tags'){ |
---|
| 1244 | $template->assign('TAGAFF',1); |
---|
| 1245 | }else{ |
---|
| 1246 | $template->assign('TAGAFF',0); |
---|
| 1247 | } |
---|
| 1248 | } |
---|
| 1249 | } |
---|
| 1250 | |
---|
| 1251 | |
---|
| 1252 | if (isset($pwg_loaded_plugins['ExtendedDescription'])){add_event_handler('AP_render_content', 'get_user_language_desc');} |
---|
[32735] | 1253 | |
---|
[30631] | 1254 | $tab_add_info_one_photo = tab_add_info_by_photo_show(); |
---|
[32135] | 1255 | |
---|
| 1256 | $query = 'select path FROM ' . IMAGES_TABLE . ' WHERE id = \''.$page['image_id'].'\';'; |
---|
| 1257 | $result = pwg_query($query); |
---|
| 1258 | $row = pwg_db_fetch_assoc($result); |
---|
| 1259 | $filename=$row['path']; |
---|
[32188] | 1260 | $exif = @exif_read_data($filename); |
---|
[32135] | 1261 | $imginfo = array(); |
---|
| 1262 | getimagesize($filename, $imginfo); |
---|
| 1263 | if (isset ($imginfo['APP13'])){$iptc = iptcparse($imginfo['APP13']);} |
---|
[30631] | 1264 | if (pwg_db_num_rows($tab_add_info_one_photo)) { |
---|
| 1265 | while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) { |
---|
[32135] | 1266 | if($info_photos['Typ']==2){ |
---|
| 1267 | $d = data_info_photosdate($page['image_id'], $info_photos['id_prop_pho']); |
---|
| 1268 | }else{ |
---|
| 1269 | $d = data_info_photos($page['image_id'], $info_photos['id_prop_pho']); |
---|
| 1270 | } |
---|
| 1271 | $row = pwg_db_fetch_assoc($d); |
---|
[30631] | 1272 | $items = array( |
---|
[30702] | 1273 | 'AIPID' => $info_photos['id_prop_pho'], |
---|
| 1274 | 'AIPORDER' => $info_photos['orderprop'], |
---|
| 1275 | 'AIPWORDING' => trigger_change('AP_render_content', $info_photos['wording']), |
---|
[30631] | 1276 | ); |
---|
[32135] | 1277 | if($info_photos['Typ']==2){ |
---|
[32565] | 1278 | if(isset($row['datadate'])){ |
---|
| 1279 | $items['AIPDATA']=format_date($row['datadate'],array('day_name', 'day', 'month', 'year','time')); |
---|
| 1280 | } |
---|
[32135] | 1281 | if($info_photos['wording']=="**delpho**"){ |
---|
| 1282 | $items['AIPWORDING'] =l10n('Delete photo'); |
---|
| 1283 | } |
---|
| 1284 | }else if($info_photos['Typ']==3){ |
---|
| 1285 | if(strpos($info_photos['dataprop'],':')!==false){ |
---|
| 1286 | $exiftab = explode(':', $info_photos['dataprop']); |
---|
| 1287 | if (isset($exif[$exiftab[0]][$exiftab[1]])){ |
---|
| 1288 | if (isset($pwg_loaded_plugins['exif_view'])){ |
---|
| 1289 | $items['AIPDATA']=exif_key_translation($exif[$exiftab[0]][$exiftab[1]], $exif[$exiftab[0]][$exiftab[1]]); |
---|
| 1290 | }else{ |
---|
| 1291 | $items['AIPDATA']= $exif[$exiftab[0]][$exiftab[1]]; |
---|
| 1292 | } |
---|
| 1293 | if ($info_photos['wording']!=$info_photos['dataprop']){ |
---|
| 1294 | }else if (isset($lang['exif_field_'.$exiftab[1]])){ |
---|
| 1295 | $items['AIPWORDING']= $lang['exif_field_'.$exiftab[1]]; |
---|
| 1296 | }else{ |
---|
| 1297 | $items['AIPWORDING']= $exiftab[1]; |
---|
| 1298 | } |
---|
| 1299 | } |
---|
| 1300 | }else{ |
---|
| 1301 | if (isset($exif[$info_photos['dataprop']])){ |
---|
| 1302 | if (isset($pwg_loaded_plugins['exif_view'])){ |
---|
| 1303 | $items['AIPDATA']=exif_key_translation($info_photos['dataprop'], $exif[$info_photos['dataprop']]); |
---|
| 1304 | }else{ |
---|
| 1305 | $items['AIPDATA']= $exif[$info_photos['dataprop']]; |
---|
| 1306 | } |
---|
| 1307 | if ($info_photos['wording']!=$info_photos['dataprop']){ |
---|
| 1308 | }else if (isset($lang['exif_field_'.$info_photos['dataprop']])){ |
---|
| 1309 | $items['AIPWORDING']= $lang['exif_field_'.$info_photos['dataprop']]; |
---|
| 1310 | }else{ |
---|
| 1311 | $items['AIPWORDING']= $info_photos['dataprop']; |
---|
| 1312 | } |
---|
| 1313 | } |
---|
| 1314 | } |
---|
| 1315 | }else if($info_photos['Typ']==6){ |
---|
| 1316 | $items['AIPWORDING']=trigger_change('AP_render_content', $info_photos['wording']); |
---|
| 1317 | if (isset($iptc[$info_photos['dataprop']])){ |
---|
| 1318 | $items['AIPDATA']=implode(", ", $iptc[$info_photos['dataprop']]); |
---|
| 1319 | } |
---|
[33046] | 1320 | }else if(isset($page['image_id']) and $info_photos['Typ']==1 AND $info_photos['dataprop']=='showid'){ |
---|
[32201] | 1321 | $items['AIPDATA']=$page['image_id']; |
---|
[32135] | 1322 | }else{ |
---|
[32204] | 1323 | if(isset($row['data'])){ |
---|
[32135] | 1324 | $items['AIPDATA']=trigger_change('AP_render_content', $row['data']); |
---|
[32204] | 1325 | }else{ |
---|
| 1326 | $items['AIPDATA']=''; |
---|
| 1327 | } |
---|
[32135] | 1328 | } |
---|
| 1329 | |
---|
[30631] | 1330 | |
---|
| 1331 | $template->append('add_info_photos', $items); |
---|
| 1332 | } |
---|
| 1333 | } |
---|
| 1334 | |
---|
| 1335 | $template->assign( |
---|
| 1336 | array( |
---|
| 1337 | 'A' => 'a' |
---|
| 1338 | )); |
---|
| 1339 | } |
---|
| 1340 | } |
---|
| 1341 | |
---|
| 1342 | ?> |
---|