1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Manage Properties Photos plugin for Piwigo by TEMMII | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2007-2020 ddtddt http://temmii.com/piwigo/ | |
---|
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 | // +-----------------------------------------------------------------------+ |
---|
21 | |
---|
22 | //Ajout du prefiltre |
---|
23 | add_event_handler('loc_begin_picture', 'add_info_photo_pre', 05); |
---|
24 | |
---|
25 | function add_info_photo_pre() { |
---|
26 | global $template; |
---|
27 | $template->set_prefilter('picture', 'add_info_photo_preT'); |
---|
28 | } |
---|
29 | |
---|
30 | function add_info_photo_preT($content, &$smarty) { |
---|
31 | |
---|
32 | global $conf, $user; |
---|
33 | |
---|
34 | $replastandard='<dl id="standard" class="imageInfoTable">{strip} |
---|
35 | {foreach from=$add_info_photos item=addinfophotos} |
---|
36 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
37 | <div id="Author" class="imageInfo"> |
---|
38 | <dt>{\'Author\'|@translate}</dt> |
---|
39 | <dd>{$INFO_AUTHOR}</dd> |
---|
40 | </div> |
---|
41 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
42 | <div id="datecreate" class="imageInfo"> |
---|
43 | <dt>{\'Created on\'|@translate}</dt> |
---|
44 | <dd>{$INFO_CREATION_DATE}</dd> |
---|
45 | </div> |
---|
46 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
47 | <div id="datepost" class="imageInfo"> |
---|
48 | <dt>{\'Posted on\'|@translate}</dt> |
---|
49 | <dd>{$INFO_POSTED_DATE}</dd> |
---|
50 | </div> |
---|
51 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
52 | <div id="Dimensions" class="imageInfo"> |
---|
53 | <dt>{\'Dimensions\'|@translate}</dt> |
---|
54 | <dd>{$INFO_DIMENSIONS}</dd> |
---|
55 | </div> |
---|
56 | {else if $addinfophotos.AIPID == 5} |
---|
57 | <div id="File" class="imageInfo"> |
---|
58 | <dt>{\'File\'|@translate}</dt> |
---|
59 | <dd>{$INFO_FILE}</dd> |
---|
60 | </div> |
---|
61 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
62 | <div id="Filesize" class="imageInfo"> |
---|
63 | <dt>{\'Filesize\'|@translate}</dt> |
---|
64 | <dd>{$INFO_FILESIZE}</dd> |
---|
65 | </div> |
---|
66 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
67 | <div id="Tags" class="imageInfo"> |
---|
68 | <dt>{\'Tags\'|@translate}</dt> |
---|
69 | <dd> |
---|
70 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
71 | </dd> |
---|
72 | </div> |
---|
73 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
74 | <div id="Categories" class="imageInfo"> |
---|
75 | <dt>{\'Albums\'|@translate}</dt> |
---|
76 | <dd> |
---|
77 | <ul> |
---|
78 | {foreach from=$related_categories item=cat} |
---|
79 | <li>{$cat}</li> |
---|
80 | {/foreach} |
---|
81 | </ul> |
---|
82 | </dd> |
---|
83 | </div> |
---|
84 | {else if $addinfophotos.AIPID == 9} |
---|
85 | <div id="Visits" class="imageInfo"> |
---|
86 | <dt>{\'Visits\'|@translate}</dt> |
---|
87 | <dd>{$INFO_VISITS}</dd> |
---|
88 | </div> |
---|
89 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
90 | <div id="Average" class="imageInfo"> |
---|
91 | <dt>{\'Rating score\'|@translate}</dt> |
---|
92 | <dd> |
---|
93 | {if $rate_summary.count} |
---|
94 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
95 | {else} |
---|
96 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
97 | {/if} |
---|
98 | </dd> |
---|
99 | </div> |
---|
100 | {if isset($rating)} |
---|
101 | <div id="rating" class="imageInfo"> |
---|
102 | <dt> |
---|
103 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
104 | </dt> |
---|
105 | <dd> |
---|
106 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
107 | <div> |
---|
108 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
109 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
110 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
111 | {else} |
---|
112 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
113 | {/if} |
---|
114 | {/foreach} |
---|
115 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
116 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
117 | {footer_script} |
---|
118 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
119 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
120 | onSuccess : function(rating) {ldelim} |
---|
121 | var e = document.getElementById("updateRate"); |
---|
122 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
123 | e = document.getElementById("ratingScore"); |
---|
124 | if (e) e.innerHTML = rating.score; |
---|
125 | e = document.getElementById("ratingCount"); |
---|
126 | if (e) {ldelim} |
---|
127 | if (rating.count == 1) {ldelim} |
---|
128 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
129 | } else {ldelim} |
---|
130 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
131 | } |
---|
132 | {rdelim} |
---|
133 | {rdelim}{rdelim} ); |
---|
134 | {/footer_script} |
---|
135 | {/strip} |
---|
136 | </div> |
---|
137 | </form> |
---|
138 | </dd> |
---|
139 | </div> |
---|
140 | {/if} |
---|
141 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
142 | <div id="Privacy" class="imageInfo"> |
---|
143 | <dt>{\'Who can see this photo?\'|@translate}</dt> |
---|
144 | <dd> |
---|
145 | <div> |
---|
146 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
147 | </div> |
---|
148 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
149 | {footer_script require=\'jquery\'}{strip} |
---|
150 | function setPrivacyLevel(id, level){ |
---|
151 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
152 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
153 | { |
---|
154 | method: "POST", |
---|
155 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
156 | onSuccess: function(result) { |
---|
157 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
158 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
159 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
160 | } |
---|
161 | } |
---|
162 | ); |
---|
163 | } |
---|
164 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
165 | {/strip}{/footer_script} |
---|
166 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
167 | {foreach from=$available_permission_levels item=label key=level} |
---|
168 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
169 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
170 | {/foreach} |
---|
171 | </div> |
---|
172 | </dd> |
---|
173 | </div> |
---|
174 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
175 | <div id="Description" class="imageInfo"> |
---|
176 | <dt>{\'Description\'|@translate}</dt> |
---|
177 | <dd> |
---|
178 | {$COMMENT_IMG} |
---|
179 | </dd> |
---|
180 | </div> |
---|
181 | {footer_script} |
---|
182 | jQuery(document).ready(function(){ |
---|
183 | jQuery(".imageComment").hide(); |
---|
184 | }); |
---|
185 | {/footer_script} |
---|
186 | {else if $addinfophotos.AIPDATA} |
---|
187 | <div id="add_info" class="imageInfo"> |
---|
188 | <dt class="label">{$addinfophotos.AIPWORDING}</dt> |
---|
189 | <dd class="value">{$addinfophotos.AIPDATA}</dd> |
---|
190 | </div> |
---|
191 | {/if} |
---|
192 | {/foreach} |
---|
193 | {/strip} |
---|
194 | </dl> |
---|
195 | {if isset($metadata)}'; |
---|
196 | |
---|
197 | $repladarkroomcards=' |
---|
198 | <div id="infopanel-left" class="col-lg-6 col-12"> |
---|
199 | <!-- Picture infos --> |
---|
200 | <div id="card-informations" class="card mb-2"> |
---|
201 | <div class="card-body"> |
---|
202 | <h5 class="card-title">{\'Information\'|@translate}</h5> |
---|
203 | <div id="info-content" class="d-flex flex-column"> |
---|
204 | {foreach from=$add_info_photos item=addinfophotos} |
---|
205 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
206 | <div id="Author" class="imageInfo"> |
---|
207 | <dl class="row mb-0"> |
---|
208 | <dt class="col-sm-5">{\'Author\'|@translate}</dt> |
---|
209 | <dd class="col-sm-7">{$INFO_AUTHOR}</dd> |
---|
210 | </dl> |
---|
211 | </div> |
---|
212 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
213 | <div id="datecreate" class="imageInfo"> |
---|
214 | <dl class="row mb-0"> |
---|
215 | <dt class="col-sm-5">{\'Created on\'|@translate}</dt> |
---|
216 | <dd class="col-sm-7">{$INFO_CREATION_DATE}</dd> |
---|
217 | </dl> |
---|
218 | </div> |
---|
219 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
220 | <div id="datepost" class="imageInfo"> |
---|
221 | <dl class="row mb-0"> |
---|
222 | <dt class="col-sm-5">{\'Posted on\'|@translate}</dt> |
---|
223 | <dd class="col-sm-7">{$INFO_POSTED_DATE}</dd> |
---|
224 | </dl> |
---|
225 | </div> |
---|
226 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
227 | <div id="Dimensions" class="imageInfo"> |
---|
228 | <dl class="row mb-0"> |
---|
229 | <dt class="col-sm-5">{\'Dimensions\'|@translate}</dt> |
---|
230 | <dd class="col-sm-7">{$INFO_DIMENSIONS}</dd> |
---|
231 | </dl> |
---|
232 | </div> |
---|
233 | {else if $addinfophotos.AIPID == 5} |
---|
234 | <div id="File" class="imageInfo"> |
---|
235 | <dl class="row mb-0"> |
---|
236 | <dt class="col-sm-5">{\'File\'|@translate}</dt> |
---|
237 | <dd class="col-sm-7">{$INFO_FILE}</dd> |
---|
238 | </dl> |
---|
239 | </div> |
---|
240 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
241 | <div id="Filesize" class="imageInfo"> |
---|
242 | <dl class="row mb-0"> |
---|
243 | <dt class="col-sm-5">{\'Filesize\'|@translate}</dt> |
---|
244 | <dd class="col-sm-7">{$INFO_FILESIZE}</dd> |
---|
245 | </dl> |
---|
246 | </div> |
---|
247 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
248 | {if $TAGAFF == 0} |
---|
249 | <div id="Tags" class="imageInfo"> |
---|
250 | <dl class="row mb-0"> |
---|
251 | <dt class="col-sm-5">{\'Tags\'|@translate}</dt> |
---|
252 | <dd class="col-sm-7"> |
---|
253 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
254 | </dd> |
---|
255 | </dl> |
---|
256 | </div> |
---|
257 | {/if} |
---|
258 | {if $TAGAFF == 1} |
---|
259 | </div> |
---|
260 | </div> |
---|
261 | </div> |
---|
262 | <div id="card-tags" class="card mb-2"> |
---|
263 | <div class="card-body"> |
---|
264 | <h5 class="card-title">{\'Tags\'|@translate}</h5> |
---|
265 | <div id="Tags" class="imageInfo"> |
---|
266 | {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} |
---|
267 | </div> |
---|
268 | </div> |
---|
269 | </div> |
---|
270 | {/if} |
---|
271 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
272 | <div id="Categories" class="imageInfo"> |
---|
273 | <dl class="row mb-0"> |
---|
274 | <dt class="col-sm-5">{\'Albums\'|@translate}</dt> |
---|
275 | <dd class="col-sm-7"> |
---|
276 | <ul> |
---|
277 | {foreach from=$related_categories item=cat} |
---|
278 | <li>{$cat}</li> |
---|
279 | {/foreach} |
---|
280 | </ul> |
---|
281 | </dd> |
---|
282 | </dl> |
---|
283 | </div> |
---|
284 | {else if $addinfophotos.AIPID == 9} |
---|
285 | <div id="Visits" class="imageInfo"> |
---|
286 | <dl class="row mb-0"> |
---|
287 | <dt class="col-sm-5">{\'Visits\'|@translate}</dt> |
---|
288 | <dd class="col-sm-7">{$INFO_VISITS}</dd> |
---|
289 | </dl> |
---|
290 | </div> |
---|
291 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
292 | <div id="Average" class="imageInfo"> |
---|
293 | <dl class="row mb-0"> |
---|
294 | <dt class="col-sm-5">{\'Rating score\'|@translate}</dt> |
---|
295 | <dd class="col-sm-7"> |
---|
296 | {if $rate_summary.count} |
---|
297 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
298 | {else} |
---|
299 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
300 | {/if} |
---|
301 | </dd> |
---|
302 | </dl> |
---|
303 | </div> |
---|
304 | {if isset($rating)} |
---|
305 | <div id="rating" class="imageInfo"> |
---|
306 | <dl class="row mb-0"> |
---|
307 | <dt class="col-sm-5"> |
---|
308 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
309 | </dt> |
---|
310 | <dd class="col-sm-7"> |
---|
311 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
312 | <div> |
---|
313 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
314 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
315 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
316 | {else} |
---|
317 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
318 | {/if} |
---|
319 | {/foreach} |
---|
320 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
321 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
322 | {footer_script} |
---|
323 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
324 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
325 | onSuccess : function(rating) {ldelim} |
---|
326 | var e = document.getElementById("updateRate"); |
---|
327 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
328 | e = document.getElementById("ratingScore"); |
---|
329 | if (e) e.innerHTML = rating.score; |
---|
330 | e = document.getElementById("ratingCount"); |
---|
331 | if (e) {ldelim} |
---|
332 | if (rating.count == 1) {ldelim} |
---|
333 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
334 | } else {ldelim} |
---|
335 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
336 | } |
---|
337 | {rdelim} |
---|
338 | {rdelim}{rdelim} ); |
---|
339 | {/footer_script} |
---|
340 | {/strip} |
---|
341 | </div> |
---|
342 | </form> |
---|
343 | </dd> |
---|
344 | </dl> |
---|
345 | </div> |
---|
346 | {/if} |
---|
347 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
348 | <div id="Privacy" class="imageInfo"> |
---|
349 | <dl class="row mb-0"> |
---|
350 | <dt class="col-sm-5">{\'Who can see this photo?\'|@translate}</dt> |
---|
351 | <dd class="col-sm-7"> |
---|
352 | <div> |
---|
353 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
354 | </div> |
---|
355 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
356 | {footer_script require=\'jquery\'}{strip} |
---|
357 | function setPrivacyLevel(id, level){ |
---|
358 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
359 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
360 | { |
---|
361 | method: "POST", |
---|
362 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
363 | onSuccess: function(result) { |
---|
364 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
365 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
366 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
367 | } |
---|
368 | } |
---|
369 | ); |
---|
370 | } |
---|
371 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
372 | {/strip}{/footer_script} |
---|
373 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
374 | {foreach from=$available_permission_levels item=label key=level} |
---|
375 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
376 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
377 | {/foreach} |
---|
378 | </div> |
---|
379 | </dd> |
---|
380 | </dl> |
---|
381 | </div> |
---|
382 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
383 | <div id="Description" class="imageInfo"> |
---|
384 | <dl class="row mb-0"> |
---|
385 | <dt class="col-sm-5">{\'Description\'|@translate}</dt> |
---|
386 | <dd class="col-sm-7"> |
---|
387 | {$COMMENT_IMG} |
---|
388 | </dd> |
---|
389 | </dl> |
---|
390 | </div> |
---|
391 | {footer_script} |
---|
392 | jQuery(document).ready(function(){ |
---|
393 | jQuery(".imageComment").hide(); |
---|
394 | }); |
---|
395 | {/footer_script} |
---|
396 | {else if $addinfophotos.AIPDATA} |
---|
397 | <div id="add_info" class="imageInfo"> |
---|
398 | <dl class="row mb-0"> |
---|
399 | <dt class="label col-sm-5">{$addinfophotos.AIPWORDING}</dt> |
---|
400 | <dd class="value col-sm-7">{$addinfophotos.AIPDATA}</dd> |
---|
401 | </dl> |
---|
402 | </div> |
---|
403 | {/if} |
---|
404 | {/foreach} |
---|
405 | {if $TAGAFF == 0} |
---|
406 | </div></div></div> |
---|
407 | {/if} |
---|
408 | </div> |
---|
409 | {if isset($metadata) || (isset($comment_add) || $COMMENT_COUNT > 0)} |
---|
410 | <div id="infopanel-right" class="col-lg-6 col-12"> |
---|
411 | <!-- metadata --> |
---|
412 | {if isset($metadata)} |
---|
413 | {if isset($loaded_plugins[\'exif_view\'])} |
---|
414 | {assign var="exif_make" value="{\'exif_field_Make\'|@translate}"} |
---|
415 | {assign var="exif_model" value="{\'exif_field_Model\'|@translate}"} |
---|
416 | {assign var="exif_lens" value="{\'exif_field_UndefinedTag:0xA434\'|@translate}"} |
---|
417 | {assign var="exif_fnumber" value="{\'exif_field_FNumber\'|@translate}"} |
---|
418 | {assign var="exif_iso" value="{\'exif_field_ISOSpeedRatings\'|@translate}"} |
---|
419 | {assign var="exif_focal_length" value="{\'exif_field_FocalLength\'|@translate}"} |
---|
420 | {assign var="exif_flash" value="{\'exif_field_Flash\'|@translate}"} |
---|
421 | {assign var="exif_exposure_time" value="{\'exif_field_ExposureTime\'|@translate}"} |
---|
422 | {assign var="exif_exposure_bias" value="{\'exif_field_ExposureBiasValue\'|@translate}"} |
---|
423 | {else} |
---|
424 | {assign var="exif_make" value="Make"} |
---|
425 | {assign var="exif_model" value="Model"} |
---|
426 | {assign var="exif_lens" value="UndefinedTag:0xA434"} |
---|
427 | {assign var="exif_fnumber" value="FNumber"} |
---|
428 | {assign var="exif_iso" value="ISOSpeedRatings"} |
---|
429 | {assign var="exif_focal_length" value="FocalLength"} |
---|
430 | {assign var="exif_flash" value="Flash"} |
---|
431 | {assign var="exif_exposure_time" value="ExposureTime"} |
---|
432 | {assign var="exif_exposure_bias" value="ExposureBiasValue"} |
---|
433 | {/if} |
---|
434 | |
---|
435 | <div id="card-metadata" class="card mb-2"> |
---|
436 | <div class="card-body"> |
---|
437 | <h5 class="card-title">{\'EXIF Metadata\'|@translate}</h5> |
---|
438 | <div id="metadata"> |
---|
439 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_make}", $metadata.0.lines) || array_key_exists("{$exif_model}", $metadata.0.lines))} |
---|
440 | <div class="row" style="line-height: 40px"> |
---|
441 | <div class="col-12"> |
---|
442 | <span class="camera-compact fa-3x mr-3" title="{$exif_make} & {$exif_model}"></span> |
---|
443 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_make}", $metadata.0.lines))}{$metadata.0.lines[{$exif_make}]}{/if} |
---|
444 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_model}", $metadata.0.lines))}{$metadata.0.lines[{$exif_model}]}{/if} |
---|
445 | </div> |
---|
446 | </div> |
---|
447 | {/if} |
---|
448 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_lens}", $metadata.0.lines))} |
---|
449 | <div class="row" style="line-height: 40px"> |
---|
450 | <div class="col-12"> |
---|
451 | <span class="camera-lens-h fa-3x mr-3" title="{$exif_lens}"></span> |
---|
452 | {$metadata.0.lines[{$exif_lens}]} |
---|
453 | </div> |
---|
454 | </div> |
---|
455 | {/if} |
---|
456 | <div class="row"> |
---|
457 | <div class="col-12{if $theme_config->fluid_width} col-xl-10{/if}"> |
---|
458 | <div class="row"> |
---|
459 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_fnumber}", $metadata.0.lines))} |
---|
460 | <div class="col-6 col-sm-4"> |
---|
461 | <span class="camera-aperture fa-2x pr-2" title="{$exif_fnumber}"></span> f/{$metadata.0.lines[{$exif_fnumber}]} |
---|
462 | </div> |
---|
463 | {/if} |
---|
464 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_focal_length}", $metadata.0.lines))} |
---|
465 | <div class="col-6 col-sm-4"> |
---|
466 | <span class="camera-focal-length fa-2x pr-2" title="{$exif_focal_length}"></span> {$metadata.0.lines[{$exif_focal_length}]} |
---|
467 | </div> |
---|
468 | {/if} |
---|
469 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_exposure_time}", $metadata.0.lines))} |
---|
470 | <div class="col-6 col-sm-4"> |
---|
471 | <span class="camera-shutter-speed fa-2x pr-2" title="{$exif_exposure_time}"></span> {$metadata.0.lines[{$exif_exposure_time}]} |
---|
472 | </div> |
---|
473 | {/if} |
---|
474 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_iso}", $metadata.0.lines))} |
---|
475 | <div class="col-6 col-sm-4"> |
---|
476 | <span class="camera-iso fa-2x pr-2" title="{$exif_iso}"></span> {$metadata.0.lines[{$exif_iso}]} |
---|
477 | </div> |
---|
478 | {/if} |
---|
479 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_exposure_bias}", $metadata.0.lines))} |
---|
480 | <div class="col-6 col-sm-4"> |
---|
481 | <span class="camera-exposure fa-2x pr-2" title="{$exif_exposure_bias}"></span> {$metadata.0.lines[{$exif_exposure_bias}]} |
---|
482 | </div> |
---|
483 | {/if} |
---|
484 | {if is_array($metadata.0.lines) && (array_key_exists("{$exif_flash}", $metadata.0.lines))} |
---|
485 | <div class="col-6 col-sm-4"> |
---|
486 | <span class="camera-flash fa-2x pr-2 float-left h-100" title="{$exif_flash}"></span><div> {$metadata.0.lines[{$exif_flash}]}</div> |
---|
487 | </div> |
---|
488 | {/if} |
---|
489 | </div> |
---|
490 | </div> |
---|
491 | </div> |
---|
492 | </div> |
---|
493 | <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> |
---|
494 | {footer_script require=\'jquery\'} |
---|
495 | $(\'#show_exif_data\').on(\'click\', function() { |
---|
496 | if ($(\'#full_exif_data\').hasClass(\'d-none\')) { |
---|
497 | $(\'#full_exif_data\').addClass(\'d-flex\').removeClass(\'d-none\'); |
---|
498 | $(\'#show_exif_data\').html(\'<i class="fas fa-info mr-1"></i> {"Hide EXIF data"|@translate}\'); |
---|
499 | } else { |
---|
500 | $(\'#full_exif_data\').addClass(\'d-none\').removeClass(\'d-flex\'); |
---|
501 | $(\'#show_exif_data\').html(\'<i class="fas fa-info mr-1"></i> {"Show EXIF data"|@translate}\'); |
---|
502 | } |
---|
503 | }); |
---|
504 | {/footer_script} |
---|
505 | <div id="full_exif_data" class="d-none flex-column mt-2"> |
---|
506 | {foreach from=$metadata item=meta} |
---|
507 | {foreach from=$meta.lines item=value key=label} |
---|
508 | <div> |
---|
509 | <dl class="row mb-0"> |
---|
510 | <dt class="col-sm-6">{$label}</dt> |
---|
511 | <dd class="col-sm-6">{$value}</td> |
---|
512 | </tr> |
---|
513 | </dl> |
---|
514 | </div> |
---|
515 | {/foreach} |
---|
516 | {/foreach} |
---|
517 | </div> |
---|
518 | </div> |
---|
519 | </div> |
---|
520 | {/if} |
---|
521 | <div id="card-comments" class="ml-2"> |
---|
522 | {include file=\'picture_info_comments.tpl\'} |
---|
523 | </div> |
---|
524 | </div> |
---|
525 | {/if} |
---|
526 | '; |
---|
527 | |
---|
528 | $repladarkroomtabs=' |
---|
529 | <div id="infopanel" class="col-lg-8 col-md-10 col-12 mx-auto"> |
---|
530 | <!-- Nav tabs --> |
---|
531 | <ul class="nav nav-tabs nav-justified flex-column flex-sm-row" role="tablist"> |
---|
532 | {if $theme_config->picture_info == \'tabs\' || (get_device() != \'desktop\' && $theme_config->picture_info != \'disabled\')} |
---|
533 | <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> |
---|
534 | {if isset($metadata)} |
---|
535 | <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> |
---|
536 | {/if} |
---|
537 | {/if} |
---|
538 | {if isset($comment_add) || $COMMENT_COUNT > 0} |
---|
539 | <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> |
---|
540 | {/if} |
---|
541 | </ul> |
---|
542 | |
---|
543 | <!-- Tab panes --> |
---|
544 | <div class="tab-content d-flex justify-content-center"> |
---|
545 | {if $theme_config->picture_info === \'tabs\' || (get_device() != \'desktop\' && $theme_config->picture_info != \'disabled\')} |
---|
546 | <div role="tabpanel" class="tab-pane active" id="tab_info"> |
---|
547 | <div id="info-content" class="info"> |
---|
548 | <div class="table-responsive"> |
---|
549 | <table class="table table-sm"> |
---|
550 | <colgroup> |
---|
551 | <col class="w-50"> |
---|
552 | <col class="w-50"> |
---|
553 | </colgroup> |
---|
554 | <tbody> |
---|
555 | <!--mpp --> |
---|
556 | {foreach from=$add_info_photos item=addinfophotos} |
---|
557 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
558 | <div id="Author" class="imageInfo"> |
---|
559 | <tr> |
---|
560 | <th scope="row">{\'Author\'|@translate}</th> |
---|
561 | <td>{$INFO_AUTHOR}</td> |
---|
562 | </tr> |
---|
563 | </div> |
---|
564 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
565 | <div id="datecreate" class="imageInfo"> |
---|
566 | <tr> |
---|
567 | <th scope="row">{\'Created on\'|@translate}</th> |
---|
568 | <td>{$INFO_CREATION_DATE}</td> |
---|
569 | </tr> |
---|
570 | </div> |
---|
571 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
572 | <div id="datepost" class="imageInfo"> |
---|
573 | <tr> |
---|
574 | <th scope="row">{\'Posted on\'|@translate}</th> |
---|
575 | <td>{$INFO_POSTED_DATE}</td> |
---|
576 | </tr> |
---|
577 | </div> |
---|
578 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
579 | <div id="Dimensions" class="imageInfo"> |
---|
580 | <tr> |
---|
581 | <th scope="row">{\'Dimensions\'|@translate}</th> |
---|
582 | <td>{$INFO_DIMENSIONS}</td> |
---|
583 | </tr> |
---|
584 | </div> |
---|
585 | {else if $addinfophotos.AIPID == 5} |
---|
586 | <div id="File" class="imageInfo"> |
---|
587 | <tr> |
---|
588 | <th scope="row">{\'File\'|@translate}</th> |
---|
589 | <td>{$INFO_FILE}</td> |
---|
590 | </tr> |
---|
591 | </div> |
---|
592 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
593 | <div id="Filesize" class="imageInfo"> |
---|
594 | <tr> |
---|
595 | <th scope="row">{\'Filesize\'|@translate}</th> |
---|
596 | <td>{$INFO_FILESIZE}</td> |
---|
597 | </tr> |
---|
598 | </div> |
---|
599 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
600 | <div id="Tags" class="imageInfo"> |
---|
601 | <tr> |
---|
602 | <th scope="row">{\'Tags\'|@translate}</th> |
---|
603 | <td> |
---|
604 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
605 | </td> |
---|
606 | </tr> |
---|
607 | </div> |
---|
608 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
609 | <div id="Categories" class="imageInfo"> |
---|
610 | <tr> |
---|
611 | <th scope="row">{\'Albums\'|@translate}</th> |
---|
612 | <td> |
---|
613 | <ul> |
---|
614 | {foreach from=$related_categories item=cat} |
---|
615 | <li>{$cat}</li> |
---|
616 | {/foreach} |
---|
617 | </ul> |
---|
618 | </td> |
---|
619 | </tr> |
---|
620 | </div> |
---|
621 | {else if $addinfophotos.AIPID == 9} |
---|
622 | <div id="Visits" class="imageInfo"> |
---|
623 | <tr> |
---|
624 | <th scope="row">{\'Visits\'|@translate}</th> |
---|
625 | <td>{$INFO_VISITS}</td> |
---|
626 | </tr> |
---|
627 | </div> |
---|
628 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
629 | <div id="Average" class="imageInfo"> |
---|
630 | <tr> |
---|
631 | <th scope="row">{\'Rating score\'|@translate}</th> |
---|
632 | <td> |
---|
633 | {if $rate_summary.count} |
---|
634 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
635 | {else} |
---|
636 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
637 | {/if} |
---|
638 | </td> |
---|
639 | </tr> |
---|
640 | </div> |
---|
641 | {if isset($rating)} |
---|
642 | <div id="rating" class="imageInfo"> |
---|
643 | <tr> |
---|
644 | <th scope="row"> |
---|
645 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
646 | </th> |
---|
647 | <td> |
---|
648 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
649 | <div> |
---|
650 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
651 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
652 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
653 | {else} |
---|
654 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
655 | {/if} |
---|
656 | {/foreach} |
---|
657 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
658 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
659 | {footer_script} |
---|
660 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
661 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
662 | onSuccess : function(rating) {ldelim} |
---|
663 | var e = document.getElementById("updateRate"); |
---|
664 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
665 | e = document.getElementById("ratingScore"); |
---|
666 | if (e) e.innerHTML = rating.score; |
---|
667 | e = document.getElementById("ratingCount"); |
---|
668 | if (e) {ldelim} |
---|
669 | if (rating.count == 1) {ldelim} |
---|
670 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
671 | } else {ldelim} |
---|
672 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
673 | } |
---|
674 | {rdelim} |
---|
675 | {rdelim}{rdelim} ); |
---|
676 | {/footer_script} |
---|
677 | {/strip} |
---|
678 | </div> |
---|
679 | </form> |
---|
680 | </td> |
---|
681 | </tr> |
---|
682 | </div> |
---|
683 | {/if} |
---|
684 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
685 | <div id="Privacy" class="imageInfo"> |
---|
686 | <tr> |
---|
687 | <th scope="row">{\'Who can see this photo?\'|@translate}</th> |
---|
688 | <td> |
---|
689 | <div> |
---|
690 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
691 | </div> |
---|
692 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
693 | {footer_script require=\'jquery\'}{strip} |
---|
694 | function setPrivacyLevel(id, level){ |
---|
695 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
696 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
697 | { |
---|
698 | method: "POST", |
---|
699 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
700 | onSuccess: function(result) { |
---|
701 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
702 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
703 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
704 | } |
---|
705 | } |
---|
706 | ); |
---|
707 | } |
---|
708 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
709 | {/strip}{/footer_script} |
---|
710 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
711 | {foreach from=$available_permission_levels item=label key=level} |
---|
712 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
713 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
714 | {/foreach} |
---|
715 | </div> |
---|
716 | </td> |
---|
717 | </tr> |
---|
718 | </div> |
---|
719 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
720 | <div id="Description" class="imageInfo"> |
---|
721 | <tr> |
---|
722 | <th scope="row">{\'Description\'|@translate}</th> |
---|
723 | <td> |
---|
724 | {$COMMENT_IMG} |
---|
725 | </td> |
---|
726 | </tr> |
---|
727 | </div> |
---|
728 | {footer_script} |
---|
729 | jQuery(document).ready(function(){ |
---|
730 | jQuery(".imageComment").hide(); |
---|
731 | }); |
---|
732 | {/footer_script} |
---|
733 | {else if $addinfophotos.AIPDATA} |
---|
734 | <div id="add_info" class="imageInfo"> |
---|
735 | <tr> |
---|
736 | <th scope="row label">{$addinfophotos.AIPWORDING}</th> |
---|
737 | <td class="value">{$addinfophotos.AIPDATA}</td> |
---|
738 | </tr> |
---|
739 | </div> |
---|
740 | {/if} |
---|
741 | {/foreach} |
---|
742 | <!--and mpp --> |
---|
743 | </tbody> |
---|
744 | </table> |
---|
745 | </div> |
---|
746 | </div> |
---|
747 | </div> |
---|
748 | <!-- metadata --> |
---|
749 | {if isset($metadata)} |
---|
750 | <div role="tabpanel" class="tab-pane" id="tab_metadata"> |
---|
751 | <div id="metadata" class="info"> |
---|
752 | <div class="table-responsive"> |
---|
753 | <table class="table table-sm"> |
---|
754 | <colgroup> |
---|
755 | <col class="w-50"> |
---|
756 | <col class="w-50"> |
---|
757 | </colgroup> |
---|
758 | <tbody> |
---|
759 | {foreach from=$metadata item=meta} |
---|
760 | {foreach from=$meta.lines item=value key=label} |
---|
761 | <tr> |
---|
762 | <th scope="row">{$label}</th> |
---|
763 | <td>{$value}</td> |
---|
764 | </tr> |
---|
765 | {/foreach} |
---|
766 | {/foreach} |
---|
767 | </tbody> |
---|
768 | </table> |
---|
769 | </div> |
---|
770 | </div> |
---|
771 | </div> |
---|
772 | {/if} |
---|
773 | {/if} |
---|
774 | |
---|
775 | <!-- comments --> |
---|
776 | {if isset($comment_add) || $COMMENT_COUNT > 0} |
---|
777 | <div role="tabpanel" class="tab-pane" id="tab_comments"> |
---|
778 | {include file=\'picture_info_comments.tpl\'} |
---|
779 | </div> |
---|
780 | {/if} |
---|
781 | </div> |
---|
782 | </div> |
---|
783 | |
---|
784 | '; |
---|
785 | |
---|
786 | $replasmart=' |
---|
787 | <ul data-role="listview" data-inset="true" id="PictureInfo"> |
---|
788 | {strip} |
---|
789 | <!--mpp --> |
---|
790 | {foreach from=$add_info_photos item=addinfophotos} |
---|
791 | {if $addinfophotos.AIPID == 1 and isset($INFO_AUTHOR)} |
---|
792 | <li id="Author" class="imageInfo"> |
---|
793 | <dt>{\'Author\'|@translate}</dt> |
---|
794 | <dd>{$INFO_AUTHOR}</dd> |
---|
795 | </li> |
---|
796 | {else if $addinfophotos.AIPID == 2 and isset($INFO_CREATION_DATE)} |
---|
797 | <li id="datecreate" class="imageInfo"> |
---|
798 | <dt>{\'Created on\'|@translate}</dt> |
---|
799 | <dd>{$INFO_CREATION_DATE}</dd> |
---|
800 | </li> |
---|
801 | {else if $addinfophotos.AIPID == 3 and isset($INFO_POSTED_DATE)} |
---|
802 | <li id="datepost" class="imageInfo"> |
---|
803 | <dt>{\'Posted on\'|@translate}</dt> |
---|
804 | <dd>{$INFO_POSTED_DATE}</dd> |
---|
805 | </li> |
---|
806 | {else if $addinfophotos.AIPID == 4 and isset($INFO_DIMENSIONS)} |
---|
807 | <li id="Dimensions" class="imageInfo"> |
---|
808 | <dt>{\'Dimensions\'|@translate}</dt> |
---|
809 | <dd>{$INFO_DIMENSIONS}</dd> |
---|
810 | </li> |
---|
811 | {else if $addinfophotos.AIPID == 5} |
---|
812 | <li id="File" class="imageInfo"> |
---|
813 | <dt>{\'File\'|@translate}</dt> |
---|
814 | <dd>{$INFO_FILE}</dd> |
---|
815 | </li> |
---|
816 | {else if $addinfophotos.AIPID == 6 and isset($INFO_FILESIZE)} |
---|
817 | <li id="Filesize" class="imageInfo"> |
---|
818 | <dt>{\'Filesize\'|@translate}</dt> |
---|
819 | <dd>{$INFO_FILESIZE}</dd> |
---|
820 | </li> |
---|
821 | {else if $addinfophotos.AIPID == 7 and isset($related_tags)} |
---|
822 | <li id="Tags" class="imageInfo"> |
---|
823 | <dt>{\'Tags\'|@translate}</dt> |
---|
824 | <dd> |
---|
825 | {foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}<a href="{$tag.URL}">{$tag.name}</a>{/foreach} |
---|
826 | </dd> |
---|
827 | </li> |
---|
828 | {else if $addinfophotos.AIPID == 8 and isset($related_categories)} |
---|
829 | <li id="Categories" class="imageInfo"> |
---|
830 | <dt>{\'Albums\'|@translate}</dt> |
---|
831 | <dd> |
---|
832 | <ul> |
---|
833 | {foreach from=$related_categories item=cat} |
---|
834 | <li>{$cat}</li> |
---|
835 | {/foreach} |
---|
836 | </ul> |
---|
837 | </dd> |
---|
838 | </li> |
---|
839 | {else if $addinfophotos.AIPID == 9} |
---|
840 | <li id="Visits" class="imageInfo"> |
---|
841 | <dt>{\'Visits\'|@translate}</dt> |
---|
842 | <dd>{$INFO_VISITS}</dd> |
---|
843 | </li> |
---|
844 | {else if $addinfophotos.AIPID == 10 and isset($rate_summary)} |
---|
845 | <li id="Average" class="imageInfo"> |
---|
846 | <dt>{\'Rating score\'|@translate}</dt> |
---|
847 | <dd> |
---|
848 | {if $rate_summary.count} |
---|
849 | <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$rate_summary.count|@translate_dec:\'%d rate\':\'%d rates\'})</span> |
---|
850 | {else} |
---|
851 | <span id="ratingScore">{\'no rate\'|@translate}</span> <span id="ratingCount"></span> |
---|
852 | {/if} |
---|
853 | </dd> |
---|
854 | </li> |
---|
855 | {if isset($rating)} |
---|
856 | <li id="rating" class="imageInfo"> |
---|
857 | <dt> |
---|
858 | <span id="updateRate">{if isset($rating.USER_RATE)}{\'Update your rating\'|@translate}{else}{\'Rate this photo\'|@translate}{/if}</span> |
---|
859 | </dt> |
---|
860 | <dd> |
---|
861 | <form action="{$rating.F_ACTION}" method="post" id="rateForm" style="margin:0;"> |
---|
862 | <div> |
---|
863 | {foreach from=$rating.marks item=mark name=rate_loop} |
---|
864 | {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} |
---|
865 | <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}"> |
---|
866 | {else} |
---|
867 | <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}"> |
---|
868 | {/if} |
---|
869 | {/foreach} |
---|
870 | {strip}{combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
871 | {combine_script id=\'rating\' load=\'async\' require=\'core.scripts\' path=\'themes/default/js/rating.js\'} |
---|
872 | {footer_script} |
---|
873 | var _pwgRatingAutoQueue = _pwgRatingAutoQueue||[]; |
---|
874 | _pwgRatingAutoQueue.push( {ldelim}rootUrl: \'{$ROOT_URL}\', image_id: {$current.id}, |
---|
875 | onSuccess : function(rating) {ldelim} |
---|
876 | var e = document.getElementById("updateRate"); |
---|
877 | if (e) e.innerHTML = "{\'Update your rating\'|@translate|@escape:\'javascript\'}"; |
---|
878 | e = document.getElementById("ratingScore"); |
---|
879 | if (e) e.innerHTML = rating.score; |
---|
880 | e = document.getElementById("ratingCount"); |
---|
881 | if (e) {ldelim} |
---|
882 | if (rating.count == 1) {ldelim} |
---|
883 | e.innerHTML = "({\'%d rate\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
884 | } else {ldelim} |
---|
885 | e.innerHTML = "({\'%d rates\'|@translate|@escape:\'javascript\'})".replace( "%d", rating.count); |
---|
886 | } |
---|
887 | {rdelim} |
---|
888 | {rdelim}{rdelim} ); |
---|
889 | {/footer_script} |
---|
890 | {/strip} |
---|
891 | </div> |
---|
892 | </form> |
---|
893 | </dd> |
---|
894 | </li> |
---|
895 | {/if} |
---|
896 | {else if $addinfophotos.AIPID == 11 and $display_info.privacy_level and isset($available_permission_levels)} |
---|
897 | <li id="Privacy" class="imageInfo"> |
---|
898 | <dt>{\'Who can see this photo?\'|@translate}</dt> |
---|
899 | <dd> |
---|
900 | <div> |
---|
901 | <a id="privacyLevelLink" href>{$available_permission_levels[$current.level]}</a> |
---|
902 | </div> |
---|
903 | {combine_script id=\'core.scripts\' load=\'async\' path=\'themes/default/js/scripts.js\'} |
---|
904 | {footer_script require=\'jquery\'}{strip} |
---|
905 | function setPrivacyLevel(id, level){ |
---|
906 | (new PwgWS(\'{$ROOT_URL}\')).callService( |
---|
907 | "pwg.images.setPrivacyLevel", { image_id:id, level:level}, |
---|
908 | { |
---|
909 | method: "POST", |
---|
910 | onFailure: function(num, text) { alert(num + " " + text); }, |
---|
911 | onSuccess: function(result) { |
---|
912 | jQuery(\'#privacyLevelBox .switchCheck\').css(\'visibility\',\'hidden\'); |
---|
913 | jQuery(\'#switchLevel\'+level).prev(\'.switchCheck\').css(\'visibility\',\'visible\'); |
---|
914 | jQuery(\'#privacyLevelLink\').text(jQuery(\'#switchLevel\'+level).text()); |
---|
915 | } |
---|
916 | } |
---|
917 | ); |
---|
918 | } |
---|
919 | (SwitchBox=window.SwitchBox||[]).push("#privacyLevelLink", "#privacyLevelBox"); |
---|
920 | {/strip}{/footer_script} |
---|
921 | <div id="privacyLevelBox" class="switchBox" style="display:none"> |
---|
922 | {foreach from=$available_permission_levels item=label key=level} |
---|
923 | <span class="switchCheck"{if $level != $current.level} style="visibility:hidden"{/if}>✔ </span> |
---|
924 | <a id="switchLevel{$level}" href="javascript:setPrivacyLevel({$current.id},{$level})">{$label}</a><br> |
---|
925 | {/foreach} |
---|
926 | </div> |
---|
927 | </dd> |
---|
928 | </li> |
---|
929 | {else if $addinfophotos.AIPWORDING == \'Description\' and isset($COMMENT_IMG)} |
---|
930 | <li id="Description" class="imageInfo"> |
---|
931 | <dt>{\'Description\'|@translate}</dt> |
---|
932 | <dd> |
---|
933 | {$COMMENT_IMG} |
---|
934 | </dd> |
---|
935 | </li> |
---|
936 | {footer_script} |
---|
937 | jQuery(document).ready(function(){ |
---|
938 | jQuery(".imageComment").hide(); |
---|
939 | }); |
---|
940 | {/footer_script} |
---|
941 | {else if $addinfophotos.AIPDATA} |
---|
942 | <li id="add_info" class="imageInfo"> |
---|
943 | <dt class="label">{$addinfophotos.AIPWORDING}</dt> |
---|
944 | <dd class="value">{$addinfophotos.AIPDATA}</dd> |
---|
945 | </li> |
---|
946 | {/if} |
---|
947 | {/foreach} |
---|
948 | <!--and mpp --> |
---|
949 | {if isset($metadata)} |
---|
950 | '; |
---|
951 | |
---|
952 | $repladarkroom='<div id="theImageInfos" class="row justify-content-center"> |
---|
953 | {if $theme_config->picture_info == \'cards\'}' |
---|
954 | .$repladarkroomcards.' |
---|
955 | {elseif $theme_config->picture_info == \'tabs\'}' |
---|
956 | .$repladarkroomtabs.' |
---|
957 | {elseif $theme_config->picture_info == \'sidebar\' || $theme_config->picture_info == \'disabled\'} |
---|
958 | <div class="col-lg-8 col-md-10 col-12 mx-auto"> |
---|
959 | {include file=\'picture_info_comments.tpl\'} |
---|
960 | </div> |
---|
961 | {/if} |
---|
962 | </div> |
---|
963 | |
---|
964 | {if !empty($PLUGIN_PICTURE_AFTER)}{$PLUGIN_PICTURE_AFTER}{/if} |
---|
965 | '; |
---|
966 | if ($user['theme'] == 'bootstrap_darkroom'){ |
---|
967 | $themeconfig = new \BootstrapDarkroom\Config(); |
---|
968 | if($themeconfig->picture_info=='sidebar'){ |
---|
969 | $search = '/(<dl id="standard" class="imageInfoTable">).*({if isset\(\$metadata\)})/is'; |
---|
970 | return preg_replace($search, $replastandard , $content); |
---|
971 | }else{ |
---|
972 | $search = '/(<div id="theImageInfos" class="row justify-content-center">).*({if \!empty\(\$PLUGIN_PICTURE_AFTER\)}{\$PLUGIN_PICTURE_AFTER}{\/if})/is'; |
---|
973 | return preg_replace($search, $repladarkroom , $content); |
---|
974 | } |
---|
975 | }else if ($user['theme'] == 'smartpocket'){ |
---|
976 | $search = '/(<ul data-role="listview" data-inset="true" id="PictureInfo">).*({if isset\(\$metadata\)})/is'; |
---|
977 | return preg_replace($search, $replasmart , $content); |
---|
978 | }else{ |
---|
979 | $search = '/(<dl id="standard" class="imageInfoTable">).*({if isset\(\$metadata\)})/is'; |
---|
980 | return preg_replace($search, $replastandard , $content); |
---|
981 | } |
---|
982 | } |
---|
983 | |
---|
984 | add_event_handler('loc_begin_picture', 'add_InfoT'); |
---|
985 | |
---|
986 | function add_InfoT() { |
---|
987 | global $conf, $page, $template, $lang, $pwg_loaded_plugins,$user; |
---|
988 | |
---|
989 | if (!empty($page['image_id'])) { |
---|
990 | |
---|
991 | if ($user['theme'] == 'bootstrap_darkroom'){ |
---|
992 | $themeconfig = new \BootstrapDarkroom\Config(); |
---|
993 | if($themeconfig->picture_info=='cards'){ |
---|
994 | $tagaff = pwg_db_fetch_assoc(pwg_query('SELECT wording FROM '. ADD_PROP_PHOTO_TABLE.' ORDER BY orderprop DESC LIMIT 1')); |
---|
995 | if($tagaff['wording']=='Tags'){ |
---|
996 | $template->assign('TAGAFF',1); |
---|
997 | }else{ |
---|
998 | $template->assign('TAGAFF',0); |
---|
999 | } |
---|
1000 | } |
---|
1001 | } |
---|
1002 | |
---|
1003 | |
---|
1004 | if (isset($pwg_loaded_plugins['ExtendedDescription'])){add_event_handler('AP_render_content', 'get_user_language_desc');} |
---|
1005 | |
---|
1006 | $tab_add_info_one_photo = tab_add_info_by_photo_show(); |
---|
1007 | |
---|
1008 | $query = 'select path FROM ' . IMAGES_TABLE . ' WHERE id = \''.$page['image_id'].'\';'; |
---|
1009 | $result = pwg_query($query); |
---|
1010 | $row = pwg_db_fetch_assoc($result); |
---|
1011 | $filename=$row['path']; |
---|
1012 | $exif = exif_read_data($filename); |
---|
1013 | $imginfo = array(); |
---|
1014 | getimagesize($filename, $imginfo); |
---|
1015 | if (isset ($imginfo['APP13'])){$iptc = iptcparse($imginfo['APP13']);} |
---|
1016 | if (pwg_db_num_rows($tab_add_info_one_photo)) { |
---|
1017 | while ($info_photos = pwg_db_fetch_assoc($tab_add_info_one_photo)) { |
---|
1018 | if($info_photos['Typ']==2){ |
---|
1019 | $d = data_info_photosdate($page['image_id'], $info_photos['id_prop_pho']); |
---|
1020 | }else{ |
---|
1021 | $d = data_info_photos($page['image_id'], $info_photos['id_prop_pho']); |
---|
1022 | } |
---|
1023 | $row = pwg_db_fetch_assoc($d); |
---|
1024 | $items = array( |
---|
1025 | 'AIPID' => $info_photos['id_prop_pho'], |
---|
1026 | 'AIPORDER' => $info_photos['orderprop'], |
---|
1027 | 'AIPWORDING' => trigger_change('AP_render_content', $info_photos['wording']), |
---|
1028 | ); |
---|
1029 | if($info_photos['Typ']==2){ |
---|
1030 | $items['AIPDATA']=$row['datadate']; |
---|
1031 | if($info_photos['wording']=="**delpho**"){ |
---|
1032 | $items['AIPWORDING'] =l10n('Delete photo'); |
---|
1033 | } |
---|
1034 | }else if($info_photos['Typ']==3){ |
---|
1035 | if(strpos($info_photos['dataprop'],':')!==false){ |
---|
1036 | $exiftab = explode(':', $info_photos['dataprop']); |
---|
1037 | if (isset($exif[$exiftab[0]][$exiftab[1]])){ |
---|
1038 | if (isset($pwg_loaded_plugins['exif_view'])){ |
---|
1039 | $items['AIPDATA']=exif_key_translation($exif[$exiftab[0]][$exiftab[1]], $exif[$exiftab[0]][$exiftab[1]]); |
---|
1040 | }else{ |
---|
1041 | $items['AIPDATA']= $exif[$exiftab[0]][$exiftab[1]]; |
---|
1042 | } |
---|
1043 | if ($info_photos['wording']!=$info_photos['dataprop']){ |
---|
1044 | }else if (isset($lang['exif_field_'.$exiftab[1]])){ |
---|
1045 | $items['AIPWORDING']= $lang['exif_field_'.$exiftab[1]]; |
---|
1046 | }else{ |
---|
1047 | $items['AIPWORDING']= $exiftab[1]; |
---|
1048 | } |
---|
1049 | } |
---|
1050 | }else{ |
---|
1051 | if (isset($exif[$info_photos['dataprop']])){ |
---|
1052 | if (isset($pwg_loaded_plugins['exif_view'])){ |
---|
1053 | $items['AIPDATA']=exif_key_translation($info_photos['dataprop'], $exif[$info_photos['dataprop']]); |
---|
1054 | }else{ |
---|
1055 | $items['AIPDATA']= $exif[$info_photos['dataprop']]; |
---|
1056 | } |
---|
1057 | if ($info_photos['wording']!=$info_photos['dataprop']){ |
---|
1058 | }else if (isset($lang['exif_field_'.$info_photos['dataprop']])){ |
---|
1059 | $items['AIPWORDING']= $lang['exif_field_'.$info_photos['dataprop']]; |
---|
1060 | }else{ |
---|
1061 | $items['AIPWORDING']= $info_photos['dataprop']; |
---|
1062 | } |
---|
1063 | } |
---|
1064 | } |
---|
1065 | }else if($info_photos['Typ']==6){ |
---|
1066 | $items['AIPWORDING']=trigger_change('AP_render_content', $info_photos['wording']); |
---|
1067 | if (isset($iptc[$info_photos['dataprop']])){ |
---|
1068 | $items['AIPDATA']=implode(", ", $iptc[$info_photos['dataprop']]); |
---|
1069 | } |
---|
1070 | }else{ |
---|
1071 | $items['AIPDATA']=trigger_change('AP_render_content', $row['data']); |
---|
1072 | |
---|
1073 | } |
---|
1074 | |
---|
1075 | |
---|
1076 | $template->append('add_info_photos', $items); |
---|
1077 | } |
---|
1078 | } |
---|
1079 | |
---|
1080 | $template->assign( |
---|
1081 | array( |
---|
1082 | 'A' => 'a' |
---|
1083 | )); |
---|
1084 | } |
---|
1085 | } |
---|
1086 | |
---|
1087 | ?> |
---|