[6950] | 1 | |
---|
| 2 | {literal} |
---|
| 3 | <script type="text/javascript"> |
---|
| 4 | |
---|
| 5 | function displayWait() |
---|
| 6 | { |
---|
| 7 | $('#iListTags').html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>"); |
---|
| 8 | } |
---|
| 9 | |
---|
| 10 | function loadKeywordsList() |
---|
| 11 | { |
---|
| 12 | $.ajax( |
---|
| 13 | { |
---|
| 14 | type: "POST", |
---|
| 15 | url: "{/literal}{$datas.urlRequest}{literal}", |
---|
| 16 | async: true, |
---|
[16007] | 17 | data: { ajaxfct:"admin.tags.getKeywords", token:'{/literal}{$token}{literal}' }, |
---|
[6950] | 18 | success: function (msg) |
---|
| 19 | { |
---|
| 20 | $('#iListTags').html(msg); |
---|
| 21 | |
---|
| 22 | $("#iListTagsNb").html( |
---|
| 23 | "{/literal}{'g003_number_of_keywords'|@translate}{literal} "+$("#iListTags table tr").length |
---|
| 24 | ); |
---|
[6977] | 25 | |
---|
| 26 | if($("#iListTags table tr").length==0) |
---|
| 27 | { |
---|
| 28 | $('#iApply').css('display', 'none'); |
---|
| 29 | } |
---|
| 30 | else |
---|
| 31 | { |
---|
| 32 | $('#iApply').css('display', 'block'); |
---|
| 33 | } |
---|
[6950] | 34 | } |
---|
| 35 | } |
---|
| 36 | ); |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | function convertKeywordsList() |
---|
| 40 | { |
---|
| 41 | keywords=new Array(); |
---|
| 42 | |
---|
| 43 | $('#iListTags input:checked').each(function (i,e) |
---|
| 44 | { |
---|
| 45 | re=/(\d+)$/i; |
---|
| 46 | num=$(e).attr('id').match(re); |
---|
| 47 | keywords.push($('#iTagValue'+num[1]).val()); |
---|
| 48 | } |
---|
| 49 | ); |
---|
| 50 | |
---|
| 51 | displayWait(); |
---|
| 52 | |
---|
| 53 | $.ajax( |
---|
| 54 | { |
---|
| 55 | type: "POST", |
---|
| 56 | url: "{/literal}{$datas.urlRequest}{literal}", |
---|
| 57 | async: true, |
---|
[16007] | 58 | data: { ajaxfct:"admin.tags.convertKeywords", token:'{/literal}{$token}{literal}', keywords:keywords }, |
---|
[6950] | 59 | success: function (msg) |
---|
| 60 | { |
---|
| 61 | loadKeywordsList(); |
---|
| 62 | if(msg=='ok') |
---|
| 63 | { |
---|
| 64 | alert("{/literal}{'g003_convert_ok'|@translate}{literal}"); |
---|
| 65 | } |
---|
| 66 | } |
---|
| 67 | } |
---|
| 68 | ); |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | </script> |
---|
| 72 | {/literal} |
---|
| 73 | |
---|
| 74 | <h2>{'g003_tags'|@translate}</h2> |
---|
| 75 | |
---|
| 76 | <div class='helps'> |
---|
| 77 | <p>{'g003_tags_page_help'|@translate}</p> |
---|
| 78 | </div> |
---|
| 79 | |
---|
| 80 | <table id='iHeaderListTags' class="littlefont"> |
---|
| 81 | <tr> |
---|
| 82 | <th style="min-width:340px;">{'g003_keyword'|@translate}</th> |
---|
| 83 | <th style="width:120px;">{'g003_num_of_pictures'|@translate}</th> |
---|
| 84 | <th style="width:120px;">{'g003_tag_in_piwigo'|@translate}</th> |
---|
| 85 | <th style="width:120px;">{'g003_num_of_pictures_already_tagged'|@translate}</th> |
---|
| 86 | <th style="width:10px"></th> |
---|
| 87 | </tr> |
---|
| 88 | </table> |
---|
| 89 | <div id='iListTags' class="{$themeconf.name}"> |
---|
| 90 | </div> |
---|
| 91 | <div id="iListTagsNb"></div> |
---|
| 92 | |
---|
[6977] | 93 | <input type="button" value="{'g003_convert_keywords_and_apply'|@translate}" id='iApply' onclick='convertKeywordsList();' style='display:none;'> |
---|
[6950] | 94 | |
---|
| 95 | <script type='text/javascript'> |
---|
| 96 | displayWait(); |
---|
| 97 | loadKeywordsList(); |
---|
| 98 | </script> |
---|