1 | {include file='include/tag_selection.inc.tpl'} |
---|
2 | {include file='include/datepicker.inc.tpl'} |
---|
3 | {include file='include/colorbox.inc.tpl'} |
---|
4 | {include file='include/add_album.inc.tpl'} |
---|
5 | |
---|
6 | {footer_script}{literal} |
---|
7 | pwg_initialization_datepicker("#date_creation_day", "#date_creation_month", "#date_creation_year", "#date_creation_linked_date", "#date_creation_action_set"); |
---|
8 | {/literal}{/footer_script} |
---|
9 | |
---|
10 | {footer_script}{literal} |
---|
11 | /* Shift-click: select all photos between the click and the shift+click */ |
---|
12 | jQuery(document).ready(function() { |
---|
13 | var last_clicked=0; |
---|
14 | var last_clickedstatus=true; |
---|
15 | jQuery.fn.enableShiftClick = function() { |
---|
16 | var inputs = []; |
---|
17 | var count=0; |
---|
18 | var This=$(this); |
---|
19 | this.find('input[type=checkbox]').each(function() { |
---|
20 | var pos=count; |
---|
21 | inputs[count++]=this; |
---|
22 | $(this).bind("shclick", function (dummy,event) { |
---|
23 | if (event.shiftKey) { |
---|
24 | var first = last_clicked; |
---|
25 | var last = pos; |
---|
26 | if (first > last) { |
---|
27 | first=pos; |
---|
28 | last=last_clicked; |
---|
29 | } |
---|
30 | |
---|
31 | for (var i=first; i<=last;i++) { |
---|
32 | input = $(inputs[i]); |
---|
33 | $(input).attr('checked', last_clickedstatus); |
---|
34 | if (last_clickedstatus) |
---|
35 | { |
---|
36 | $(input).siblings("span.wrap2").addClass("thumbSelected"); |
---|
37 | } |
---|
38 | else |
---|
39 | { |
---|
40 | $(input).siblings("span.wrap2").removeClass("thumbSelected"); |
---|
41 | } |
---|
42 | } |
---|
43 | } |
---|
44 | else { |
---|
45 | last_clicked = pos; |
---|
46 | last_clickedstatus = this.checked; |
---|
47 | } |
---|
48 | return true; |
---|
49 | }); |
---|
50 | $(this).click(function(event) {console.log(event.shiftKey);$(this).triggerHandler("shclick",event)}); |
---|
51 | }); |
---|
52 | } |
---|
53 | }); |
---|
54 | {/literal}{/footer_script} |
---|
55 | |
---|
56 | {combine_script id='jquery.tokeninput' load='footer' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'} |
---|
57 | {combine_script id='jquery.progressBar' load='footer' path='themes/default/js/plugins/jquery.progressbar.min.js'} |
---|
58 | {combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'} |
---|
59 | |
---|
60 | {footer_script require='jquery.tokeninput'} |
---|
61 | jQuery(document).ready(function() {ldelim} |
---|
62 | jQuery("a.preview-box").colorbox(); |
---|
63 | |
---|
64 | var tag_src = [{foreach from=$tags item=tag name=tags}{ldelim}name:"{$tag.name|@escape:'javascript'}",id:"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}]; |
---|
65 | jQuery("#tags").tokenInput( |
---|
66 | tag_src, |
---|
67 | {ldelim} |
---|
68 | hintText: '{'Type in a search term'|@translate}', |
---|
69 | noResultsText: '{'No results'|@translate}', |
---|
70 | searchingText: '{'Searching...'|@translate}', |
---|
71 | newText: ' ({'new'|@translate})', |
---|
72 | animateDropdown: false, |
---|
73 | preventDuplicates: true, |
---|
74 | allowCreation: true |
---|
75 | } |
---|
76 | ); |
---|
77 | |
---|
78 | jQuery("#tagsFilter").tokenInput( |
---|
79 | tag_src, |
---|
80 | {ldelim} |
---|
81 | hintText: '{'Type in a search term'|@translate}', |
---|
82 | noResultsText: '{'No results'|@translate}', |
---|
83 | searchingText: '{'Searching...'|@translate}', |
---|
84 | animateDropdown: false, |
---|
85 | preventDuplicates: true, |
---|
86 | allowCreation: false |
---|
87 | } |
---|
88 | ); |
---|
89 | |
---|
90 | }); |
---|
91 | {/footer_script} |
---|
92 | |
---|
93 | {footer_script} |
---|
94 | var nb_thumbs_page = {$nb_thumbs_page}; |
---|
95 | var nb_thumbs_set = {$nb_thumbs_set}; |
---|
96 | var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}"; |
---|
97 | var elements = new Array(); |
---|
98 | var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}]; |
---|
99 | |
---|
100 | var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}"; |
---|
101 | var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}"; |
---|
102 | var selectedMessage_all = "{'All %d photos are selected'|@translate}"; |
---|
103 | var regenerateThumbnailsMessage = "{'Thumbnails generation in progress...'|@translate}"; |
---|
104 | var regenerateWebsizeMessage = "{'Photos generation in progress...'|@translate}"; |
---|
105 | |
---|
106 | var width_str = '{'Width'|@translate}'; |
---|
107 | var height_str = '{'Height'|@translate}'; |
---|
108 | var max_width_str = '{'Maximum Width'|@translate}'; |
---|
109 | var max_height_str = '{'Maximum Height'|@translate}'; |
---|
110 | {literal} |
---|
111 | function str_repeat(i, m) { |
---|
112 | for (var o = []; m > 0; o[--m] = i); |
---|
113 | return o.join(''); |
---|
114 | } |
---|
115 | |
---|
116 | function sprintf() { |
---|
117 | var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = ''; |
---|
118 | while (f) { |
---|
119 | if (m = /^[^\x25]+/.exec(f)) { |
---|
120 | o.push(m[0]); |
---|
121 | } |
---|
122 | else if (m = /^\x25{2}/.exec(f)) { |
---|
123 | o.push('%'); |
---|
124 | } |
---|
125 | else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) { |
---|
126 | if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) { |
---|
127 | throw('Too few arguments.'); |
---|
128 | } |
---|
129 | if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) { |
---|
130 | throw('Expecting number but found ' + typeof(a)); |
---|
131 | } |
---|
132 | switch (m[7]) { |
---|
133 | case 'b': a = a.toString(2); break; |
---|
134 | case 'c': a = String.fromCharCode(a); break; |
---|
135 | case 'd': a = parseInt(a); break; |
---|
136 | case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break; |
---|
137 | case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break; |
---|
138 | case 'o': a = a.toString(8); break; |
---|
139 | case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break; |
---|
140 | case 'u': a = Math.abs(a); break; |
---|
141 | case 'x': a = a.toString(16); break; |
---|
142 | case 'X': a = a.toString(16).toUpperCase(); break; |
---|
143 | } |
---|
144 | a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+'+ a : a); |
---|
145 | c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' '; |
---|
146 | x = m[5] - String(a).length - s.length; |
---|
147 | p = m[5] ? str_repeat(c, x) : ''; |
---|
148 | o.push(s + (m[4] ? a + p : p + a)); |
---|
149 | } |
---|
150 | else { |
---|
151 | throw('Huh ?!'); |
---|
152 | } |
---|
153 | f = f.substring(m[0].length); |
---|
154 | } |
---|
155 | return o.join(''); |
---|
156 | } |
---|
157 | |
---|
158 | function progress(val, max, success) { |
---|
159 | jQuery('#progressBar').progressBar(val, { |
---|
160 | max: max, |
---|
161 | textFormat: 'fraction', |
---|
162 | boxImage: 'themes/default/images/progressbar.gif', |
---|
163 | barImage: 'themes/default/images/progressbg_orange.gif' |
---|
164 | }); |
---|
165 | type = success ? 'regenerateSuccess': 'regenerateError' |
---|
166 | s = jQuery('[name="'+type+'"]').val(); |
---|
167 | jQuery('[name="'+type+'"]').val(++s); |
---|
168 | |
---|
169 | if (val == max) |
---|
170 | jQuery('#applyAction').click(); |
---|
171 | } |
---|
172 | |
---|
173 | $(document).ready(function() { |
---|
174 | function checkPermitAction() { |
---|
175 | var nbSelected = 0; |
---|
176 | if ($("input[name=setSelected]").is(':checked')) { |
---|
177 | nbSelected = nb_thumbs_set; |
---|
178 | } |
---|
179 | else { |
---|
180 | $(".thumbnails input[type=checkbox]").each(function() { |
---|
181 | if ($(this).is(':checked')) { |
---|
182 | nbSelected++; |
---|
183 | } |
---|
184 | }); |
---|
185 | } |
---|
186 | |
---|
187 | if (nbSelected == 0) { |
---|
188 | $("#permitAction").hide(); |
---|
189 | $("#forbidAction").show(); |
---|
190 | } |
---|
191 | else { |
---|
192 | $("#permitAction").show(); |
---|
193 | $("#forbidAction").hide(); |
---|
194 | } |
---|
195 | |
---|
196 | $("#applyOnDetails").text( |
---|
197 | sprintf( |
---|
198 | applyOnDetails_pattern, |
---|
199 | nbSelected |
---|
200 | ) |
---|
201 | ); |
---|
202 | |
---|
203 | // display the number of currently selected photos in the "Selection" fieldset |
---|
204 | if (nbSelected == 0) { |
---|
205 | $("#selectedMessage").text( |
---|
206 | sprintf( |
---|
207 | selectedMessage_none, |
---|
208 | nb_thumbs_set |
---|
209 | ) |
---|
210 | ); |
---|
211 | } |
---|
212 | else if (nbSelected == nb_thumbs_set) { |
---|
213 | $("#selectedMessage").text( |
---|
214 | sprintf( |
---|
215 | selectedMessage_all, |
---|
216 | nb_thumbs_set |
---|
217 | ) |
---|
218 | ); |
---|
219 | } |
---|
220 | else { |
---|
221 | $("#selectedMessage").text( |
---|
222 | sprintf( |
---|
223 | selectedMessage_pattern, |
---|
224 | nbSelected, |
---|
225 | nb_thumbs_set |
---|
226 | ) |
---|
227 | ); |
---|
228 | } |
---|
229 | } |
---|
230 | |
---|
231 | $('img.thumbnail').tipTip({ |
---|
232 | 'delay' : 0, |
---|
233 | 'fadeIn' : 200, |
---|
234 | 'fadeOut' : 200 |
---|
235 | }); |
---|
236 | |
---|
237 | $("[id^=action_]").hide(); |
---|
238 | |
---|
239 | $("select[name=selectAction]").change(function () { |
---|
240 | $("[id^=action_]").hide(); |
---|
241 | $("#action_"+$(this).attr("value")).show(); |
---|
242 | |
---|
243 | /* make sure the #albumSelect is on the right select box so that the */ |
---|
244 | /* "add new album" popup fills the right select box */ |
---|
245 | if ("associate" == $(this).attr("value") || "move" == $(this).attr("value")) { |
---|
246 | jQuery("#albumSelect").removeAttr("id"); |
---|
247 | jQuery("#action_"+$(this).attr("value")+" select").attr("id", "albumSelect"); |
---|
248 | } |
---|
249 | |
---|
250 | if ($(this).val() != -1) { |
---|
251 | $("#applyActionBlock").show(); |
---|
252 | } |
---|
253 | else { |
---|
254 | $("#applyActionBlock").hide(); |
---|
255 | } |
---|
256 | }); |
---|
257 | |
---|
258 | $(".wrap1 label").click(function (event) { |
---|
259 | $("input[name=setSelected]").attr('checked', false); |
---|
260 | |
---|
261 | var wrap2 = $(this).children(".wrap2"); |
---|
262 | var checkbox = $(this).children("input[type=checkbox]"); |
---|
263 | |
---|
264 | checkbox.triggerHandler("shclick",event); |
---|
265 | |
---|
266 | if ($(checkbox).is(':checked')) { |
---|
267 | $(wrap2).addClass("thumbSelected"); |
---|
268 | } |
---|
269 | else { |
---|
270 | $(wrap2).removeClass('thumbSelected'); |
---|
271 | } |
---|
272 | |
---|
273 | checkPermitAction(); |
---|
274 | }); |
---|
275 | |
---|
276 | $("#selectAll").click(function () { |
---|
277 | $("input[name=setSelected]").attr('checked', false); |
---|
278 | selectPageThumbnails(); |
---|
279 | checkPermitAction(); |
---|
280 | return false; |
---|
281 | }); |
---|
282 | |
---|
283 | function selectPageThumbnails() { |
---|
284 | $(".thumbnails label").each(function() { |
---|
285 | var wrap2 = $(this).children(".wrap2"); |
---|
286 | var checkbox = $(this).children("input[type=checkbox]"); |
---|
287 | |
---|
288 | $(checkbox).attr('checked', true); |
---|
289 | $(wrap2).addClass("thumbSelected"); |
---|
290 | }); |
---|
291 | } |
---|
292 | |
---|
293 | $("#selectNone").click(function () { |
---|
294 | $("input[name=setSelected]").attr('checked', false); |
---|
295 | |
---|
296 | $(".thumbnails label").each(function() { |
---|
297 | var wrap2 = $(this).children(".wrap2"); |
---|
298 | var checkbox = $(this).children("input[type=checkbox]"); |
---|
299 | |
---|
300 | $(checkbox).attr('checked', false); |
---|
301 | $(wrap2).removeClass("thumbSelected"); |
---|
302 | }); |
---|
303 | checkPermitAction(); |
---|
304 | return false; |
---|
305 | }); |
---|
306 | |
---|
307 | $("#selectInvert").click(function () { |
---|
308 | $("input[name=setSelected]").attr('checked', false); |
---|
309 | |
---|
310 | $(".thumbnails label").each(function() { |
---|
311 | var wrap2 = $(this).children(".wrap2"); |
---|
312 | var checkbox = $(this).children("input[type=checkbox]"); |
---|
313 | |
---|
314 | $(checkbox).attr('checked', !$(checkbox).is(':checked')); |
---|
315 | |
---|
316 | if ($(checkbox).is(':checked')) { |
---|
317 | $(wrap2).addClass("thumbSelected"); |
---|
318 | } |
---|
319 | else { |
---|
320 | $(wrap2).removeClass('thumbSelected'); |
---|
321 | } |
---|
322 | }); |
---|
323 | checkPermitAction(); |
---|
324 | return false; |
---|
325 | }); |
---|
326 | |
---|
327 | $("#selectSet").click(function () { |
---|
328 | selectPageThumbnails(); |
---|
329 | $("input[name=setSelected]").attr('checked', true); |
---|
330 | checkPermitAction(); |
---|
331 | return false; |
---|
332 | }); |
---|
333 | |
---|
334 | $("input[name=remove_author]").click(function () { |
---|
335 | if ($(this).is(':checked')) { |
---|
336 | $("input[name=author]").hide(); |
---|
337 | } |
---|
338 | else { |
---|
339 | $("input[name=author]").show(); |
---|
340 | } |
---|
341 | }); |
---|
342 | |
---|
343 | $("input[name=remove_title]").click(function () { |
---|
344 | if ($(this).is(':checked')) { |
---|
345 | $("input[name=title]").hide(); |
---|
346 | } |
---|
347 | else { |
---|
348 | $("input[name=title]").show(); |
---|
349 | } |
---|
350 | }); |
---|
351 | |
---|
352 | $("input[name=remove_date_creation]").click(function () { |
---|
353 | if ($(this).is(':checked')) { |
---|
354 | $("#set_date_creation").hide(); |
---|
355 | } |
---|
356 | else { |
---|
357 | $("#set_date_creation").show(); |
---|
358 | } |
---|
359 | }); |
---|
360 | |
---|
361 | $(".removeFilter").click(function () { |
---|
362 | var filter = $(this).parent('li').attr("id"); |
---|
363 | filter_disable(filter); |
---|
364 | |
---|
365 | return false; |
---|
366 | }); |
---|
367 | |
---|
368 | function filter_enable(filter) { |
---|
369 | /* show the filter*/ |
---|
370 | $("#"+filter).show(); |
---|
371 | |
---|
372 | /* check the checkbox to declare we use this filter */ |
---|
373 | $("input[type=checkbox][name="+filter+"_use]").attr("checked", true); |
---|
374 | |
---|
375 | /* forbid to select this filter in the addFilter list */ |
---|
376 | $("#addFilter").children("option[value="+filter+"]").attr("disabled", "disabled"); |
---|
377 | } |
---|
378 | |
---|
379 | $("#addFilter").change(function () { |
---|
380 | var filter = $(this).attr("value"); |
---|
381 | filter_enable(filter); |
---|
382 | $(this).attr("value", -1); |
---|
383 | }); |
---|
384 | |
---|
385 | function filter_disable(filter) { |
---|
386 | /* hide the filter line */ |
---|
387 | $("#"+filter).hide(); |
---|
388 | |
---|
389 | /* uncheck the checkbox to declare we do not use this filter */ |
---|
390 | $("input[name="+filter+"_use]").removeAttr("checked"); |
---|
391 | |
---|
392 | /* give the possibility to show it again */ |
---|
393 | $("#addFilter").children("option[value="+filter+"]").removeAttr("disabled"); |
---|
394 | } |
---|
395 | |
---|
396 | $("#removeFilters").click(function() { |
---|
397 | $("#filterList li").each(function() { |
---|
398 | var filter = $(this).attr("id"); |
---|
399 | filter_disable(filter); |
---|
400 | }); |
---|
401 | return false; |
---|
402 | }); |
---|
403 | |
---|
404 | jQuery('#applyAction').click(function() { |
---|
405 | if (elements.length != 0) |
---|
406 | { |
---|
407 | return true; |
---|
408 | } |
---|
409 | else if (jQuery('[name="selectAction"]').val() == 'regenerateThumbnails') |
---|
410 | { |
---|
411 | resizeMethod = 'pwg.images.resizeThumbnail'; |
---|
412 | maxRequests = 3; |
---|
413 | maxwidth = jQuery('input[name="thumb_maxwidth"]').val(); |
---|
414 | maxheight = jQuery('input[name="thumb_maxheight"]').val(); |
---|
415 | regenerationText = regenerateThumbnailsMessage; |
---|
416 | crop = jQuery('input[name="thumb_crop"]').is(':checked'); |
---|
417 | follow_orientation = jQuery('input[name="thumb_follow_orientation"]').is(':checked'); |
---|
418 | } |
---|
419 | else if(jQuery('[name="selectAction"]').val() == 'regenerateWebsize') |
---|
420 | { |
---|
421 | resizeMethod = 'pwg.images.resizeWebsize'; |
---|
422 | maxRequests = 1; |
---|
423 | maxwidth = jQuery('input[name="websize_maxwidth"]').val(); |
---|
424 | maxheight = jQuery('input[name="websize_maxheight"]').val(); |
---|
425 | regenerationText = regenerateWebsizeMessage; |
---|
426 | crop = false; |
---|
427 | follow_orientation = false; |
---|
428 | } |
---|
429 | else return true; |
---|
430 | |
---|
431 | jQuery('.bulkAction').hide(); |
---|
432 | jQuery('#regenerationText').html(regenerationText); |
---|
433 | |
---|
434 | var queuedManager = jQuery.manageAjax.create('queued', { |
---|
435 | queue: true, |
---|
436 | cacheResponse: false, |
---|
437 | maxRequests: maxRequests |
---|
438 | }); |
---|
439 | |
---|
440 | if (jQuery('input[name="setSelected"]').attr('checked')) |
---|
441 | elements = all_elements; |
---|
442 | else |
---|
443 | jQuery('input[name="selection[]"]').each(function() { |
---|
444 | if (jQuery(this).attr('checked')) { |
---|
445 | elements.push(jQuery(this).val()); |
---|
446 | } |
---|
447 | }); |
---|
448 | |
---|
449 | progressBar_max = elements.length; |
---|
450 | todo = 0; |
---|
451 | |
---|
452 | jQuery('#applyActionBlock').hide(); |
---|
453 | jQuery('select[name="selectAction"]').hide(); |
---|
454 | jQuery('#regenerationMsg').show(); |
---|
455 | |
---|
456 | jQuery('#progressBar').progressBar(0, { |
---|
457 | max: progressBar_max, |
---|
458 | textFormat: 'fraction', |
---|
459 | boxImage: 'themes/default/images/progressbar.gif', |
---|
460 | barImage: 'themes/default/images/progressbg_orange.gif' |
---|
461 | }); |
---|
462 | |
---|
463 | for (i=0;i<elements.length;i++) { |
---|
464 | queuedManager.add({ |
---|
465 | type: 'GET', |
---|
466 | url: 'ws.php', |
---|
467 | data: { |
---|
468 | method: resizeMethod, |
---|
469 | maxwidth: maxwidth, |
---|
470 | maxheight: maxheight, |
---|
471 | crop: crop, |
---|
472 | follow_orientation: follow_orientation, |
---|
473 | image_id: elements[i], |
---|
474 | format: 'json' |
---|
475 | }, |
---|
476 | dataType: 'json', |
---|
477 | success: ( function(data) { progress(++todo, progressBar_max, data['result']) }), |
---|
478 | error: ( function(data) { progress(++todo, progressBar_max, false) }) |
---|
479 | }); |
---|
480 | } |
---|
481 | return false; |
---|
482 | }); |
---|
483 | |
---|
484 | function toggleCropFields(prefix) { |
---|
485 | if (jQuery("#"+prefix+"_crop").is(':checked')) { |
---|
486 | jQuery("#"+prefix+"_width_th").text(width_str); |
---|
487 | jQuery("#"+prefix+"_height_th").text(height_str); |
---|
488 | jQuery("#"+prefix+"_follow_orientation_tr").show(); |
---|
489 | } |
---|
490 | else { |
---|
491 | jQuery("#"+prefix+"_width_th").text(max_width_str); |
---|
492 | jQuery("#"+prefix+"_height_th").text(max_height_str); |
---|
493 | jQuery("#"+prefix+"_follow_orientation_tr").hide(); |
---|
494 | } |
---|
495 | } |
---|
496 | |
---|
497 | toggleCropFields("thumb"); |
---|
498 | jQuery("#thumb_crop").click(function () {toggleCropFields("thumb")}); |
---|
499 | |
---|
500 | checkPermitAction() |
---|
501 | }); |
---|
502 | |
---|
503 | jQuery(window).load(function() { |
---|
504 | var max_dim = 0; |
---|
505 | $(".thumbnails img").each(function () { |
---|
506 | max_dim = Math.max(max_dim, $(this).height(), $(this).width() ); |
---|
507 | }); |
---|
508 | max_dim += 35; |
---|
509 | $("ul.thumbnails span, ul.thumbnails label").css('width', max_dim+'px').css('height', max_dim+'px'); |
---|
510 | $('ul.thumbnails').enableShiftClick(); |
---|
511 | }); |
---|
512 | {/literal}{/footer_script} |
---|
513 | |
---|
514 | <div id="batchManagerGlobal"> |
---|
515 | |
---|
516 | <h2>{'Batch Manager'|@translate}</h2> |
---|
517 | |
---|
518 | <form action="{$F_ACTION}" method="post"> |
---|
519 | |
---|
520 | <fieldset> |
---|
521 | <legend>{'Filter'|@translate}</legend> |
---|
522 | |
---|
523 | <ul id="filterList"> |
---|
524 | <li id="filter_prefilter" {if !isset($filter.prefilter)}style="display:none"{/if}> |
---|
525 | <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a> |
---|
526 | <input type="checkbox" name="filter_prefilter_use" class="useFilterCheckbox" {if isset($filter.prefilter)}checked="checked"{/if}> |
---|
527 | {'Predefined filter'|@translate} |
---|
528 | <select name="filter_prefilter"> |
---|
529 | {foreach from=$prefilters item=prefilter} |
---|
530 | <option value="{$prefilter.ID}" {if $filter.prefilter eq $prefilter.ID}selected="selected"{/if}>{$prefilter.NAME}</option> |
---|
531 | {/foreach} |
---|
532 | </select> |
---|
533 | </li> |
---|
534 | <li id="filter_category" {if !isset($filter.category)}style="display:none"{/if}> |
---|
535 | <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> |
---|
536 | <input type="checkbox" name="filter_category_use" class="useFilterCheckbox" {if isset($filter.category)}checked="checked"{/if}> |
---|
537 | {'Album'|@translate} |
---|
538 | <select style="width:400px" name="filter_category" size="1"> |
---|
539 | {html_options options=$filter_category_options selected=$filter_category_options_selected} |
---|
540 | </select> |
---|
541 | <label><input type="checkbox" name="filter_category_recursive" {if isset($filter.category_recursive)}checked="checked"{/if}> {'include child albums'|@translate}</label> |
---|
542 | </li> |
---|
543 | <li id="filter_tags" {if !isset($filter.tags)}style="display:none"{/if}> |
---|
544 | <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> |
---|
545 | <input type="checkbox" name="filter_tags_use" class="useFilterCheckbox" {if isset($filter.tags)}checked="checked"{/if}> |
---|
546 | {'Tags'|@translate} |
---|
547 | <select id="tagsFilter" name="filter_tags"> |
---|
548 | {foreach from=$filter_tags item=tag} |
---|
549 | <option value="{$tag.id}">{$tag.name}</option> |
---|
550 | {/foreach} |
---|
551 | </select> |
---|
552 | <label><span><input type="radio" name="tag_mode" value="AND" {if !isset($filter.tag_mode) or $filter.tag_mode eq 'AND'}checked="checked"{/if}> {'All tags'|@translate}</span></label> |
---|
553 | <label><span><input type="radio" name="tag_mode" value="OR" {if isset($filter.tag_mode) and $filter.tag_mode eq 'OR'}checked="checked"{/if}> {'Any tag'|@translate}</span></label> |
---|
554 | </li> |
---|
555 | <li id="filter_level" {if !isset($filter.level)}style="display:none"{/if}> |
---|
556 | <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a> |
---|
557 | <input type="checkbox" name="filter_level_use" class="useFilterCheckbox" {if isset($filter.level)}checked="checked"{/if}> |
---|
558 | {'Who can see these photos?'|@translate} |
---|
559 | <select name="filter_level" size="1"> |
---|
560 | {html_options options=$filter_level_options selected=$filter_level_options_selected} |
---|
561 | </select> |
---|
562 | </li> |
---|
563 | </ul> |
---|
564 | |
---|
565 | <p class="actionButtons" style=""> |
---|
566 | <select id="addFilter"> |
---|
567 | <option value="-1">{'Add a filter'|@translate}</option> |
---|
568 | <option disabled="disabled">------------------</option> |
---|
569 | <option value="filter_prefilter">{'Predefined filter'|@translate}</option> |
---|
570 | <option value="filter_category">{'Album'|@translate}</option> |
---|
571 | <option value="filter_tags">{'Tags'|@translate}</option> |
---|
572 | <option value="filter_level">{'Who can see these photos?'|@translate}</option> |
---|
573 | </select> |
---|
574 | <!-- <input id="removeFilters" class="submit" type="submit" value="Remove all filters" name="removeFilters"> --> |
---|
575 | <a id="removeFilters" href="">{'Remove all filters'|@translate}</a> |
---|
576 | </p> |
---|
577 | |
---|
578 | <p class="actionButtons" id="applyFilterBlock"> |
---|
579 | <input id="applyFilter" class="submit" type="submit" value="{'Refresh photo set'|@translate}" name="submitFilter"> |
---|
580 | </p> |
---|
581 | |
---|
582 | </fieldset> |
---|
583 | |
---|
584 | <fieldset> |
---|
585 | |
---|
586 | <legend>{'Selection'|@translate}</legend> |
---|
587 | |
---|
588 | {if !empty($thumbnails)} |
---|
589 | <p id="checkActions"> |
---|
590 | {'Select:'|@translate} |
---|
591 | {if $nb_thumbs_set > $nb_thumbs_page} |
---|
592 | <a href="#" id="selectAll">{'The whole page'|@translate}</a>, |
---|
593 | <a href="#" id="selectSet">{'The whole set'|@translate}</a>, |
---|
594 | {else} |
---|
595 | <a href="#" id="selectAll">{'All'|@translate}</a>, |
---|
596 | {/if} |
---|
597 | <a href="#" id="selectNone">{'None'|@translate}</a>, |
---|
598 | <a href="#" id="selectInvert">{'Invert'|@translate}</a> |
---|
599 | |
---|
600 | <span id="selectedMessage"></span> |
---|
601 | |
---|
602 | <input type="checkbox" name="setSelected" style="display:none" {if count($selection) == $nb_thumbs_set}checked="checked"{/if}> |
---|
603 | </p> |
---|
604 | |
---|
605 | <ul class="thumbnails"> |
---|
606 | {foreach from=$thumbnails item=thumbnail} |
---|
607 | {if in_array($thumbnail.ID, $selection)} |
---|
608 | {assign var='isSelected' value=true} |
---|
609 | {else} |
---|
610 | {assign var='isSelected' value=false} |
---|
611 | {/if} |
---|
612 | |
---|
613 | <li> |
---|
614 | <span class="wrap1"> |
---|
615 | <label> |
---|
616 | <span class="wrap2{if $isSelected} thumbSelected{/if}"> |
---|
617 | <div class="actions"><a href="{$thumbnail.FILE_SRC}" class="preview-box">{'Zoom'|@translate}</a> · <a href="{$thumbnail.U_EDIT}" target="_blank">{'Edit'|@translate}</a></div> |
---|
618 | {if $thumbnail.LEVEL > 0} |
---|
619 | <em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em> |
---|
620 | <em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em> |
---|
621 | {/if} |
---|
622 | <span> |
---|
623 | <img src="{$thumbnail.TN_SRC}" |
---|
624 | alt="{$thumbnail.FILE}" |
---|
625 | title="{$thumbnail.TITLE|@escape:'html'}" |
---|
626 | class="thumbnail"> |
---|
627 | </span> |
---|
628 | </span> |
---|
629 | <input type="checkbox" name="selection[]" value="{$thumbnail.ID}" {if $isSelected}checked="checked"{/if}> |
---|
630 | </label> |
---|
631 | </span> |
---|
632 | </li> |
---|
633 | {/foreach} |
---|
634 | </ul> |
---|
635 | |
---|
636 | {if !empty($navbar) } |
---|
637 | <div style="clear:both;"> |
---|
638 | |
---|
639 | <div style="float:left"> |
---|
640 | {include file='navigation_bar.tpl'|@get_extent:'navbar'} |
---|
641 | </div> |
---|
642 | |
---|
643 | <div style="float:right;margin-top:10px;">{'display'|@translate} |
---|
644 | <a href="{$U_DISPLAY}&display=20">20</a> |
---|
645 | · <a href="{$U_DISPLAY}&display=50">50</a> |
---|
646 | · <a href="{$U_DISPLAY}&display=100">100</a> |
---|
647 | · <a href="{$U_DISPLAY}&display=all">{'all'|@translate}</a> |
---|
648 | {'photos per page'|@translate} |
---|
649 | </div> |
---|
650 | </div> |
---|
651 | {/if} |
---|
652 | |
---|
653 | {else} |
---|
654 | <div>{'No photo in the current set.'|@translate}</div> |
---|
655 | {/if} |
---|
656 | </fieldset> |
---|
657 | |
---|
658 | <fieldset id="action"> |
---|
659 | |
---|
660 | <legend>{'Action'|@translate}</legend> |
---|
661 | <div id="forbidAction"{if count($selection) != 0}style="display:none"{/if}>{'No photo selected, no action possible.'|@translate}</div> |
---|
662 | <div id="permitAction"{if count($selection) == 0}style="display:none"{/if}> |
---|
663 | |
---|
664 | <select name="selectAction"> |
---|
665 | <option value="-1">{'Choose an action'|@translate}</option> |
---|
666 | <option disabled="disabled">------------------</option> |
---|
667 | {if isset($show_delete_form) } |
---|
668 | <option value="delete">{'Delete selected photos'|@translate}</option> |
---|
669 | {/if} |
---|
670 | <option value="associate">{'Associate to album'|@translate}</option> |
---|
671 | <option value="move">{'Move to album'|@translate}</option> |
---|
672 | {if !empty($dissociate_options)} |
---|
673 | <option value="dissociate">{'Dissociate from album'|@translate}</option> |
---|
674 | {/if} |
---|
675 | <option value="add_tags">{'Add tags'|@translate}</option> |
---|
676 | {if !empty($DEL_TAG_SELECTION)} |
---|
677 | <option value="del_tags">{'remove tags'|@translate}</option> |
---|
678 | {/if} |
---|
679 | <option value="author">{'Set author'|@translate}</option> |
---|
680 | <option value="title">{'Set title'|@translate}</option> |
---|
681 | <option value="date_creation">{'Set creation date'|@translate}</option> |
---|
682 | <option value="level">{'Who can see these photos?'|@translate}</option> |
---|
683 | <option value="metadata">{'Synchronize metadata'|@translate}</option> |
---|
684 | {if ($IN_CADDIE)} |
---|
685 | <option value="remove_from_caddie">{'Remove from caddie'|@translate}</option> |
---|
686 | {else} |
---|
687 | <option value="add_to_caddie">{'Add to caddie'|@translate}</option> |
---|
688 | {/if} |
---|
689 | <option value="regenerateThumbnails">{'Regenerate Thumbnails'|@translate}</option> |
---|
690 | <option value="regenerateWebsize">{'Regenerate Websize Photos'|@translate}</option> |
---|
691 | {if !empty($element_set_global_plugins_actions)} |
---|
692 | {foreach from=$element_set_global_plugins_actions item=action} |
---|
693 | <option value="{$action.ID}">{$action.NAME}</option> |
---|
694 | {/foreach} |
---|
695 | {/if} |
---|
696 | </select> |
---|
697 | |
---|
698 | <!-- delete --> |
---|
699 | <div id="action_delete" class="bulkAction"> |
---|
700 | <p><label><input type="checkbox" name="confirm_deletion" value="1"> {'Are you sure?'|@translate}</label></p> |
---|
701 | </div> |
---|
702 | |
---|
703 | <!-- associate --> |
---|
704 | <div id="action_associate" class="bulkAction"> |
---|
705 | <select style="width:400px" name="associate" size="1"> |
---|
706 | {html_options options=$associate_options } |
---|
707 | </select> |
---|
708 | <br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a> |
---|
709 | </div> |
---|
710 | |
---|
711 | <!-- move --> |
---|
712 | <div id="action_move" class="bulkAction"> |
---|
713 | <select style="width:400px" name="move" size="1"> |
---|
714 | {html_options options=$move_options } |
---|
715 | </select> |
---|
716 | <br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a> |
---|
717 | </div> |
---|
718 | |
---|
719 | |
---|
720 | <!-- dissociate --> |
---|
721 | <div id="action_dissociate" class="bulkAction"> |
---|
722 | <select style="width:400px" name="dissociate" size="1"> |
---|
723 | {if !empty($dissociate_options)}{html_options options=$dissociate_options }{/if} |
---|
724 | </select> |
---|
725 | </div> |
---|
726 | |
---|
727 | |
---|
728 | <!-- add_tags --> |
---|
729 | <div id="action_add_tags" class="bulkAction"> |
---|
730 | <select id="tags" name="add_tags"> |
---|
731 | </select> |
---|
732 | </div> |
---|
733 | |
---|
734 | <!-- del_tags --> |
---|
735 | <div id="action_del_tags" class="bulkAction"> |
---|
736 | {$DEL_TAG_SELECTION} |
---|
737 | </div> |
---|
738 | |
---|
739 | <!-- author --> |
---|
740 | <div id="action_author" class="bulkAction"> |
---|
741 | <label><input type="checkbox" name="remove_author"> {'remove author'|@translate}</label><br> |
---|
742 | {assign var='authorDefaultValue' value='Type here the author name'|@translate} |
---|
743 | <input type="text" class="large" name="author" value="{$authorDefaultValue}" onfocus="this.value=(this.value=='{$authorDefaultValue}') ? '' : this.value;" onblur="this.value=(this.value=='') ? '{$authorDefaultValue}' : this.value;"> |
---|
744 | </div> |
---|
745 | |
---|
746 | <!-- title --> |
---|
747 | <div id="action_title" class="bulkAction"> |
---|
748 | <label><input type="checkbox" name="remove_title"> {'remove title'|@translate}</label><br> |
---|
749 | {assign var='titleDefaultValue' value='Type here the title'|@translate} |
---|
750 | <input type="text" class="large" name="title" value="{$titleDefaultValue}" onfocus="this.value=(this.value=='{$titleDefaultValue}') ? '' : this.value;" onblur="this.value=(this.value=='') ? '{$titleDefaultValue}' : this.value;"> |
---|
751 | </div> |
---|
752 | |
---|
753 | <!-- date_creation --> |
---|
754 | <div id="action_date_creation" class="bulkAction"> |
---|
755 | <label><input type="checkbox" name="remove_date_creation"> {'remove creation date'|@translate}</label><br> |
---|
756 | <div id="set_date_creation"> |
---|
757 | <select id="date_creation_day" name="date_creation_day"> |
---|
758 | <option value="0">--</option> |
---|
759 | {section name=day start=1 loop=32} |
---|
760 | <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$DATE_CREATION_DAY}selected="selected"{/if}>{$smarty.section.day.index}</option> |
---|
761 | {/section} |
---|
762 | </select> |
---|
763 | <select id="date_creation_month" name="date_creation_month"> |
---|
764 | {html_options options=$month_list selected=$DATE_CREATION_MONTH} |
---|
765 | </select> |
---|
766 | <input id="date_creation_year" |
---|
767 | name="date_creation_year" |
---|
768 | type="text" |
---|
769 | size="4" |
---|
770 | maxlength="4" |
---|
771 | value="{$DATE_CREATION_YEAR}"> |
---|
772 | <input id="date_creation_linked_date" name="date_creation_linked_date" type="hidden" size="10" disabled="disabled"> |
---|
773 | </div> |
---|
774 | </div> |
---|
775 | |
---|
776 | <!-- level --> |
---|
777 | <div id="action_level" class="bulkAction"> |
---|
778 | <select name="level" size="1"> |
---|
779 | {html_options options=$level_options selected=$level_options_selected} |
---|
780 | </select> |
---|
781 | </div> |
---|
782 | |
---|
783 | <!-- metadata --> |
---|
784 | <div id="action_metadata" class="bulkAction"> |
---|
785 | </div> |
---|
786 | |
---|
787 | <!-- regenerate thumbnails --> |
---|
788 | <div id="action_regenerateThumbnails" class="bulkAction"> |
---|
789 | <table style="margin-left:20px;"> |
---|
790 | <tr> |
---|
791 | <th><label for="thumb_crop">{'Crop'|@translate}</label></th> |
---|
792 | <td><input type="checkbox" name="thumb_crop" id="thumb_crop" {if $upload_form_settings.thumb_crop}checked="checked"{/if}></td> |
---|
793 | </tr> |
---|
794 | <tr id="thumb_follow_orientation_tr"> |
---|
795 | <th><label for="thumb_follow_orientation">{'Follow Orientation'|@translate}</label></th> |
---|
796 | <td><input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {if $upload_form_settings.thumb_follow_orientation}checked="checked"{/if}></td> |
---|
797 | </tr> |
---|
798 | <tr> |
---|
799 | <th id="thumb_width_th">{'Maximum Width'|@translate}</th> |
---|
800 | <td><input type="text" name="thumb_maxwidth" value="{$upload_form_settings.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td> |
---|
801 | </tr> |
---|
802 | <tr> |
---|
803 | <th id="thumb_height_th">{'Maximum Height'|@translate}</th> |
---|
804 | <td><input type="text" name="thumb_maxheight" value="{$upload_form_settings.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td> |
---|
805 | </tr> |
---|
806 | <tr> |
---|
807 | <th>{'Image Quality'|@translate}</th> |
---|
808 | <td><input type="text" name="thumb_quality" value="{$upload_form_settings.thumb_quality}" size="3" maxlength="3"> %</td> |
---|
809 | </tr> |
---|
810 | </table> |
---|
811 | </div> |
---|
812 | |
---|
813 | <!-- regenerate websize --> |
---|
814 | <div id="action_regenerateWebsize" class="bulkAction"> |
---|
815 | <p> |
---|
816 | <img src="admin/themes/default/icon/warning.png" alt="!" style="vertical-align:middle;"> |
---|
817 | {'By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'|@translate} |
---|
818 | {'If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'|@translate} |
---|
819 | </p> |
---|
820 | |
---|
821 | <table style="margin:10px 20px;"> |
---|
822 | <tr> |
---|
823 | <th>{'Maximum Width'|@translate}</th> |
---|
824 | <td><input type="text" name="websize_maxwidth" value="{$upload_form_settings.websize_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td> |
---|
825 | </tr> |
---|
826 | <tr> |
---|
827 | <th>{'Maximum Height'|@translate}</th> |
---|
828 | <td><input type="text" name="websize_maxheight" value="{$upload_form_settings.websize_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td> |
---|
829 | </tr> |
---|
830 | <tr> |
---|
831 | <th>{'Image Quality'|@translate}</th> |
---|
832 | <td><input type="text" name="websize_quality" value="{$upload_form_settings.websize_quality}" size="3" maxlength="3"> %</td> |
---|
833 | </tr> |
---|
834 | </table> |
---|
835 | </div> |
---|
836 | |
---|
837 | <!-- progress bar --> |
---|
838 | <div id="regenerationMsg" class="bulkAction"> |
---|
839 | <p id="regenerationText" style="margin-bottom:10px;"></p> |
---|
840 | <span class="progressBar" id="progressBar"></span> |
---|
841 | <input type="hidden" name="regenerateSuccess" value="0"> |
---|
842 | <input type="hidden" name="regenerateError" value="0"> |
---|
843 | </div> |
---|
844 | |
---|
845 | <!-- plugins --> |
---|
846 | {if !empty($element_set_global_plugins_actions)} |
---|
847 | {foreach from=$element_set_global_plugins_actions item=action} |
---|
848 | <div id="action_{$action.ID}" class="bulkAction"> |
---|
849 | {if !empty($action.CONTENT)}{$action.CONTENT}{/if} |
---|
850 | </div> |
---|
851 | {/foreach} |
---|
852 | {/if} |
---|
853 | |
---|
854 | <p id="applyActionBlock" style="display:none" class="actionButtons"> |
---|
855 | <input id="applyAction" class="submit" type="submit" value="{'Apply action'|@translate}" name="submit"> <span id="applyOnDetails"></span></p> |
---|
856 | |
---|
857 | </div> <!-- #permitAction --> |
---|
858 | </fieldset> |
---|
859 | |
---|
860 | </form> |
---|
861 | |
---|
862 | </div> <!-- #batchManagerGlobal --> |
---|