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

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

fix batch manager unit photo titles with quotes (+ send all photo data to template)
fix batch manager global fix tiptip selector for thumbs

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