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