source: branches/2.3/admin/themes/default/template/batch_manager_global.tpl @ 12629

Last change on this file since 12629 was 12629, checked in by plg, 12 years ago

bug 2506 fixed: Batch Manager does not take permissions into account when
filtering on tags

feature 2507 added: Batch Manager can filter on "all tags" or "any tag"

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