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

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