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

Last change on this file since 12825 was 12630, checked in by plg, 13 years ago

merge r12629 from branch 2.3 to trunk

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