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

Last change on this file since 13575 was 13575, checked in by rvelices, 12 years ago

batch manager derivative build fix js

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