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

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

batch manager - remove unused code, less sql queries and avoid 4 calls to same display_select function

File size: 32.2 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    this.find('input[type=checkbox]').each(function() {
19      var pos=count;
20      inputs[count++]=this;
21      $(this).bind("shclick", function (dummy,event) {
22        if (event.shiftKey) {
23          var first = last_clicked;
24          var last = pos;
25          if (first > last) {
26            first=pos;
27            last=last_clicked;
28          }
29
30          for (var i=first; i<=last;i++) {
31            input = $(inputs[i]);
32            $(input).attr('checked', last_clickedstatus);
33            if (last_clickedstatus)
34            {
35              $(input).siblings("span.wrap2").addClass("thumbSelected");
36            }
37            else
38            {
39              $(input).siblings("span.wrap2").removeClass("thumbSelected");
40            }
41          }
42        }
43        else {
44          last_clicked = pos;
45          last_clickedstatus = this.checked;
46        }
47        return true;
48      });
49      $(this).click(function(event) {console.log(event.shiftKey);$(this).triggerHandler("shclick",event)});
50    });
51  }
52        $('ul.thumbnails').enableShiftClick();
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 are_you_sure = "{'Are you sure?'|@translate|@escape:'javascript'}";
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      nbSelected = $(".thumbnails input[type=checkbox]").filter(':checked').length;
191    }
192
193    if (nbSelected == 0) {
194      $("#permitAction").hide();
195      $("#forbidAction").show();
196    }
197    else {
198      $("#permitAction").show();
199      $("#forbidAction").hide();
200    }
201
202    $("#applyOnDetails").text(
203      sprintf(
204        applyOnDetails_pattern,
205        nbSelected
206      )
207    );
208
209    // display the number of currently selected photos in the "Selection" fieldset
210    if (nbSelected == 0) {
211      $("#selectedMessage").text(
212        sprintf(
213          selectedMessage_none,
214          nb_thumbs_set
215        )
216      );
217    }
218    else if (nbSelected == nb_thumbs_set) {
219      $("#selectedMessage").text(
220        sprintf(
221          selectedMessage_all,
222          nb_thumbs_set
223        )
224      );
225    }
226    else {
227      $("#selectedMessage").text(
228        sprintf(
229          selectedMessage_pattern,
230          nbSelected,
231          nb_thumbs_set
232        )
233      );
234    }
235  }
236
237  $('.thumbnails img').tipTip({
238    'delay' : 0,
239    'fadeIn' : 200,
240    'fadeOut' : 200
241  });
242
243  $("[id^=action_]").hide();
244
245  $("select[name=selectAction]").change(function () {
246    $("[id^=action_]").hide();
247    $("#action_"+$(this).attr("value")).show();
248
249    /* make sure the #albumSelect is on the right select box so that the */
250    /* "add new album" popup fills the right select box                  */
251    if ("associate" == $(this).attr("value") || "move" == $(this).attr("value")) {
252      jQuery("#albumSelect").removeAttr("id");
253      jQuery("#action_"+$(this).attr("value")+" select").attr("id", "albumSelect");
254    }
255
256    if ($(this).val() != -1) {
257      $("#applyActionBlock").show();
258    }
259    else {
260      $("#applyActionBlock").hide();
261    }
262  });
263
264  $(".wrap1 label").click(function (event) {
265    $("input[name=setSelected]").attr('checked', false);
266
267    var wrap2 = $(this).children(".wrap2");
268    var checkbox = $(this).children("input[type=checkbox]");
269
270    checkbox.triggerHandler("shclick",event);
271
272    if ($(checkbox).is(':checked')) {
273      $(wrap2).addClass("thumbSelected");
274    }
275    else {
276      $(wrap2).removeClass('thumbSelected');
277    }
278
279    checkPermitAction();
280  });
281
282  $("#selectAll").click(function () {
283    $("input[name=setSelected]").attr('checked', false);
284    selectPageThumbnails();
285    checkPermitAction();
286    return false;
287  });
288
289  function selectPageThumbnails() {
290    $(".thumbnails label").each(function() {
291      var wrap2 = $(this).children(".wrap2");
292      var checkbox = $(this).children("input[type=checkbox]");
293
294      $(checkbox).attr('checked', true);
295      $(wrap2).addClass("thumbSelected");
296    });
297  }
298
299  $("#selectNone").click(function () {
300    $("input[name=setSelected]").attr('checked', false);
301
302    $(".thumbnails label").each(function() {
303      var wrap2 = $(this).children(".wrap2");
304      var checkbox = $(this).children("input[type=checkbox]");
305
306      $(checkbox).attr('checked', false);
307      $(wrap2).removeClass("thumbSelected");
308    });
309    checkPermitAction();
310    return false;
311  });
312
313  $("#selectInvert").click(function () {
314    $("input[name=setSelected]").attr('checked', false);
315
316    $(".thumbnails label").each(function() {
317      var wrap2 = $(this).children(".wrap2");
318      var checkbox = $(this).children("input[type=checkbox]");
319
320      $(checkbox).attr('checked', !$(checkbox).is(':checked'));
321
322      if ($(checkbox).is(':checked')) {
323        $(wrap2).addClass("thumbSelected");
324      }
325      else {
326        $(wrap2).removeClass('thumbSelected');
327      }
328    });
329    checkPermitAction();
330    return false;
331  });
332
333  $("#selectSet").click(function () {
334    selectPageThumbnails();
335    $("input[name=setSelected]").attr('checked', true);
336    checkPermitAction();
337    return false;
338  });
339
340  $("input[name=remove_author]").click(function () {
341    if ($(this).is(':checked')) {
342      $("input[name=author]").hide();
343    }
344    else {
345      $("input[name=author]").show();
346    }
347  });
348
349  $("input[name=remove_title]").click(function () {
350    if ($(this).is(':checked')) {
351      $("input[name=title]").hide();
352    }
353    else {
354      $("input[name=title]").show();
355    }
356  });
357
358  $("input[name=remove_date_creation]").click(function () {
359    if ($(this).is(':checked')) {
360      $("#set_date_creation").hide();
361    }
362    else {
363      $("#set_date_creation").show();
364    }
365  });
366
367  $(".removeFilter").click(function () {
368    var filter = $(this).parent('li').attr("id");
369    filter_disable(filter);
370
371    return false;
372  });
373
374  function filter_enable(filter) {
375    /* show the filter*/
376    $("#"+filter).show();
377
378    /* check the checkbox to declare we use this filter */
379    $("input[type=checkbox][name="+filter+"_use]").attr("checked", true);
380
381    /* forbid to select this filter in the addFilter list */
382    $("#addFilter").children("option[value="+filter+"]").attr("disabled", "disabled");
383  }
384
385  $("#addFilter").change(function () {
386    var filter = $(this).attr("value");
387    filter_enable(filter);
388    $(this).attr("value", -1);
389  });
390 
391  $("select[name='filter_dimension']").change(function () {
392    $("span[id^='filter_dimension_']").hide();
393    $("span#filter_dimension_"+ $(this).attr("value")).show();
394  });
395
396  function filter_disable(filter) {
397    /* hide the filter line */
398    $("#"+filter).hide();
399
400    /* uncheck the checkbox to declare we do not use this filter */
401    $("input[name="+filter+"_use]").removeAttr("checked");
402
403    /* give the possibility to show it again */
404    $("#addFilter").children("option[value="+filter+"]").removeAttr("disabled");
405  }
406
407  $("#removeFilters").click(function() {
408    $("#filterList li").each(function() {
409      var filter = $(this).attr("id");
410      filter_disable(filter);
411    });
412    return false;
413  });
414
415  jQuery('#applyAction').click(function() {
416                var action = jQuery('[name="selectAction"]').val();
417                if (action == 'delete_derivatives') {
418                        var d_count = $('#action_delete_derivatives input[type=checkbox]').filter(':checked').length
419                                , e_count = $('input[name="setSelected"]').is(':checked') ? nb_thumbs_set : $('.thumbnails input[type=checkbox]').filter(':checked').length;
420                        if (d_count*e_count > 500)
421                                return confirm(are_you_sure);
422                }
423               
424                if (action != 'generate_derivatives'
425                        || derivatives.finished() )
426                {
427                        return true;
428                }
429
430                jQuery('.bulkAction').hide();
431
432                var queuedManager = jQuery.manageAjax.create('queued', {
433                        queue: true, 
434                        cacheResponse: false,
435                        maxRequests: 1
436                });
437
438                derivatives.elements = [];
439                if (jQuery('input[name="setSelected"]').attr('checked'))
440                        derivatives.elements = all_elements;
441                else
442                        jQuery('.thumbnails input[type=checkbox]').each(function() {
443                                if (jQuery(this).attr('checked')) {
444                                        derivatives.elements.push(jQuery(this).val());
445                                }
446                        });
447
448                jQuery('#applyActionBlock').hide();
449                jQuery('select[name="selectAction"]').hide();
450                jQuery('#regenerationMsg').show();
451               
452                progress();
453                getDerivativeUrls();
454                return false;
455  });
456
457        function getDerivativeUrls() {
458                var ids = derivatives.elements.splice(0, 500);
459                var params = {max_urls: 100000, ids: ids, types: []};
460                jQuery("#action_generate_derivatives input").each( function(i, t) {
461                        if ($(t).attr("checked"))
462                                params.types.push( t.value );
463                } );
464
465                jQuery.ajax( {
466                        type: "POST",
467                        url: 'ws.php?format=json&method=pwg.getMissingDerivatives',
468                        data: params,
469                        dataType: "json",
470                        success: function(data) {
471                                if (!data.stat || data.stat != "ok") {
472                                        return;
473                                }
474                                derivatives.total += data.result.urls.length;
475                                progress();
476                                for (var i=0; i < data.result.urls.length; i++) {
477                                        jQuery.manageAjax.add("queued", {
478                                                type: 'GET',
479                                                url: data.result.urls[i] + "&ajaxload=true",
480                                                dataType: 'json',
481                                                success: ( function(data) { derivatives.done++; progress(true) }),
482                                                error: ( function(data) { derivatives.done++; progress(false) })
483                                        });
484                                }
485                                if (derivatives.elements.length)
486                                        setTimeout( getDerivativeUrls, 25 * (derivatives.total-derivatives.done));
487                        }
488                } );
489        }
490
491  checkPermitAction()
492});
493
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        <input type="hidden" name="start" value="{$START}">
503
504  <fieldset>
505    <legend>{'Filter'|@translate}</legend>
506
507    <ul id="filterList">
508      <li id="filter_prefilter" {if !isset($filter.prefilter)}style="display:none"{/if}>
509        <a href="#" class="removeFilter" title="{'remove this filter'|@translate}"><span>[x]</span></a>
510        <input type="checkbox" name="filter_prefilter_use" class="useFilterCheckbox" {if isset($filter.prefilter)}checked="checked"{/if}>
511        {'Predefined filter'|@translate}
512        <select name="filter_prefilter">
513          {foreach from=$prefilters item=prefilter}
514          <option value="{$prefilter.ID}" {if isset($filter.prefilter) && $filter.prefilter eq $prefilter.ID}selected="selected"{/if}>{$prefilter.NAME}</option>
515          {/foreach}
516        </select>
517      </li>
518     
519      <li id="filter_category" {if !isset($filter.category)}style="display:none"{/if}>
520        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
521        <input type="checkbox" name="filter_category_use" class="useFilterCheckbox" {if isset($filter.category)}checked="checked"{/if}>
522        {'Album'|@translate}
523        <select style="width:400px" name="filter_category" size="1">
524          {html_options options=$category_full_name_options selected=$filter_category_selected}
525        </select>
526        <label><input type="checkbox" name="filter_category_recursive" {if isset($filter.category_recursive)}checked="checked"{/if}> {'include child albums'|@translate}</label>
527      </li>
528     
529      <li id="filter_tags" {if !isset($filter.tags)}style="display:none"{/if}>
530        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
531        <input type="checkbox" name="filter_tags_use" class="useFilterCheckbox" {if isset($filter.tags)}checked="checked"{/if}>
532        {'Tags'|@translate}
533        <select id="tagsFilter" name="filter_tags">
534          {if isset($filter_tags)}{foreach from=$filter_tags item=tag}
535          <option value="{$tag.id}">{$tag.name}</option>
536          {/foreach}{/if}
537        </select>
538        <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>
539        <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>
540      </li>
541     
542      <li id="filter_level" {if !isset($filter.level)}style="display:none"{/if}>
543        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
544        <input type="checkbox" name="filter_level_use" class="useFilterCheckbox" {if isset($filter.level)}checked="checked"{/if}>
545        {'Privacy level'|@translate}
546        <select name="filter_level" size="1">
547          {html_options options=$filter_level_options selected=$filter_level_options_selected}
548        </select>
549        <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>
550      </li>
551     
552      <li id="filter_dimension" {if !isset($filter.dimension)}style="display:none"{/if}>
553        <a href="#" class="removeFilter" title="remove this filter"><span>[x]</span></a>
554        <input type="checkbox" name="filter_dimension_use" class="useFilterCheckbox" {if isset($filter.dimension)}checked="checked"{/if}>
555        <select name="filter_dimension">
556          <option value="min_width" {if $filter.dimension=='min_width'}selected="selected"{/if}>{'Minimum width'|@translate}</option>
557          <option value="max_width" {if $filter.dimension=='max_width'}selected="selected"{/if}>{'Maximum width'|@translate}</option>
558          <option value="min_height" {if $filter.dimension=='min_height'}selected="selected"{/if}>{'Minimum height'|@translate}</option>
559          <option value="max_height" {if $filter.dimension=='max_height'}selected="selected"{/if}>{'Maximum height'|@translate}</option>
560          <option value="format" {if $filter.dimension=='format'}selected="selected"{/if}>{'Format'|@translate}</option>
561        </select>
562        <span id="filter_dimension_min_width" {if !isset($filter.dimension_min_width) and isset($filter.dimension)}style="display:none;"{/if}><input type="text" name="filter_dimension_min_width" value="{$filter.dimension_min_width}" size="4"> px</span>
563        <span id="filter_dimension_max_width" {if !isset($filter.dimension_max_width)}style="display:none;"{/if}><input type="text" name="filter_dimension_max_width" value="{$filter.dimension_max_width}" size="4"> px</span>
564        <span id="filter_dimension_min_height" {if !isset($filter.dimension_min_height)}style="display:none;"{/if}><input type="text" name="filter_dimension_min_height" value="{$filter.dimension_min_height}" size="4"> px</span>
565        <span id="filter_dimension_max_height" {if !isset($filter.dimension_max_height)}style="display:none;"{/if}><input type="text" name="filter_dimension_max_height" value="{$filter.dimension_max_height}" size="4"> px</span>
566        <span id="filter_dimension_format" {if !isset($filter.dimension_format)}style="display:none;"{/if}>
567          <select name="filter_dimension_format">
568            <option value="portrait" {if $filter.dimension_format=='portrait'}selected="selected"{/if}>{'Portrait'|@translate}</option>
569            <option value="square" {if $filter.dimension_format=='square'}selected="selected"{/if}>{'square'|@translate}</option>
570            <option value="landscape" {if $filter.dimension_format=='landscape'}selected="selected"{/if}>{'Landscape'|@translate}</option>
571            <option value="panorama" {if $filter.dimension_format=='panorama'}selected="selected"{/if}>{'Panorama'|@translate}</option>
572          </select>
573        </span>
574      </li>
575    </ul>
576
577    <p class="actionButtons">
578      <select id="addFilter">
579        <option value="-1">{'Add a filter'|@translate}</option>
580        <option disabled="disabled">------------------</option>
581        <option value="filter_prefilter" {if isset($filter.prefilter)}disabled="disabled"{/if}>{'Predefined filter'|@translate}</option>
582        <option value="filter_category" {if isset($filter.category)}disabled="disabled"{/if}>{'Album'|@translate}</option>
583        <option value="filter_tags" {if isset($filter.tags)}disabled="disabled"{/if}>{'Tags'|@translate}</option>
584        <option value="filter_level" {if isset($filter.level)}disabled="disabled"{/if}>{'Privacy level'|@translate}</option>
585        <option value="filter_dimension" {if isset($filter.dimension)}disabled="disabled"{/if}>{'Dimensions'|@translate}</option>
586      </select>
587      <a id="removeFilters" href="">{'Remove all filters'|@translate}</a>
588    </p>
589
590    <p class="actionButtons" id="applyFilterBlock">
591      <input id="applyFilter" class="submit" type="submit" value="{'Refresh photo set'|@translate}" name="submitFilter">
592    </p>
593
594  </fieldset>
595
596  <fieldset>
597
598    <legend>{'Selection'|@translate}</legend>
599
600  {if !empty($thumbnails)}
601  <p id="checkActions">
602    {'Select:'|@translate}
603{if $nb_thumbs_set > $nb_thumbs_page}
604    <a href="#" id="selectAll">{'The whole page'|@translate}</a>,
605    <a href="#" id="selectSet">{'The whole set'|@translate}</a>,
606{else}
607    <a href="#" id="selectAll">{'All'|@translate}</a>,
608{/if}
609    <a href="#" id="selectNone">{'None'|@translate}</a>,
610    <a href="#" id="selectInvert">{'Invert'|@translate}</a>
611
612    <span id="selectedMessage"></span>
613
614    <input type="checkbox" name="setSelected" style="display:none" {if count($selection) == $nb_thumbs_set}checked="checked"{/if}>
615  </p>
616
617        <ul class="thumbnails">
618                {html_style}
619UL.thumbnails SPAN.wrap2{ldelim}
620  width: {$thumb_params->max_width()+2}px;
621}
622UL.thumbnails SPAN.wrap2 {ldelim}
623  height: {$thumb_params->max_height()+25}px;
624}
625                {/html_style}
626                {foreach from=$thumbnails item=thumbnail}
627                {assign var='isSelected' value=$thumbnail.id|@in_array:$selection}
628                <li>
629                        <span class="wrap1">
630                                <label>
631                                        <input type="checkbox" name="selection[]" value="{$thumbnail.id}" {if $isSelected}checked="checked"{/if}>
632                                        <span class="wrap2{if $isSelected} thumbSelected{/if}">
633                                        <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>
634                                                {if $thumbnail.level > 0}
635                                                <em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.level))}</em>
636                                                <em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.level))}</em>
637                                                {/if}
638                                                <img src="{$thumbnail.thumb->get_url()}" alt="{$thumbnail.file}" title="{$thumbnail.TITLE|@escape:'html'}" {$thumbnail.thumb->get_size_htm()}>
639                                        </span>
640                                </label>
641                        </span>
642                </li>
643                {/foreach}
644        </ul>
645
646  {if !empty($navbar) }
647  <div style="clear:both;">
648
649    <div style="float:left">
650    {include file='navigation_bar.tpl'|@get_extent:'navbar'}
651    </div>
652
653    <div style="float:right;margin-top:10px;">{'display'|@translate}
654      <a href="{$U_DISPLAY}&amp;display=20">20</a>
655      &middot; <a href="{$U_DISPLAY}&amp;display=50">50</a>
656      &middot; <a href="{$U_DISPLAY}&amp;display=100">100</a>
657      &middot; <a href="{$U_DISPLAY}&amp;display=all">{'all'|@translate}</a>
658      {'photos per page'|@translate}
659    </div>
660  </div>
661  {/if}
662
663  {else}
664  <div>{'No photo in the current set.'|@translate}</div>
665  {/if}
666  </fieldset>
667
668  <fieldset id="action">
669
670    <legend>{'Action'|@translate}</legend>
671      <div id="forbidAction"{if count($selection) != 0} style="display:none"{/if}>{'No photo selected, no action possible.'|@translate}</div>
672      <div id="permitAction"{if count($selection) == 0} style="display:none"{/if}>
673
674    <select name="selectAction">
675      <option value="-1">{'Choose an action'|@translate}</option>
676      <option disabled="disabled">------------------</option>
677      <option value="delete">{'Delete selected photos'|@translate}</option>
678      <option value="associate">{'Associate to album'|@translate}</option>
679      <option value="move">{'Move to album'|@translate}</option>
680  {if !empty($dissociate_options)}
681      <option value="dissociate">{'Dissociate from album'|@translate}</option>
682  {/if}
683      <option value="add_tags">{'Add tags'|@translate}</option>
684  {if !empty($DEL_TAG_SELECTION)}
685      <option value="del_tags">{'remove tags'|@translate}</option>
686  {/if}
687      <option value="author">{'Set author'|@translate}</option>
688      <option value="title">{'Set title'|@translate}</option>
689      <option value="date_creation">{'Set creation date'|@translate}</option>
690      <option value="level">{'Who can see these photos?'|@translate}</option>
691      <option value="metadata">{'Synchronize metadata'|@translate}</option>
692  {if ($IN_CADDIE)}
693      <option value="remove_from_caddie">{'Remove from caddie'|@translate}</option>
694  {else}
695      <option value="add_to_caddie">{'Add to caddie'|@translate}</option>
696  {/if}
697                <option value="delete_derivatives">{'Delete multiple size images'|@translate}</option>
698                <option value="generate_derivatives">{'Generate multiple size images'|@translate}</option>
699  {if !empty($element_set_global_plugins_actions)}
700    {foreach from=$element_set_global_plugins_actions item=action}
701      <option value="{$action.ID}">{$action.NAME}</option>
702    {/foreach}
703  {/if}
704    </select>
705
706    <!-- delete -->
707    <div id="action_delete" class="bulkAction">
708    <p><label><input type="checkbox" name="confirm_deletion" value="1"> {'Are you sure?'|@translate}</label></p>
709    </div>
710
711    <!-- associate -->
712    <div id="action_associate" class="bulkAction">
713          <select style="width:400px" name="associate" size="1">
714            {html_options options=$category_full_name_options}
715         </select>
716<br>{'... or '|@translate} <a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
717    </div>
718
719    <!-- move -->
720    <div id="action_move" class="bulkAction">
721          <select style="width:400px" name="move" size="1">
722            {html_options options=$category_full_name_options}
723         </select>
724<br>{'... or '|@translate} <a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
725    </div>
726
727
728    <!-- dissociate -->
729    <div id="action_dissociate" class="bulkAction">
730          <select style="width:400px" name="dissociate" size="1">
731            {if !empty($dissociate_options)}{html_options options=$dissociate_options }{/if}
732          </select>
733    </div>
734
735
736    <!-- add_tags -->
737    <div id="action_add_tags" class="bulkAction">
738<select id="tags" name="add_tags">
739</select>
740    </div>
741
742    <!-- del_tags -->
743    <div id="action_del_tags" class="bulkAction">
744{if !empty($DEL_TAG_SELECTION)}{$DEL_TAG_SELECTION}{/if}
745    </div>
746
747    <!-- author -->
748    <div id="action_author" class="bulkAction">
749    <label><input type="checkbox" name="remove_author"> {'remove author'|@translate}</label><br>
750    {assign var='authorDefaultValue' value='Type here the author name'|@translate}
751<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;">
752    </div>   
753
754    <!-- title -->
755    <div id="action_title" class="bulkAction">
756    <label><input type="checkbox" name="remove_title"> {'remove title'|@translate}</label><br>
757    {assign var='titleDefaultValue' value='Type here the title'|@translate}
758<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;">
759    </div>
760
761    <!-- date_creation -->
762    <div id="action_date_creation" class="bulkAction">
763      <label><input type="checkbox" name="remove_date_creation"> {'remove creation date'|@translate}</label><br>
764      <div id="set_date_creation">
765          <select id="date_creation_day" name="date_creation_day">
766             <option value="0">--</option>
767            {section name=day start=1 loop=32}
768              <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$DATE_CREATION_DAY}selected="selected"{/if}>{$smarty.section.day.index}</option>
769            {/section}
770          </select>
771          <select id="date_creation_month" name="date_creation_month">
772            {html_options options=$month_list selected=$DATE_CREATION_MONTH}
773          </select>
774          <input id="date_creation_year"
775                 name="date_creation_year"
776                 type="text"
777                 size="4"
778                 maxlength="4"
779                 value="{$DATE_CREATION_YEAR}">
780          <input id="date_creation_linked_date" name="date_creation_linked_date" type="hidden" size="10" disabled="disabled">
781      </div>
782    </div>
783
784    <!-- level -->
785    <div id="action_level" class="bulkAction">
786        <select name="level" size="1">
787          {html_options options=$level_options selected=$level_options_selected}
788        </select>
789    </div>
790
791    <!-- metadata -->
792    <div id="action_metadata" class="bulkAction">
793    </div>
794
795                <!-- generate derivatives -->
796                <div id="action_generate_derivatives" class="bulkAction">
797                        <a href="javascript:selectGenerateDerivAll()">{'All'|@translate}</a>,
798                        <a href="javascript:selectGenerateDerivNone()">{'None'|@translate}</a>
799                        <br>
800                        {foreach from=$generate_derivatives_types key=type item=disp}
801                                <label><input type="checkbox" name="generate_derivatives_type[]" value="{$type}"> {$disp}</label>
802                        {/foreach}
803                        {footer_script}
804                        function selectGenerateDerivAll() {ldelim}
805                                $("#action_generate_derivatives input[type=checkbox]").attr("checked", true);
806                        }
807                        function selectGenerateDerivNone() {ldelim}
808                                $("#action_generate_derivatives input[type=checkbox]").attr("checked", false);
809                        }
810                        {/footer_script}
811                </div>
812
813                <!-- delete derivatives -->
814                <div id="action_delete_derivatives" class="bulkAction">
815                        <a href="javascript:selectDelDerivAll()">{'All'|@translate}</a>,
816                        <a href="javascript:selectDelDerivNone()">{'None'|@translate}</a>
817                        <br>
818                        {foreach from=$del_derivatives_types key=type item=disp}
819                                <label><input type="checkbox" name="del_derivatives_type[]" value="{$type}"> {$disp}</label>
820                        {/foreach}
821                        {footer_script}
822                        function selectDelDerivAll() {ldelim}
823                                $("#action_delete_derivatives input[type=checkbox]").attr("checked", true);
824                        }
825                        function selectDelDerivNone() {ldelim}
826                                $("#action_delete_derivatives input[type=checkbox]").attr("checked", false);
827                        }
828                        {/footer_script}
829                </div>
830               
831    <!-- progress bar -->
832    <div id="regenerationMsg" class="bulkAction" style="display:none">
833      <p id="regenerationText" style="margin-bottom:10px;">{'Generate multiple size images'|@translate}</p>
834      <span class="progressBar" id="progressBar"></span>
835      <input type="hidden" name="regenerateSuccess" value="0">
836      <input type="hidden" name="regenerateError" value="0">
837    </div>
838
839    <!-- plugins -->
840{if !empty($element_set_global_plugins_actions)}
841  {foreach from=$element_set_global_plugins_actions item=action}
842    <div id="action_{$action.ID}" class="bulkAction">
843    {if !empty($action.CONTENT)}{$action.CONTENT}{/if}
844    </div>
845  {/foreach}
846{/if}
847
848    <p id="applyActionBlock" style="display:none" class="actionButtons">
849      <input id="applyAction" class="submit" type="submit" value="{'Apply action'|@translate}" name="submit"> <span id="applyOnDetails"></span></p>
850
851    </div> <!-- #permitAction -->
852  </fieldset>
853
854  </form>
855
856</div> <!-- #batchManagerGlobal -->
Note: See TracBrowser for help on using the repository browser.