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