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

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

feature 2470 added: ability to create a new album "on the fly" on the
"associate to album" action of the Batch Manager. The code was moved
from the upload form and is now used by the upload form + Batch Manager.

File size: 29.0 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    if ($(this).val() != -1) {
198      $("#applyActionBlock").show();
199    }
200    else {
201      $("#applyActionBlock").hide();
202    }
203  });
204
205  $(".wrap1 label").click(function () {
206    $("input[name=setSelected]").attr('checked', false);
207
208    var wrap2 = $(this).children(".wrap2");
209    var checkbox = $(this).children("input[type=checkbox]");
210
211    if ($(checkbox).is(':checked')) {
212      $(wrap2).addClass("thumbSelected");
213    }
214    else {
215      $(wrap2).removeClass('thumbSelected');
216    }
217
218    checkPermitAction();
219  });
220
221  $("#selectAll").click(function () {
222    $("input[name=setSelected]").attr('checked', false);
223    selectPageThumbnails();
224    checkPermitAction();
225    return false;
226  });
227
228  function selectPageThumbnails() {
229    $(".thumbnails label").each(function() {
230      var wrap2 = $(this).children(".wrap2");
231      var checkbox = $(this).children("input[type=checkbox]");
232
233      $(checkbox).attr('checked', true);
234      $(wrap2).addClass("thumbSelected");
235    });
236  }
237
238  $("#selectNone").click(function () {
239    $("input[name=setSelected]").attr('checked', false);
240
241    $(".thumbnails label").each(function() {
242      var wrap2 = $(this).children(".wrap2");
243      var checkbox = $(this).children("input[type=checkbox]");
244
245      $(checkbox).attr('checked', false);
246      $(wrap2).removeClass("thumbSelected");
247    });
248    checkPermitAction();
249    return false;
250  });
251
252  $("#selectInvert").click(function () {
253    $("input[name=setSelected]").attr('checked', false);
254
255    $(".thumbnails label").each(function() {
256      var wrap2 = $(this).children(".wrap2");
257      var checkbox = $(this).children("input[type=checkbox]");
258
259      $(checkbox).attr('checked', !$(checkbox).is(':checked'));
260
261      if ($(checkbox).is(':checked')) {
262        $(wrap2).addClass("thumbSelected");
263      }
264      else {
265        $(wrap2).removeClass('thumbSelected');
266      }
267    });
268    checkPermitAction();
269    return false;
270  });
271
272  $("#selectSet").click(function () {
273    selectPageThumbnails();
274    $("input[name=setSelected]").attr('checked', true);
275    checkPermitAction();
276    return false;
277  });
278
279  $("input[name=remove_author]").click(function () {
280    if ($(this).is(':checked')) {
281      $("input[name=author]").hide();
282    }
283    else {
284      $("input[name=author]").show();
285    }
286  });
287
288  $("input[name=remove_title]").click(function () {
289    if ($(this).is(':checked')) {
290      $("input[name=title]").hide();
291    }
292    else {
293      $("input[name=title]").show();
294    }
295  });
296
297  $("input[name=remove_date_creation]").click(function () {
298    if ($(this).is(':checked')) {
299      $("#set_date_creation").hide();
300    }
301    else {
302      $("#set_date_creation").show();
303    }
304  });
305
306  $(".removeFilter").click(function () {
307    var filter = $(this).parent('li').attr("id");
308    filter_disable(filter);
309
310    return false;
311  });
312
313  function filter_enable(filter) {
314    /* show the filter*/
315    $("#"+filter).show();
316
317    /* check the checkbox to declare we use this filter */
318    $("input[type=checkbox][name="+filter+"_use]").attr("checked", true);
319
320    /* forbid to select this filter in the addFilter list */
321    $("#addFilter").children("option[value="+filter+"]").attr("disabled", "disabled");
322  }
323
324  $("#addFilter").change(function () {
325    var filter = $(this).attr("value");
326    filter_enable(filter);
327    $(this).attr("value", -1);
328  });
329
330  function filter_disable(filter) {
331    /* hide the filter line */
332    $("#"+filter).hide();
333
334    /* uncheck the checkbox to declare we do not use this filter */
335    $("input[name="+filter+"_use]").removeAttr("checked");
336
337    /* give the possibility to show it again */
338    $("#addFilter").children("option[value="+filter+"]").removeAttr("disabled");
339  }
340
341  $("#removeFilters").click(function() {
342    $("#filterList li").each(function() {
343      var filter = $(this).attr("id");
344      filter_disable(filter);
345    });
346    return false;
347  });
348
349  jQuery('#applyAction').click(function() {
350    if (elements.length != 0)
351    {
352      return true;
353    }
354    else if (jQuery('[name="selectAction"]').val() == 'regenerateThumbnails')
355    {
356      resizeMethod = 'pwg.images.resizeThumbnail';
357      maxRequests = 3;
358      maxwidth = jQuery('input[name="thumb_maxwidth"]').val();
359      maxheight = jQuery('input[name="thumb_maxheight"]').val();
360      regenerationText = regenerateThumbnailsMessage;
361      crop = jQuery('input[name="thumb_crop"]').is(':checked');
362      follow_orientation = jQuery('input[name="thumb_follow_orientation"]').is(':checked');
363    }
364    else if(jQuery('[name="selectAction"]').val() == 'regenerateWebsize')
365    {
366      resizeMethod = 'pwg.images.resizeWebsize';
367      maxRequests = 1;
368      maxwidth = jQuery('input[name="websize_maxwidth"]').val();
369      maxheight = jQuery('input[name="websize_maxheight"]').val();
370      regenerationText = regenerateWebsizeMessage;
371      crop = false;
372      follow_orientation = false;
373    }
374    else return true;
375
376    jQuery('.bulkAction').hide();
377    jQuery('#regenerationText').html(regenerationText);
378
379    var queuedManager = jQuery.manageAjax.create('queued', {
380      queue: true, 
381      cacheResponse: false,
382      maxRequests: maxRequests
383    });
384
385    if (jQuery('input[name="setSelected"]').attr('checked'))
386      elements = all_elements;
387    else
388      jQuery('input[name="selection[]"]').each(function() {
389        if (jQuery(this).attr('checked')) {
390          elements.push(jQuery(this).val());
391        }
392      });
393
394    progressBar_max = elements.length;
395    todo = 0;
396
397    jQuery('#applyActionBlock').hide();
398    jQuery('select[name="selectAction"]').hide();
399    jQuery('#regenerationMsg').show();
400   
401    jQuery('#progressBar').progressBar(0, {
402      max: progressBar_max,
403      textFormat: 'fraction',
404      boxImage: 'themes/default/images/progressbar.gif',
405      barImage: 'themes/default/images/progressbg_orange.gif'
406    });
407
408    for (i=0;i<elements.length;i++) {
409      queuedManager.add({
410        type: 'GET',
411        url: 'ws.php',
412        data: {
413          method: resizeMethod,
414          maxwidth: maxwidth,
415          maxheight: maxheight,
416          crop: crop,
417          follow_orientation: follow_orientation,
418          image_id: elements[i],
419          format: 'json'
420        },
421        dataType: 'json',
422        success: ( function(data) { progress(++todo, progressBar_max, data['result']) }),
423        error: ( function(data) { progress(++todo, progressBar_max, false) })
424      });
425    }
426    return false;
427  });
428
429  function toggleCropFields(prefix) {
430    if (jQuery("#"+prefix+"_crop").is(':checked')) {
431      jQuery("#"+prefix+"_width_th").text(width_str);
432      jQuery("#"+prefix+"_height_th").text(height_str);
433      jQuery("#"+prefix+"_follow_orientation_tr").show();
434    }
435    else {
436      jQuery("#"+prefix+"_width_th").text(max_width_str);
437      jQuery("#"+prefix+"_height_th").text(max_height_str);
438      jQuery("#"+prefix+"_follow_orientation_tr").hide();
439    }
440  }
441
442  toggleCropFields("thumb");
443  jQuery("#thumb_crop").click(function () {toggleCropFields("thumb")});
444
445  checkPermitAction()
446});
447
448jQuery(window).load(function() {
449        var max_dim = 0;
450        $(".thumbnails img").each(function () {
451                max_dim = Math.max(max_dim, $(this).height(), $(this).width() );
452        });
453        max_dim += 20;
454        $("ul.thumbnails span, ul.thumbnails label").css('width', max_dim+'px').css('height', max_dim+'px');
455});
456{/literal}{/footer_script}
457
458<div id="batchManagerGlobal">
459
460<h2>{'Batch Manager'|@translate}</h2>
461
462  <form action="{$F_ACTION}" method="post">
463
464  <fieldset>
465    <legend>{'Filter'|@translate}</legend>
466
467    <ul id="filterList">
468      <li id="filter_prefilter" {if !isset($filter.prefilter)}style="display:none"{/if}>
469        <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
470        <input type="checkbox" name="filter_prefilter_use" class="useFilterCheckbox" {if isset($filter.prefilter)}checked="checked"{/if}>
471        {'Predefined filter'|@translate}
472        <select name="filter_prefilter">
473          {foreach from=$prefilters item=prefilter}
474          <option value="{$prefilter.ID}" {if $filter.prefilter eq $prefilter.ID}selected="selected"{/if}>{$prefilter.NAME}</option>
475          {/foreach}
476        </select>
477      </li>
478      <li id="filter_category" {if !isset($filter.category)}style="display:none"{/if}>
479        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
480        <input type="checkbox" name="filter_category_use" class="useFilterCheckbox" {if isset($filter.category)}checked="checked"{/if}>
481        {'Album'|@translate}
482        <select style="width:400px" name="filter_category" size="1">
483          {html_options options=$filter_category_options selected=$filter_category_options_selected}
484        </select>
485        <label><input type="checkbox" name="filter_category_recursive" {if isset($filter.category_recursive)}checked="checked"{/if}> {'include child albums'|@translate}</label>
486      </li>
487      <li id="filter_tags" {if !isset($filter.tags)}style="display:none"{/if}>
488        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
489        <input type="checkbox" name="filter_tags_use" class="useFilterCheckbox" {if isset($filter.tags)}checked="checked"{/if}>
490        {'Tags'|@translate}
491        <select id="tagsFilter" name="filter_tags">
492          {foreach from=$filter_tags item=tag}
493          <option value="{$tag.id}">{$tag.name}</option>
494          {/foreach}
495        </select>
496        <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>
497        <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>
498      </li>
499      <li id="filter_level" {if !isset($filter.level)}style="display:none"{/if}>
500        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
501        <input type="checkbox" name="filter_level_use" class="useFilterCheckbox" {if isset($filter.level)}checked="checked"{/if}>
502        {'Who can see these photos?'|@translate}
503        <select name="filter_level" size="1">
504          {html_options options=$filter_level_options selected=$filter_level_options_selected}
505        </select>
506      </li>
507    </ul>
508
509    <p class="actionButtons" style="">
510      <select id="addFilter">
511        <option value="-1">{'Add a filter'|@translate}</option>
512        <option disabled="disabled">------------------</option>
513        <option value="filter_prefilter">{'Predefined filter'|@translate}</option>
514        <option value="filter_category">{'Album'|@translate}</option>
515                                <option value="filter_tags">{'Tags'|@translate}</option>
516        <option value="filter_level">{'Who can see these photos?'|@translate}</option>
517      </select>
518<!--      <input id="removeFilters" class="submit" type="submit" value="Remove all filters" name="removeFilters"> -->
519      <a id="removeFilters" href="">{'Remove all filters'|@translate}</a>
520    </p>
521
522    <p class="actionButtons" id="applyFilterBlock">
523      <input id="applyFilter" class="submit" type="submit" value="{'Refresh photo set'|@translate}" name="submitFilter">
524    </p>
525
526  </fieldset>
527
528  <fieldset>
529
530    <legend>{'Selection'|@translate}</legend>
531
532  {if !empty($thumbnails)}
533  <p id="checkActions">
534    {'Select:'|@translate}
535{if $nb_thumbs_set > $nb_thumbs_page}
536    <a href="#" id="selectAll">{'The whole page'|@translate}</a>,
537    <a href="#" id="selectSet">{'The whole set'|@translate}</a>,
538{else}
539    <a href="#" id="selectAll">{'All'|@translate}</a>,
540{/if}
541    <a href="#" id="selectNone">{'None'|@translate}</a>,
542    <a href="#" id="selectInvert">{'Invert'|@translate}</a>
543
544    <span id="selectedMessage"></span>
545
546    <input type="checkbox" name="setSelected" style="display:none" {if count($selection) == $nb_thumbs_set}checked="checked"{/if}>
547  </p>
548
549    <ul class="thumbnails">
550      {foreach from=$thumbnails item=thumbnail}
551        {if in_array($thumbnail.ID, $selection)}
552          {assign var='isSelected' value=true}
553        {else}
554          {assign var='isSelected' value=false}
555        {/if}
556
557      <li>
558        <span class="wrap1">
559          <label>
560            <span class="wrap2{if $isSelected} thumbSelected{/if}">
561            <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>
562              {if $thumbnail.LEVEL > 0}
563              <em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em>
564              <em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em>
565              {/if}
566              <span>
567                <img src="{$thumbnail.TN_SRC}"
568                   alt="{$thumbnail.FILE}"
569                   title="{$thumbnail.TITLE|@escape:'html'}"
570                   class="thumbnail">
571              </span>
572            </span>
573            <input type="checkbox" name="selection[]" value="{$thumbnail.ID}" {if $isSelected}checked="checked"{/if}>
574          </label>
575        </span>
576      </li>
577      {/foreach}
578    </ul>
579
580  {if !empty($navbar) }
581  <div style="clear:both;">
582
583    <div style="float:left">
584    {include file='navigation_bar.tpl'|@get_extent:'navbar'}
585    </div>
586
587    <div style="float:right;margin-top:10px;">{'display'|@translate}
588      <a href="{$U_DISPLAY}&amp;display=20">20</a>
589      &middot; <a href="{$U_DISPLAY}&amp;display=50">50</a>
590      &middot; <a href="{$U_DISPLAY}&amp;display=100">100</a>
591      &middot; <a href="{$U_DISPLAY}&amp;display=all">{'all'|@translate}</a>
592      {'photos per page'|@translate}
593    </div>
594  </div>
595  {/if}
596
597  {else}
598  <div>{'No photo in the current set.'|@translate}</div>
599  {/if}
600  </fieldset>
601
602  <fieldset id="action">
603
604    <legend>{'Action'|@translate}</legend>
605      <div id="forbidAction"{if count($selection) != 0}style="display:none"{/if}>{'No photo selected, no action possible.'|@translate}</div>
606      <div id="permitAction"{if count($selection) == 0}style="display:none"{/if}>
607
608    <select name="selectAction">
609      <option value="-1">{'Choose an action'|@translate}</option>
610      <option disabled="disabled">------------------</option>
611  {if isset($show_delete_form) }
612      <option value="delete">{'Delete selected photos'|@translate}</option>
613  {/if}
614      <option value="associate">{'Associate to album'|@translate}</option>
615  {if !empty($dissociate_options)}
616      <option value="dissociate">{'Dissociate from album'|@translate}</option>
617  {/if}
618      <option value="add_tags">{'Add tags'|@translate}</option>
619  {if !empty($DEL_TAG_SELECTION)}
620      <option value="del_tags">{'remove tags'|@translate}</option>
621  {/if}
622      <option value="author">{'Set author'|@translate}</option>
623      <option value="title">{'Set title'|@translate}</option>
624      <option value="date_creation">{'Set creation date'|@translate}</option>
625      <option value="level">{'Who can see these photos?'|@translate}</option>
626      <option value="metadata">{'Synchronize metadata'|@translate}</option>
627  {if ($IN_CADDIE)}
628      <option value="remove_from_caddie">{'Remove from caddie'|@translate}</option>
629  {else}
630      <option value="add_to_caddie">{'Add to caddie'|@translate}</option>
631  {/if}
632      <option value="regenerateThumbnails">{'Regenerate Thumbnails'|@translate}</option>
633      <option value="regenerateWebsize">{'Regenerate Websize Photos'|@translate}</option>
634  {if !empty($element_set_global_plugins_actions)}
635    {foreach from=$element_set_global_plugins_actions item=action}
636      <option value="{$action.ID}">{$action.NAME}</option>
637    {/foreach}
638  {/if}
639    </select>
640
641    <!-- delete -->
642    <div id="action_delete" class="bulkAction">
643    <p><label><input type="checkbox" name="confirm_deletion" value="1"> {'Are you sure?'|@translate}</label></p>
644    </div>
645
646    <!-- associate -->
647    <div id="action_associate" class="bulkAction">
648          <select id="albumSelect" style="width:400px" name="associate" size="1">
649            {html_options options=$associate_options }
650         </select>
651<br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
652    </div>
653
654    <!-- dissociate -->
655    <div id="action_dissociate" class="bulkAction">
656          <select style="width:400px" name="dissociate" size="1">
657            {if !empty($dissociate_options)}{html_options options=$dissociate_options }{/if}
658          </select>
659    </div>
660
661
662    <!-- add_tags -->
663    <div id="action_add_tags" class="bulkAction">
664<select id="tags" name="add_tags">
665</select>
666    </div>
667
668    <!-- del_tags -->
669    <div id="action_del_tags" class="bulkAction">
670{$DEL_TAG_SELECTION}
671    </div>
672
673    <!-- author -->
674    <div id="action_author" class="bulkAction">
675    <label><input type="checkbox" name="remove_author"> {'remove author'|@translate}</label><br>
676    {assign var='authorDefaultValue' value='Type here the author name'|@translate}
677<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;">
678    </div>   
679
680    <!-- title -->
681    <div id="action_title" class="bulkAction">
682    <label><input type="checkbox" name="remove_title"> {'remove title'|@translate}</label><br>
683    {assign var='titleDefaultValue' value='Type here the title'|@translate}
684<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;">
685    </div>
686
687    <!-- date_creation -->
688    <div id="action_date_creation" class="bulkAction">
689      <label><input type="checkbox" name="remove_date_creation"> {'remove creation date'|@translate}</label><br>
690      <div id="set_date_creation">
691          <select id="date_creation_day" name="date_creation_day">
692             <option value="0">--</option>
693            {section name=day start=1 loop=32}
694              <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$DATE_CREATION_DAY}selected="selected"{/if}>{$smarty.section.day.index}</option>
695            {/section}
696          </select>
697          <select id="date_creation_month" name="date_creation_month">
698            {html_options options=$month_list selected=$DATE_CREATION_MONTH}
699          </select>
700          <input id="date_creation_year"
701                 name="date_creation_year"
702                 type="text"
703                 size="4"
704                 maxlength="4"
705                 value="{$DATE_CREATION_YEAR}">
706          <input id="date_creation_linked_date" name="date_creation_linked_date" type="hidden" size="10" disabled="disabled">
707      </div>
708    </div>
709
710    <!-- level -->
711    <div id="action_level" class="bulkAction">
712        <select name="level" size="1">
713          {html_options options=$level_options selected=$level_options_selected}
714        </select>
715    </div>
716
717    <!-- metadata -->
718    <div id="action_metadata" class="bulkAction">
719    </div>
720
721    <!-- regenerate thumbnails -->
722    <div id="action_regenerateThumbnails" class="bulkAction">
723      <table style="margin-left:20px;">
724        <tr>
725          <th><label for="thumb_crop">{'Crop'|@translate}</label></th>
726          <td><input type="checkbox" name="thumb_crop" id="thumb_crop" {if $upload_form_settings.thumb_crop}checked="checked"{/if}></td>
727        </tr>
728        <tr id="thumb_follow_orientation_tr">
729          <th><label for="thumb_follow_orientation">{'Follow Orientation'|@translate}</label></th>
730          <td><input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {if $upload_form_settings.thumb_follow_orientation}checked="checked"{/if}></td>
731        </tr>
732        <tr>
733          <th id="thumb_width_th">{'Maximum Width'|@translate}</th>
734          <td><input type="text" name="thumb_maxwidth" value="{$upload_form_settings.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
735        </tr>
736        <tr>
737          <th id="thumb_height_th">{'Maximum Height'|@translate}</th>
738          <td><input type="text" name="thumb_maxheight" value="{$upload_form_settings.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
739        </tr>
740        <tr>
741          <th>{'Image Quality'|@translate}</th>
742          <td><input type="text" name="thumb_quality" value="{$upload_form_settings.thumb_quality}" size="3" maxlength="3"> %</td>
743        </tr>
744      </table>
745    </div>
746
747    <!-- regenerate websize -->
748    <div id="action_regenerateWebsize" class="bulkAction">
749      <p>
750        <img src="admin/themes/default/icon/warning.png" alt="!" style="vertical-align:middle;">
751        {'By default, Piwigo will create a new websize from the HD (high definition) version of your photo.'|@translate}
752        {'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}
753      </p>
754
755      <table style="margin:10px 20px;">
756        <tr>
757          <th>{'Maximum Width'|@translate}</th>
758          <td><input type="text" name="websize_maxwidth" value="{$upload_form_settings.websize_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
759        </tr>
760        <tr>
761          <th>{'Maximum Height'|@translate}</th>
762          <td><input type="text" name="websize_maxheight" value="{$upload_form_settings.websize_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
763        </tr>
764        <tr>
765          <th>{'Image Quality'|@translate}</th>
766          <td><input type="text" name="websize_quality" value="{$upload_form_settings.websize_quality}" size="3" maxlength="3"> %</td>
767        </tr>
768      </table>
769    </div>
770
771    <!-- progress bar -->
772    <div id="regenerationMsg" class="bulkAction">
773      <p id="regenerationText" style="margin-bottom:10px;"></p>
774      <span class="progressBar" id="progressBar"></span>
775      <input type="hidden" name="regenerateSuccess" value="0">
776      <input type="hidden" name="regenerateError" value="0">
777    </div>
778
779    <!-- plugins -->
780{if !empty($element_set_global_plugins_actions)}
781  {foreach from=$element_set_global_plugins_actions item=action}
782    <div id="action_{$action.ID}" class="bulkAction">
783    {if !empty($action.CONTENT)}{$action.CONTENT}{/if}
784    </div>
785  {/foreach}
786{/if}
787
788    <p id="applyActionBlock" style="display:none" class="actionButtons">
789      <input id="applyAction" class="submit" type="submit" value="{'Apply action'|@translate}" name="submit"> <span id="applyOnDetails"></span></p>
790
791    </div> <!-- #permitAction -->
792  </fieldset>
793
794  </form>
795
796</div> <!-- #batchManagerGlobal -->
Note: See TracBrowser for help on using the repository browser.