source: trunk/admin/themes/default/template/batch_manager_global.tpl @ 18986

Last change on this file since 18986 was 18758, checked in by mistic100, 12 years ago

feature:2718 Add batch manager filters for photo dimensions, redisgn

File size: 31.8 KB
Line 
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 */
12jQuery(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    this.find('input[type=checkbox]').each(function() {
19      var pos=count;
20      inputs[count++]=this;
21      $(this).bind("shclick", function (dummy,event) {
22        if (event.shiftKey) {
23          var first = last_clicked;
24          var last = pos;
25          if (first > last) {
26            first=pos;
27            last=last_clicked;
28          }
29
30          for (var i=first; i<=last;i++) {
31            input = $(inputs[i]);
32            $(input).attr('checked', last_clickedstatus);
33            if (last_clickedstatus)
34            {
35              $(input).siblings("span.wrap2").addClass("thumbSelected");
36            }
37            else
38            {
39              $(input).siblings("span.wrap2").removeClass("thumbSelected");
40            }
41          }
42        }
43        else {
44          last_clicked = pos;
45          last_clickedstatus = this.checked;
46        }
47        return true;
48      });
49      $(this).click(function(event) {console.log(event.shiftKey);$(this).triggerHandler("shclick",event)});
50    });
51  }
52        $('ul.thumbnails').enableShiftClick();
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'}
61jQuery(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}
94var nb_thumbs_page = {$nb_thumbs_page};
95var nb_thumbs_set = {$nb_thumbs_set};
96var are_you_sure = "{'Are you sure?'|@translate|@escape:'javascript'}";
97var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}";
98var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}];
99var 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
109var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}";
110var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}";
111var selectedMessage_all = "{'All %d photos are selected'|@translate}";
112
113var width_str = '{'Width'|@translate}';
114var height_str = '{'Height'|@translate}';
115var max_width_str = '{'Maximum width'|@translate}';
116var max_height_str = '{'Maximum height'|@translate}';
117{literal}
118function str_repeat(i, m) {
119        for (var o = []; m > 0; o[--m] = i);
120        return o.join('');
121}
122
123function 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
165function 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      nbSelected = $(".thumbnails input[type=checkbox]").filter(':checked').length;
191    }
192
193    if (nbSelected == 0) {
194      $("#permitAction").hide();
195      $("#forbidAction").show();
196    }
197    else {
198      $("#permitAction").show();
199      $("#forbidAction").hide();
200    }
201
202    $("#applyOnDetails").text(
203      sprintf(
204        applyOnDetails_pattern,
205        nbSelected
206      )
207    );
208
209    // display the number of currently selected photos in the "Selection" fieldset
210    if (nbSelected == 0) {
211      $("#selectedMessage").text(
212        sprintf(
213          selectedMessage_none,
214          nb_thumbs_set
215        )
216      );
217    }
218    else if (nbSelected == nb_thumbs_set) {
219      $("#selectedMessage").text(
220        sprintf(
221          selectedMessage_all,
222          nb_thumbs_set
223        )
224      );
225    }
226    else {
227      $("#selectedMessage").text(
228        sprintf(
229          selectedMessage_pattern,
230          nbSelected,
231          nb_thumbs_set
232        )
233      );
234    }
235  }
236
237  $('.thumbnails img').tipTip({
238    'delay' : 0,
239    'fadeIn' : 200,
240    'fadeOut' : 200
241  });
242
243  $("[id^=action_]").hide();
244
245  $("select[name=selectAction]").change(function () {
246    $("[id^=action_]").hide();
247    $("#action_"+$(this).attr("value")).show();
248
249    /* make sure the #albumSelect is on the right select box so that the */
250    /* "add new album" popup fills the right select box                  */
251    if ("associate" == $(this).attr("value") || "move" == $(this).attr("value")) {
252      jQuery("#albumSelect").removeAttr("id");
253      jQuery("#action_"+$(this).attr("value")+" select").attr("id", "albumSelect");
254    }
255
256    if ($(this).val() != -1) {
257      $("#applyActionBlock").show();
258    }
259    else {
260      $("#applyActionBlock").hide();
261    }
262  });
263
264  $(".wrap1 label").click(function (event) {
265    $("input[name=setSelected]").attr('checked', false);
266
267    var wrap2 = $(this).children(".wrap2");
268    var checkbox = $(this).children("input[type=checkbox]");
269
270    checkbox.triggerHandler("shclick",event);
271
272    if ($(checkbox).is(':checked')) {
273      $(wrap2).addClass("thumbSelected");
274    }
275    else {
276      $(wrap2).removeClass('thumbSelected');
277    }
278
279    checkPermitAction();
280  });
281
282  $("#selectAll").click(function () {
283    $("input[name=setSelected]").attr('checked', false);
284    selectPageThumbnails();
285    checkPermitAction();
286    return false;
287  });
288
289  function selectPageThumbnails() {
290    $(".thumbnails label").each(function() {
291      var wrap2 = $(this).children(".wrap2");
292      var checkbox = $(this).children("input[type=checkbox]");
293
294      $(checkbox).attr('checked', true);
295      $(wrap2).addClass("thumbSelected");
296    });
297  }
298
299  $("#selectNone").click(function () {
300    $("input[name=setSelected]").attr('checked', false);
301
302    $(".thumbnails label").each(function() {
303      var wrap2 = $(this).children(".wrap2");
304      var checkbox = $(this).children("input[type=checkbox]");
305
306      $(checkbox).attr('checked', false);
307      $(wrap2).removeClass("thumbSelected");
308    });
309    checkPermitAction();
310    return false;
311  });
312
313  $("#selectInvert").click(function () {
314    $("input[name=setSelected]").attr('checked', false);
315
316    $(".thumbnails label").each(function() {
317      var wrap2 = $(this).children(".wrap2");
318      var checkbox = $(this).children("input[type=checkbox]");
319
320      $(checkbox).attr('checked', !$(checkbox).is(':checked'));
321
322      if ($(checkbox).is(':checked')) {
323        $(wrap2).addClass("thumbSelected");
324      }
325      else {
326        $(wrap2).removeClass('thumbSelected');
327      }
328    });
329    checkPermitAction();
330    return false;
331  });
332
333  $("#selectSet").click(function () {
334    selectPageThumbnails();
335    $("input[name=setSelected]").attr('checked', true);
336    checkPermitAction();
337    return false;
338  });
339
340  $("input[name=remove_author]").click(function () {
341    if ($(this).is(':checked')) {
342      $("input[name=author]").hide();
343    }
344    else {
345      $("input[name=author]").show();
346    }
347  });
348
349  $("input[name=remove_title]").click(function () {
350    if ($(this).is(':checked')) {
351      $("input[name=title]").hide();
352    }
353    else {
354      $("input[name=title]").show();
355    }
356  });
357
358  $("input[name=remove_date_creation]").click(function () {
359    if ($(this).is(':checked')) {
360      $("#set_date_creation").hide();
361    }
362    else {
363      $("#set_date_creation").show();
364    }
365  });
366
367  $(".removeFilter").click(function () {
368    var filter = $(this).parent('li').attr("id");
369    filter_disable(filter);
370
371    return false;
372  });
373
374  function filter_enable(filter) {
375    /* show the filter*/
376    $("#"+filter).show();
377
378    /* check the checkbox to declare we use this filter */
379    $("input[type=checkbox][name="+filter+"_use]").attr("checked", true);
380
381    /* forbid to select this filter in the addFilter list */
382    $("#addFilter").children("option[value="+filter+"]").attr("disabled", "disabled");
383  }
384
385  $("#addFilter").change(function () {
386    var filter = $(this).attr("value");
387    filter_enable(filter);
388    $(this).attr("value", -1);
389  });
390 
391  $("select[name='filter_dimension']").change(function () {
392    $("span[id^='filter_dimension_']").hide();
393    $("span#filter_dimension_"+ $(this).attr("value")).show();
394  });
395 
396  $("a.ratio-choice").click(function() {
397    $("input[name='filter_ratio_min']").val($(this).data("min"));
398    $("input[name='filter_ratio_max']").val($(this).data("max"));
399  });
400
401  function filter_disable(filter) {
402    /* hide the filter line */
403    $("#"+filter).hide();
404
405    /* uncheck the checkbox to declare we do not use this filter */
406    $("input[name="+filter+"_use]").removeAttr("checked");
407
408    /* give the possibility to show it again */
409    $("#addFilter").children("option[value="+filter+"]").removeAttr("disabled");
410  }
411
412  $("#removeFilters").click(function() {
413    $("#filterList li").each(function() {
414      var filter = $(this).attr("id");
415      filter_disable(filter);
416    });
417    return false;
418  });
419
420  jQuery('#applyAction').click(function() {
421                var action = jQuery('[name="selectAction"]').val();
422                if (action == 'delete_derivatives') {
423                        var d_count = $('#action_delete_derivatives input[type=checkbox]').filter(':checked').length
424                                , e_count = $('input[name="setSelected"]').is(':checked') ? nb_thumbs_set : $('.thumbnails input[type=checkbox]').filter(':checked').length;
425                        if (d_count*e_count > 500)
426                                return confirm(are_you_sure);
427                }
428               
429                if (action != 'generate_derivatives'
430                        || derivatives.finished() )
431                {
432                        return true;
433                }
434
435                jQuery('.bulkAction').hide();
436
437                var queuedManager = jQuery.manageAjax.create('queued', {
438                        queue: true, 
439                        cacheResponse: false,
440                        maxRequests: 1
441                });
442
443                derivatives.elements = [];
444                if (jQuery('input[name="setSelected"]').attr('checked'))
445                        derivatives.elements = all_elements;
446                else
447                        jQuery('.thumbnails input[type=checkbox]').each(function() {
448                                if (jQuery(this).attr('checked')) {
449                                        derivatives.elements.push(jQuery(this).val());
450                                }
451                        });
452
453                jQuery('#applyActionBlock').hide();
454                jQuery('select[name="selectAction"]').hide();
455                jQuery('#regenerationMsg').show();
456               
457                progress();
458                getDerivativeUrls();
459                return false;
460  });
461
462        function getDerivativeUrls() {
463                var ids = derivatives.elements.splice(0, 500);
464                var params = {max_urls: 100000, ids: ids, types: []};
465                jQuery("#action_generate_derivatives input").each( function(i, t) {
466                        if ($(t).attr("checked"))
467                                params.types.push( t.value );
468                } );
469
470                jQuery.ajax( {
471                        type: "POST",
472                        url: 'ws.php?format=json&method=pwg.getMissingDerivatives',
473                        data: params,
474                        dataType: "json",
475                        success: function(data) {
476                                if (!data.stat || data.stat != "ok") {
477                                        return;
478                                }
479                                derivatives.total += data.result.urls.length;
480                                progress();
481                                for (var i=0; i < data.result.urls.length; i++) {
482                                        jQuery.manageAjax.add("queued", {
483                                                type: 'GET',
484                                                url: data.result.urls[i] + "&ajaxload=true",
485                                                dataType: 'json',
486                                                success: ( function(data) { derivatives.done++; progress(true) }),
487                                                error: ( function(data) { derivatives.done++; progress(false) })
488                                        });
489                                }
490                                if (derivatives.elements.length)
491                                        setTimeout( getDerivativeUrls, 25 * (derivatives.total-derivatives.done));
492                        }
493                } );
494        }
495
496  checkPermitAction()
497});
498
499
500{/literal}{/footer_script}
501
502<div id="batchManagerGlobal">
503
504<h2>{'Batch Manager'|@translate}</h2>
505
506  <form action="{$F_ACTION}" method="post">
507        <input type="hidden" name="start" value="{$START}">
508
509  <fieldset>
510    <legend>{'Filter'|@translate}</legend>
511
512    <ul id="filterList">
513      <li id="filter_prefilter" {if !isset($filter.prefilter)}style="display:none"{/if}>
514        <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
515        <input type="checkbox" name="filter_prefilter_use" class="useFilterCheckbox" {if isset($filter.prefilter)}checked="checked"{/if}>
516        {'Predefined filter'|@translate}
517        <select name="filter_prefilter">
518          {foreach from=$prefilters item=prefilter}
519          <option value="{$prefilter.ID}" {if isset($filter.prefilter) && $filter.prefilter eq $prefilter.ID}selected="selected"{/if}>{$prefilter.NAME}</option>
520          {/foreach}
521        </select>
522      </li>
523     
524      <li id="filter_category" {if !isset($filter.category)}style="display:none"{/if}>
525        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
526        <input type="checkbox" name="filter_category_use" class="useFilterCheckbox" {if isset($filter.category)}checked="checked"{/if}>
527        {'Album'|@translate}
528        <select style="width:400px" name="filter_category" size="1">
529          {html_options options=$category_full_name_options selected=$filter_category_selected}
530        </select>
531        <label><input type="checkbox" name="filter_category_recursive" {if isset($filter.category_recursive)}checked="checked"{/if}> {'include child albums'|@translate}</label>
532      </li>
533     
534      <li id="filter_tags" {if !isset($filter.tags)}style="display:none"{/if}>
535        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
536        <input type="checkbox" name="filter_tags_use" class="useFilterCheckbox" {if isset($filter.tags)}checked="checked"{/if}>
537        {'Tags'|@translate}
538        <select id="tagsFilter" name="filter_tags">
539          {if isset($filter_tags)}{foreach from=$filter_tags item=tag}
540          <option value="{$tag.id}">{$tag.name}</option>
541          {/foreach}{/if}
542        </select>
543        <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>
544        <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>
545      </li>
546     
547      <li id="filter_level" {if !isset($filter.level)}style="display:none"{/if}>
548        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
549        <input type="checkbox" name="filter_level_use" class="useFilterCheckbox" {if isset($filter.level)}checked="checked"{/if}>
550        {'Privacy level'|@translate}
551        <select name="filter_level" size="1">
552          {html_options options=$filter_level_options selected=$filter_level_options_selected}
553        </select>
554        <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>
555      </li>
556     
557      <li id="filter_dimension" {if !isset($filter.dimension)}style="display:none"{/if}>
558        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
559        <input type="checkbox" name="filter_dimension_use" class="useFilterCheckbox" {if isset($filter.dimension)}checked="checked"{/if}>
560        {'Dimensions'|@translate} :
561        <label>{'Minimum width'|@translate} <input type="text" name="filter_dimension_min_width" value="{$filter.dimension.min_width}" size="4"></label> —
562        <label>{'Maximum width'|@translate} <input type="text" name="filter_dimension_max_width" value="{$filter.dimension.max_width}" size="4"></label> —
563        <label>{'Minimum height'|@translate} <input type="text" name="filter_dimension_min_height" value="{$filter.dimension.min_height}" size="4"></label>     —
564        <label>{'Maximum height'|@translate} <input type="text" name="filter_dimension_max_height" value="{$filter.dimension.max_height}" size="4"></label>
565      </li>
566     
567      <li id="filter_ratio" {if !isset($filter.ratio)}style="display:none"{/if}>
568        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
569        <input type="checkbox" name="filter_ratio_use" class="useFilterCheckbox" {if isset($filter.ratio)}checked="checked"{/if}>
570        {'Ratio'|@translate} :
571        <label>{'Minimum'|@translate} <input type="text" name="filter_ratio_min" value="{$filter.ratio.min}" size="4"></label> —
572        <label>{'Maximum'|@translate} <input type="text" name="filter_ratio_max" value="{$filter.ratio.max}" size="4"></label> —
573        <a class="ratio-choice" data-min="" data-max="0.95">{'Portrait'|@translate}</a> |
574        <a class="ratio-choice" data-min="0.95" data-max="1.05">{'square'|@translate}</a> |
575        <a class="ratio-choice" data-min="1.05" data-max="2.5">{'Landscape'|@translate}</a> |
576        <a class="ratio-choice" data-min="2.5" data-max="">{'Panorama'|@translate}</a>
577      </li>
578    </ul>
579
580    <p class="actionButtons">
581      <select id="addFilter">
582        <option value="-1">{'Add a filter'|@translate}</option>
583        <option disabled="disabled">------------------</option>
584        <option value="filter_prefilter" {if isset($filter.prefilter)}disabled="disabled"{/if}>{'Predefined filter'|@translate}</option>
585        <option value="filter_category" {if isset($filter.category)}disabled="disabled"{/if}>{'Album'|@translate}</option>
586        <option value="filter_tags" {if isset($filter.tags)}disabled="disabled"{/if}>{'Tags'|@translate}</option>
587        <option value="filter_level" {if isset($filter.level)}disabled="disabled"{/if}>{'Privacy level'|@translate}</option>
588        <option value="filter_dimension" {if isset($filter.dimension)}disabled="disabled"{/if}>{'Dimensions'|@translate}</option>
589        <option value="filter_ratio" {if isset($filter.ratio)}disabled="disabled"{/if}>{'Ratio'|@translate}</option>
590      </select>
591      <a id="removeFilters" href="">{'Remove all filters'|@translate}</a>
592    </p>
593
594    <p class="actionButtons" id="applyFilterBlock">
595      <input id="applyFilter" class="submit" type="submit" value="{'Refresh photo set'|@translate}" name="submitFilter">
596    </p>
597
598  </fieldset>
599
600  <fieldset>
601
602    <legend>{'Selection'|@translate}</legend>
603
604  {if !empty($thumbnails)}
605  <p id="checkActions">
606    {'Select:'|@translate}
607{if $nb_thumbs_set > $nb_thumbs_page}
608    <a href="#" id="selectAll">{'The whole page'|@translate}</a>,
609    <a href="#" id="selectSet">{'The whole set'|@translate}</a>,
610{else}
611    <a href="#" id="selectAll">{'All'|@translate}</a>,
612{/if}
613    <a href="#" id="selectNone">{'None'|@translate}</a>,
614    <a href="#" id="selectInvert">{'Invert'|@translate}</a>
615
616    <span id="selectedMessage"></span>
617
618    <input type="checkbox" name="setSelected" style="display:none" {if count($selection) == $nb_thumbs_set}checked="checked"{/if}>
619  </p>
620
621        <ul class="thumbnails">
622                {html_style}
623UL.thumbnails SPAN.wrap2{ldelim}
624  width: {$thumb_params->max_width()+2}px;
625}
626UL.thumbnails SPAN.wrap2 {ldelim}
627  height: {$thumb_params->max_height()+25}px;
628}
629                {/html_style}
630                {foreach from=$thumbnails item=thumbnail}
631                {assign var='isSelected' value=$thumbnail.id|@in_array:$selection}
632                <li>
633                        <span class="wrap1">
634                                <label>
635                                        <input type="checkbox" name="selection[]" value="{$thumbnail.id}" {if $isSelected}checked="checked"{/if}>
636                                        <span class="wrap2{if $isSelected} thumbSelected{/if}">
637                                        <div class="actions"><a href="{$thumbnail.FILE_SRC}" class="preview-box">{'Zoom'|@translate}</a> &middot; <a href="{$thumbnail.U_EDIT}" target="_blank">{'Edit'|@translate}</a></div>
638                                                {if $thumbnail.level > 0}
639                                                <em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.level))}</em>
640                                                <em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.level))}</em>
641                                                {/if}
642                                                <img src="{$thumbnail.thumb->get_url()}" alt="{$thumbnail.file}" title="{$thumbnail.TITLE|@escape:'html'}" {$thumbnail.thumb->get_size_htm()}>
643                                        </span>
644                                </label>
645                        </span>
646                </li>
647                {/foreach}
648        </ul>
649
650  {if !empty($navbar) }
651  <div style="clear:both;">
652
653    <div style="float:left">
654    {include file='navigation_bar.tpl'|@get_extent:'navbar'}
655    </div>
656
657    <div style="float:right;margin-top:10px;">{'display'|@translate}
658      <a href="{$U_DISPLAY}&amp;display=20">20</a>
659      &middot; <a href="{$U_DISPLAY}&amp;display=50">50</a>
660      &middot; <a href="{$U_DISPLAY}&amp;display=100">100</a>
661      &middot; <a href="{$U_DISPLAY}&amp;display=all">{'all'|@translate}</a>
662      {'photos per page'|@translate}
663    </div>
664  </div>
665  {/if}
666
667  {else}
668  <div>{'No photo in the current set.'|@translate}</div>
669  {/if}
670  </fieldset>
671
672  <fieldset id="action">
673
674    <legend>{'Action'|@translate}</legend>
675      <div id="forbidAction"{if count($selection) != 0} style="display:none"{/if}>{'No photo selected, no action possible.'|@translate}</div>
676      <div id="permitAction"{if count($selection) == 0} style="display:none"{/if}>
677
678    <select name="selectAction">
679      <option value="-1">{'Choose an action'|@translate}</option>
680      <option disabled="disabled">------------------</option>
681      <option value="delete">{'Delete selected photos'|@translate}</option>
682      <option value="associate">{'Associate to album'|@translate}</option>
683      <option value="move">{'Move to album'|@translate}</option>
684  {if !empty($dissociate_options)}
685      <option value="dissociate">{'Dissociate from album'|@translate}</option>
686  {/if}
687      <option value="add_tags">{'Add tags'|@translate}</option>
688  {if !empty($DEL_TAG_SELECTION)}
689      <option value="del_tags">{'remove tags'|@translate}</option>
690  {/if}
691      <option value="author">{'Set author'|@translate}</option>
692      <option value="title">{'Set title'|@translate}</option>
693      <option value="date_creation">{'Set creation date'|@translate}</option>
694      <option value="level">{'Who can see these photos?'|@translate}</option>
695      <option value="metadata">{'Synchronize metadata'|@translate}</option>
696  {if ($IN_CADDIE)}
697      <option value="remove_from_caddie">{'Remove from caddie'|@translate}</option>
698  {else}
699      <option value="add_to_caddie">{'Add to caddie'|@translate}</option>
700  {/if}
701                <option value="delete_derivatives">{'Delete multiple size images'|@translate}</option>
702                <option value="generate_derivatives">{'Generate multiple size images'|@translate}</option>
703  {if !empty($element_set_global_plugins_actions)}
704    {foreach from=$element_set_global_plugins_actions item=action}
705      <option value="{$action.ID}">{$action.NAME}</option>
706    {/foreach}
707  {/if}
708    </select>
709
710    <!-- delete -->
711    <div id="action_delete" class="bulkAction">
712    <p><label><input type="checkbox" name="confirm_deletion" value="1"> {'Are you sure?'|@translate}</label></p>
713    </div>
714
715    <!-- associate -->
716    <div id="action_associate" class="bulkAction">
717          <select style="width:400px" name="associate" size="1">
718            {html_options options=$category_full_name_options}
719         </select>
720<br>{'... or '|@translate} <a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
721    </div>
722
723    <!-- move -->
724    <div id="action_move" class="bulkAction">
725          <select style="width:400px" name="move" size="1">
726            {html_options options=$category_full_name_options}
727         </select>
728<br>{'... or '|@translate} <a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
729    </div>
730
731
732    <!-- dissociate -->
733    <div id="action_dissociate" class="bulkAction">
734          <select style="width:400px" name="dissociate" size="1">
735            {if !empty($dissociate_options)}{html_options options=$dissociate_options }{/if}
736          </select>
737    </div>
738
739
740    <!-- add_tags -->
741    <div id="action_add_tags" class="bulkAction">
742<select id="tags" name="add_tags">
743</select>
744    </div>
745
746    <!-- del_tags -->
747    <div id="action_del_tags" class="bulkAction">
748{if !empty($DEL_TAG_SELECTION)}{$DEL_TAG_SELECTION}{/if}
749    </div>
750
751    <!-- author -->
752    <div id="action_author" class="bulkAction">
753    <label><input type="checkbox" name="remove_author"> {'remove author'|@translate}</label><br>
754    {assign var='authorDefaultValue' value='Type here the author name'|@translate}
755<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;">
756    </div>   
757
758    <!-- title -->
759    <div id="action_title" class="bulkAction">
760    <label><input type="checkbox" name="remove_title"> {'remove title'|@translate}</label><br>
761    {assign var='titleDefaultValue' value='Type here the title'|@translate}
762<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;">
763    </div>
764
765    <!-- date_creation -->
766    <div id="action_date_creation" class="bulkAction">
767      <label><input type="checkbox" name="remove_date_creation"> {'remove creation date'|@translate}</label><br>
768      <div id="set_date_creation">
769          <select id="date_creation_day" name="date_creation_day">
770             <option value="0">--</option>
771            {section name=day start=1 loop=32}
772              <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$DATE_CREATION_DAY}selected="selected"{/if}>{$smarty.section.day.index}</option>
773            {/section}
774          </select>
775          <select id="date_creation_month" name="date_creation_month">
776            {html_options options=$month_list selected=$DATE_CREATION_MONTH}
777          </select>
778          <input id="date_creation_year"
779                 name="date_creation_year"
780                 type="text"
781                 size="4"
782                 maxlength="4"
783                 value="{$DATE_CREATION_YEAR}">
784          <input id="date_creation_linked_date" name="date_creation_linked_date" type="hidden" size="10" disabled="disabled">
785      </div>
786    </div>
787
788    <!-- level -->
789    <div id="action_level" class="bulkAction">
790        <select name="level" size="1">
791          {html_options options=$level_options selected=$level_options_selected}
792        </select>
793    </div>
794
795    <!-- metadata -->
796    <div id="action_metadata" class="bulkAction">
797    </div>
798
799                <!-- generate derivatives -->
800                <div id="action_generate_derivatives" class="bulkAction">
801                        <a href="javascript:selectGenerateDerivAll()">{'All'|@translate}</a>,
802                        <a href="javascript:selectGenerateDerivNone()">{'None'|@translate}</a>
803                        <br>
804                        {foreach from=$generate_derivatives_types key=type item=disp}
805                                <label><input type="checkbox" name="generate_derivatives_type[]" value="{$type}"> {$disp}</label>
806                        {/foreach}
807                        {footer_script}
808                        function selectGenerateDerivAll() {ldelim}
809                                $("#action_generate_derivatives input[type=checkbox]").attr("checked", true);
810                        }
811                        function selectGenerateDerivNone() {ldelim}
812                                $("#action_generate_derivatives input[type=checkbox]").attr("checked", false);
813                        }
814                        {/footer_script}
815                </div>
816
817                <!-- delete derivatives -->
818                <div id="action_delete_derivatives" class="bulkAction">
819                        <a href="javascript:selectDelDerivAll()">{'All'|@translate}</a>,
820                        <a href="javascript:selectDelDerivNone()">{'None'|@translate}</a>
821                        <br>
822                        {foreach from=$del_derivatives_types key=type item=disp}
823                                <label><input type="checkbox" name="del_derivatives_type[]" value="{$type}"> {$disp}</label>
824                        {/foreach}
825                        {footer_script}
826                        function selectDelDerivAll() {ldelim}
827                                $("#action_delete_derivatives input[type=checkbox]").attr("checked", true);
828                        }
829                        function selectDelDerivNone() {ldelim}
830                                $("#action_delete_derivatives input[type=checkbox]").attr("checked", false);
831                        }
832                        {/footer_script}
833                </div>
834               
835    <!-- progress bar -->
836    <div id="regenerationMsg" class="bulkAction" style="display:none">
837      <p id="regenerationText" style="margin-bottom:10px;">{'Generate multiple size images'|@translate}</p>
838      <span class="progressBar" id="progressBar"></span>
839      <input type="hidden" name="regenerateSuccess" value="0">
840      <input type="hidden" name="regenerateError" value="0">
841    </div>
842
843    <!-- plugins -->
844{if !empty($element_set_global_plugins_actions)}
845  {foreach from=$element_set_global_plugins_actions item=action}
846    <div id="action_{$action.ID}" class="bulkAction">
847    {if !empty($action.CONTENT)}{$action.CONTENT}{/if}
848    </div>
849  {/foreach}
850{/if}
851
852    <p id="applyActionBlock" style="display:none" class="actionButtons">
853      <input id="applyAction" class="submit" type="submit" value="{'Apply action'|@translate}" name="submit"> <span id="applyOnDetails"></span></p>
854
855    </div> <!-- #permitAction -->
856  </fieldset>
857
858  </form>
859
860</div> <!-- #batchManagerGlobal -->
Note: See TracBrowser for help on using the repository browser.