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

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

feature 2309 added: ability to "move photos" into an album from the Batch
Manager, ie "dissociate from all albums" + "associate" in a single action.

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