Changeset 26180 for extensions/flickr2piwigo/admin/template
- Timestamp:
- Dec 24, 2013, 6:23:13 PM (10 years ago)
- Location:
- extensions/flickr2piwigo/admin/template
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/flickr2piwigo/admin/template/config.tpl
r16071 r26180 1 {combine_css path=$FLICKR_PATH| @cat:"admin/template/style.css"}1 {combine_css path=$FLICKR_PATH|cat:'admin/template/style.css'} 2 2 3 3 <div class="titrePage"> … … 7 7 <form method="post" action="" class="properties"> 8 8 <fieldset> 9 <legend>{'Flickr logins'| @translate}</legend>10 9 <legend>{'Flickr logins'|translate}</legend> 10 11 11 <ul> 12 12 <li> 13 13 <label> 14 <span class="property">{'API key'| @translate}</span>14 <span class="property">{'API key'|translate}</span> 15 15 <input type="text" name="api_key" value="{$flickr2piwigo.api_key}" size="40"> 16 16 </label> … … 19 19 <li> 20 20 <label> 21 <span class="property">{'API secret'| @translate}</span>21 <span class="property">{'API secret'|translate}</span> 22 22 <input type="text" name="secret_key" value="{$flickr2piwigo.secret_key}" size="20"> 23 23 </label> … … 26 26 </fieldset> 27 27 28 <p><input type="submit" name="save_config" value="{'Save Settings'| @translate}"></p>28 <p><input type="submit" name="save_config" value="{'Save Settings'|translate}"></p> 29 29 30 30 <fieldset> 31 <legend>{'How do I get my Flickr API key?'| @translate}</legend>32 33 <p><b>{'Callback URL'| @translate} :</b> <span style="font-family:monospace;font-size:14px;">{$FLICKR_CALLBACK}</span></p>31 <legend>{'How do I get my Flickr API key?'|translate}</legend> 32 33 <p><b>{'Callback URL'|translate} :</b> <span style="font-family:monospace;font-size:14px;">{$FLICKR_CALLBACK}</span></p> 34 34 {$FLICKR_HELP_CONTENT} 35 35 </fieldset> 36 36 37 37 </form> -
extensions/flickr2piwigo/admin/template/import.list_all.tpl
r25789 r26180 1 1 {footer_script require='jquery.ajaxmanager,jquery.jgrowl'} 2 /* global vars */ 3 var errorHead = '{'ERROR'|@translate|@escape:'javascript'}'; 4 var errorMsg = '{'an error happened'|@translate|@escape:'javascript'}'; 5 var successHead = '{'Success'|@translate|@escape:'javascript'}'; 2 (function($){ 3 /* global vars */ 4 var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}]; 5 var import_done = 0; 6 var import_selected = {$nb_elements}; 7 var queuedManager = $.manageAjax.create('queued', { 8 queue: true, 9 maxRequests: 1 10 }); 6 11 7 var import_done = 0; 8 var import_selected = {$nb_elements}; 9 var queuedManager = jQuery.manageAjax.create('queued', {ldelim} 10 queue: true, 11 maxRequests: 1 12 }); 12 /* import queue */ 13 function performImport(photo, album, fills) { 14 queuedManager.add({ 15 type: 'GET', 16 dataType: 'json', 17 url: 'ws.php', 18 data: { 19 method: 'pwg.images.addFlickr', 20 id: photo, 21 category: album, 22 fills: fills, 23 format: 'json' 24 }, 25 success: function(data) { 26 if (data['stat'] == 'ok') { 27 $.jGrowl(data['result'], { 28 theme: 'success', life: 4000, sticky: false, 29 header: '{'Success'|translate}', 30 }); 31 $("#photo-"+photo.id).fadeOut(function(){ $(this).remove(); }); 32 } 33 else { 34 $.jGrowl(data['result'], { 35 theme: 'error', sticky: true, 36 header: '{'ERROR'|translate}' 37 }); 38 } 13 39 14 {literal} 15 /* import queue */ 16 function performImport(photo, album, fills) { 17 queuedManager.add({ 18 type: 'GET', 19 dataType: 'json', 20 url: 'ws.php', 21 data: { method: 'pwg.images.addFlickr', id: photo, category: album, fills: fills, format: 'json' }, 22 success: function(data) { 23 if (data['stat'] == 'ok') { 24 jQuery.jGrowl(data['result'], { theme: 'success', header: successHead, life: 4000, sticky: false }); 25 jQuery("#photo-"+photo.id).fadeOut(function(){ $(this).remove(); }); 26 } else { 27 jQuery.jGrowl(data['result'], { theme: 'error', header: errorHead, sticky: true }); 40 import_done++; 41 $("#progress").html(import_done +"/"+ import_selected); 42 43 if (import_done == import_selected) { 44 $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">'); 45 $("#import_form").submit(); 46 } 47 }, 48 error: function(data) { 49 $.jGrowl('{'an error happened'|translate|escape:'javascript'}', { 50 theme: 'error', sticky: true, 51 header: '{'ERROR'|translate}' 52 }); 28 53 } 29 30 import_done++; 31 $("#progress").html(import_done +"/"+ import_selected); 32 33 if (import_done == import_selected) { 34 $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">'); 35 $("#import_form").submit(); 36 } 37 }, 38 error: function(data) { 39 jQuery.jGrowl(errorMsg, { theme: 'error', header: errorHead, sticky: true }); 40 } 41 }); 42 } 54 }); 55 } 43 56 57 /* begin import */ 58 $('#beginImport').click(function() { 59 $("#loader_import").fadeIn(); 44 60 45 $(document).ready(function() {46 //var all_elements = jQuery.parseJSON('{/literal}{$all_elements}{literal}');47 var all_elements = {/literal}{$all_elements}{literal};48 49 /* begin import */50 jQuery('#beginImport').click(function() {51 $("#loader_import").fadeIn();52 53 61 if ($("input[name='album_mode']:checked").val() == 'identical') { 54 62 var album = 0; 55 } else { 63 } 64 else { 56 65 var album = $("#albumSelect option:selected").val(); 57 66 } 58 67 59 68 var fills = ''; 60 69 $("input[name^='fill_']:checked").each(function() { 61 70 fills+= $(this).attr("name") +','; 62 }); 63 71 }); 72 64 73 import_selected = all_elements.length; 65 74 $("#progress").html("0/"+ import_selected); 66 75 67 76 for (var i in all_elements) { 68 77 if (album == 0) this_album = all_elements[i]['albums']; 69 78 else this_album = album; 70 79 71 80 performImport(all_elements[i]['id'], this_album, fills); 72 81 } 73 82 74 83 return false; 75 84 }); 76 85 77 86 /* album mode */ 78 87 $("input[name='album_mode']").change(function() { 79 88 if ($(this).val() == 'one_album') { 80 89 $("#albumSelectWrapper").slideDown(); 81 } else { 90 } 91 else { 82 92 $("#albumSelectWrapper").slideUp(); 83 93 } 84 94 }); 85 }); 86 {/literal} 95 }(jQuery)); 87 96 {/footer_script} 97 88 98 89 99 <form action="{$F_ACTION}" method="post" id="import_form"> 90 100 91 101 <fieldset> 92 <legend>{'Selection'| @translate}</legend>102 <legend>{'Selection'|translate}</legend> 93 103 94 104 {if $nb_elements} 95 {'%d elements ready for importation'| @translate|@sprintf:$nb_elements}105 {'%d elements ready for importation'|translate:$nb_elements} 96 106 {else} 97 <div>{'No photo in the current set.'| @translate}</div>107 <div>{'No photo in the current set.'|translate}</div> 98 108 {/if} 99 109 </fieldset> 100 110 101 111 <fieldset> 102 <legend>{'Import options'| @translate}</legend>103 112 <legend>{'Import options'|translate}</legend> 113 104 114 <p> 105 <label><input type="radio" name="album_mode" value="identical" checked="checked"> {'Reproduce flickr albums'| @translate}</label><br>106 <label><input type="radio" name="album_mode" value="one_album"> {'Import all photos in this album'| @translate} :</label>115 <label><input type="radio" name="album_mode" value="identical" checked="checked"> {'Reproduce flickr albums'|translate}</label><br> 116 <label><input type="radio" name="album_mode" value="one_album"> {'Import all photos in this album'|translate} :</label> 107 117 </p> 108 118 … … 111 121 {html_options options=$category_parent_options} 112 122 </select> 113 {'... or '| @translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>123 {'... or '|translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a> 114 124 </p> 115 125 116 126 <p> 117 <b>{'Fill these fields from Flickr datas'| @translate}:</b>118 <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'| @translate}</label>119 <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'| @translate}</label>120 <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'| @translate}</label>121 <label><input type="checkbox" name="fill_taken" checked="checked"> {'Creation date'| @translate}</label>122 <label><input type="checkbox" name="fill_posted"> {'Post date'| @translate}</label>127 <b>{'Fill these fields from Flickr datas'|translate}:</b> 128 <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'|translate}</label> 129 <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|translate}</label> 130 <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|translate}</label> 131 <label><input type="checkbox" name="fill_taken" checked="checked"> {'Creation date'|translate}</label> 132 <label><input type="checkbox" name="fill_posted"> {'Post date'|translate}</label> 123 133 <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|@translate}</label> 124 {if $GMAPS_LOADED}<label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label>{/if}134 <label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label> 125 135 </p> 126 136 127 137 <p> 128 <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'| @translate}" {if not $nb_elements}style="display:none;"{/if}>129 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'| @translate}</i> <span id="progress"></span></span>138 <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'|translate}" {if not $nb_elements}style="display:none;"{/if}> 139 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i> <span id="progress"></span></span> 130 140 </p> 131 141 </fieldset> -
extensions/flickr2piwigo/admin/template/import.list_photos.tpl
r25789 r26180 1 1 {footer_script require='jquery.ajaxmanager,jquery.jgrowl'} 2 /* global vars */ 3 var nb_thumbs_page = {$nb_thumbs_page}; 4 var nb_thumbs_set = {$nb_thumbs_set}; 5 var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}]; 6 7 var errorHead = '{'ERROR'|@translate|@escape:'javascript'}'; 8 var errorMsg = '{'an error happened'|@translate|@escape:'javascript'}'; 9 var successHead = '{'Success'|@translate|@escape:'javascript'}'; 10 var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}"; 11 var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}"; 12 var selectedMessage_all = "{'All %d photos are selected'|@translate}"; 13 var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}"; 14 15 var import_done = 0; 16 var import_selected = 0; 17 var queuedManager = jQuery.manageAjax.create('queued', {ldelim} 18 queue: true, 19 maxRequests: 1 20 }); 21 22 {literal} 23 /* Shift-click: select all photos between the click and the shift+click */ 24 jQuery(document).ready(function() { 2 (function($){ 3 /* global vars */ 4 var nb_thumbs_set = {$nb_thumbs_set}; 5 var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}]; 6 var import_done = 0; 7 var import_selected = 0; 8 var queuedManager = $.manageAjax.create('queued', {ldelim} 9 queue: true, 10 maxRequests: 1 11 }); 12 13 /* Shift-click: select all photos between the click and the shift+click */ 25 14 var last_clicked=0; 26 15 var last_clickedstatus=true; 27 jQuery.fn.enableShiftClick = function() {16 $.fn.enableShiftClick = function() { 28 17 var inputs = []; 29 18 var count=0; … … 44 33 input = $(inputs[i]); 45 34 $(input).attr('checked', last_clickedstatus); 46 if (last_clickedstatus) 47 { 35 if (last_clickedstatus) { 48 36 $(input).siblings("span.wrap2").addClass("thumbSelected"); 49 37 } 50 else 51 { 38 else { 52 39 $(input).siblings("span.wrap2").removeClass("thumbSelected"); 53 40 } … … 60 47 return true; 61 48 }); 62 $(this).click(function(event) { $(this).triggerHandler("shclick",event)});49 $(this).click(function(event) { $(this).triggerHandler("shclick",event); }); 63 50 }); 64 51 } 65 }); 66 67 /* sprintf */ 68 function str_repeat(i, m) { 69 for (var o = []; m > 0; o[--m] = i); 70 return o.join(''); 71 } 72 73 function sprintf() { 74 var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = ''; 75 while (f) { 76 if (m = /^[^\x25]+/.exec(f)) { 77 o.push(m[0]); 78 } 79 else if (m = /^\x25{2}/.exec(f)) { 80 o.push('%'); 81 } 82 else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) { 83 if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) { 84 throw('Too few arguments.'); 85 } 86 if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) { 87 throw('Expecting number but found ' + typeof(a)); 88 } 89 switch (m[7]) { 90 case 'b': a = a.toString(2); break; 91 case 'c': a = String.fromCharCode(a); break; 92 case 'd': a = parseInt(a); break; 93 case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break; 94 case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break; 95 case 'o': a = a.toString(8); break; 96 case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break; 97 case 'u': a = Math.abs(a); break; 98 case 'x': a = a.toString(16); break; 99 case 'X': a = a.toString(16).toUpperCase(); break; 100 } 101 a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+'+ a : a); 102 c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' '; 103 x = m[5] - String(a).length - s.length; 104 p = m[5] ? str_repeat(c, x) : ''; 105 o.push(s + (m[4] ? a + p : p + a)); 106 } 107 else { 108 throw('Huh ?!'); 109 } 110 f = f.substring(m[0].length); 111 } 112 return o.join(''); 113 } 114 115 /* update displaying */ 116 function checkPermitAction() { 117 var nbSelected = 0; 118 if ($("input[name=setSelected]").is(':checked')) { 119 nbSelected = nb_thumbs_set; 120 } else { 121 $(".thumbnails input[type=checkbox]").each(function() { 122 if ($(this).is(':checked')) nbSelected++; 123 }); 124 } 125 126 if (nbSelected == 0) { 127 $("#beginImport").hide(); 128 } else { 129 $("#beginImport").show(); 130 } 131 132 $("#applyOnDetails").text( 133 sprintf( 134 applyOnDetails_pattern, 135 nbSelected 136 ) 137 ); 138 139 // display the number of currently selected photos in the "Selection" fieldset 140 if (nbSelected == 0) { 141 $("#selectedMessage").text( 52 53 /* update displaying */ 54 function checkPermitAction() { 55 var nbSelected = 0; 56 if ($("input[name=setSelected]").is(':checked')) { 57 nbSelected = nb_thumbs_set; 58 } 59 else { 60 $(".thumbnails input[type=checkbox]").each(function() { 61 if ($(this).is(':checked')) nbSelected++; 62 }); 63 } 64 65 if (nbSelected == 0) { 66 $("#beginImport").hide(); 67 } 68 else { 69 $("#beginImport").show(); 70 } 71 72 $("#applyOnDetails").text( 142 73 sprintf( 143 selectedMessage_none,144 nb _thumbs_set74 '{'on the %d selected photos'|translate|escape:javascript}', 75 nbSelected 145 76 ) 146 77 ); 147 } else if (nbSelected == nb_thumbs_set) { 148 $("#selectedMessage").text( 149 sprintf( 150 selectedMessage_all, 151 nb_thumbs_set 152 ) 153 ); 154 } else { 155 $("#selectedMessage").text( 156 sprintf( 157 selectedMessage_pattern, 158 nbSelected, 159 nb_thumbs_set 160 ) 161 ); 78 79 // display the number of currently selected photos in the "Selection" fieldset 80 if (nbSelected == 0) { 81 $("#selectedMessage").text( 82 sprintf( 83 '{'No photo selected, %d photos in current set'|translate|escape:javascript}', 84 nb_thumbs_set 85 ) 86 ); 87 } 88 else if (nbSelected == nb_thumbs_set) { 89 $("#selectedMessage").text( 90 sprintf( 91 '{'All %d photos are selected'|translate|escape:javascript}', 92 nb_thumbs_set 93 ) 94 ); 95 } 96 else { 97 $("#selectedMessage").text( 98 sprintf( 99 '{'%d of %d photos selected'|translate|escape:javascript}', 100 nbSelected, 101 nb_thumbs_set 102 ) 103 ); 104 } 162 105 } 163 } 164 165 /* import queue */ 166 function performImport(photo, album, fills) { 167 queuedManager.add({ 168 type: 'GET', 169 dataType: 'json', 170 url: 'ws.php', 171 data: { method: 'pwg.images.addFlickr', id: photo, category: album, fills: fills, format: 'json' }, 172 success: function(data) { 173 if (data['stat'] == 'ok') { 174 jQuery.jGrowl(data['result'], { theme: 'success', header: successHead, life: 4000, sticky: false }); 175 jQuery("#photo-"+photo).fadeOut(function(){ $(this).remove(); }); 176 } else { 177 jQuery.jGrowl(data['result'], { theme: 'error', header: errorHead, sticky: true }); 106 107 /* import queue */ 108 function performImport(photo, album, fills) { 109 queuedManager.add({ 110 type: 'GET', 111 dataType: 'json', 112 url: 'ws.php', 113 data: { 114 method: 'pwg.images.addFlickr', 115 id: photo, 116 category: album, 117 fills: fills, 118 format: 'json' 119 }, 120 success: function(data) { 121 if (data['stat'] == 'ok') { 122 jQuery.jGrowl(data['result'], { 123 theme: 'success', life: 4000, sticky: false, 124 header: '{'Success'|translate}' 125 }); 126 jQuery("#photo-"+photo).fadeOut(function(){ $(this).remove(); }); 127 } 128 else { 129 jQuery.jGrowl(data['result'], { 130 theme: 'error', sticky: true, 131 header: '{'ERROR'|translate}' 132 }); 133 } 134 135 import_done++; 136 $("#progress").html(import_done +"/"+ import_selected); 137 138 if (import_done == import_selected) { 139 $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">'); 140 $("#import_form").submit(); 141 } 142 }, 143 error: function(data) { 144 jQuery.jGrowl('{'an error happened'|translate|@escape:'javascript'}', { 145 theme: 'error', sticky: true, 146 header: '{'ERROR'|translate}' 147 }); 178 148 } 179 180 import_done++; 181 $("#progress").html(import_done +"/"+ import_selected); 182 183 if (import_done == import_selected) { 184 $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">'); 185 $("#import_form").submit(); 186 } 187 }, 188 error: function(data) { 189 jQuery.jGrowl(errorMsg, { theme: 'error', header: errorHead, sticky: true }); 190 } 191 }); 192 } 193 194 195 $(document).ready(function() { 149 }); 150 } 151 152 196 153 checkPermitAction(); 197 154 $("a.preview-box").colorbox(); … … 206 163 207 164 /* thumbnail click */ 208 $(".wrap1 label").click(function 209 $("input[name=setSelected]"). attr('checked', false);165 $(".wrap1 label").click(function(event) { 166 $("input[name=setSelected]").prop('checked', false); 210 167 211 168 var wrap2 = $(this).children(".wrap2"); … … 215 172 216 173 if ($(checkbox).is(':checked')) { 217 $(wrap2).addClass("thumbSelected"); 218 } 219 else { 220 $(wrap2).removeClass('thumbSelected'); 174 $(wrap2).addClass("thumbSelected"); 175 } 176 else { 177 $(wrap2).removeClass('thumbSelected'); 221 178 } 222 179 … … 225 182 226 183 /* select all */ 227 $("#selectAll").click(function 228 $("input[name=setSelected]"). attr('checked', false);229 184 $("#selectAll").click(function() { 185 $("input[name=setSelected]").prop('checked', false); 186 230 187 $(".thumbnails label").each(function() { 231 188 var wrap2 = $(this).children(".wrap2"); 232 189 var checkbox = $(this).children("input[type=checkbox]"); 233 190 234 $(checkbox). attr('checked', true);235 $(wrap2).addClass("thumbSelected"); 236 }); 237 191 $(checkbox).prop('checked', true); 192 $(wrap2).addClass("thumbSelected"); 193 }); 194 238 195 checkPermitAction(); 239 196 return false; … … 241 198 242 199 /* select none */ 243 $("#selectNone").click(function 244 $("input[name=setSelected]"). attr('checked', false);245 200 $("#selectNone").click(function() { 201 $("input[name=setSelected]").prop('checked', false); 202 246 203 $(".thumbnails label").each(function() { 247 204 var wrap2 = $(this).children(".wrap2"); 248 205 var checkbox = $(this).children("input[type=checkbox]"); 249 206 250 $(checkbox). attr('checked', false);251 $(wrap2).removeClass("thumbSelected"); 252 }); 253 207 $(checkbox).prop('checked', false); 208 $(wrap2).removeClass("thumbSelected"); 209 }); 210 254 211 checkPermitAction(); 255 212 return false; … … 257 214 258 215 /* select invert */ 259 $("#selectInvert").click(function 260 $("input[name=setSelected]"). attr('checked', false);261 216 $("#selectInvert").click(function() { 217 $("input[name=setSelected]").prop('checked', false); 218 262 219 $(".thumbnails label").each(function() { 263 220 var wrap2 = $(this).children(".wrap2"); 264 221 var checkbox = $(this).children("input[type=checkbox]"); 265 222 266 $(checkbox). attr('checked', !$(checkbox).is(':checked'));223 $(checkbox).prop('checked', !$(checkbox).is(':checked')); 267 224 268 225 if ($(checkbox).is(':checked')) { 269 $(wrap2).addClass("thumbSelected"); 270 } else { 271 $(wrap2).removeClass('thumbSelected'); 226 $(wrap2).addClass("thumbSelected"); 272 227 } 273 }); 274 275 checkPermitAction(); 276 return false; 277 }); 278 228 else { 229 $(wrap2).removeClass('thumbSelected'); 230 } 231 }); 232 233 checkPermitAction(); 234 return false; 235 }); 236 279 237 /* select set */ 280 $("#selectSet").click(function 281 $("input[name=setSelected]"). attr('checked', true);282 238 $("#selectSet").click(function() { 239 $("input[name=setSelected]").prop('checked', true); 240 283 241 $(".thumbnails label").each(function() { 284 242 var wrap2 = $(this).children(".wrap2"); 285 243 var checkbox = $(this).children("input[type=checkbox]"); 286 244 287 $(checkbox). attr('checked', true);288 $(wrap2).addClass("thumbSelected"); 289 }); 290 291 checkPermitAction(); 292 return false; 293 }); 294 245 $(checkbox).prop('checked', true); 246 $(wrap2).addClass("thumbSelected"); 247 }); 248 249 checkPermitAction(); 250 return false; 251 }); 252 295 253 /* begin import */ 296 254 jQuery('#beginImport').click(function() { 297 255 $("#loader_import").fadeIn(); 298 256 var album = $("#albumSelect option:selected").val(); 299 257 300 258 var fills = ''; 301 259 $("input[name^='fill_']:checked").each(function() { 302 260 fills+= $(this).attr("name") +','; 303 }); 304 261 }); 262 305 263 if (jQuery('input[name="setSelected"]').attr('checked')) { 306 264 import_selected = all_elements.length; 307 265 $("#progress").html("0/"+ import_selected); 308 266 309 267 for (var i in all_elements) { 310 268 performImport(all_elements[i], album, fills); 311 269 } 312 } else { 270 } 271 else { 313 272 import_selected = $("input[name='selection[]']:checked").length; 314 273 $("#progress").html("0/"+ import_selected); 315 274 316 275 jQuery("input[name='selection[]']:checked").each(function() { 317 276 performImport(jQuery(this).attr('value'), album, fills); 318 277 }); 319 278 } 320 321 return false; 322 }); 323 279 280 return false; 281 }); 282 324 283 /* pagination loader */ 325 284 jQuery('#navigation a').click(function() { 326 285 $("#loader_display").fadeIn(); 327 286 }); 328 }); 329 {/literal} 287 }(jQuery)); 330 288 {/footer_script} 289 331 290 332 291 <div id="batchManagerGlobal"> … … 334 293 335 294 <fieldset> 336 <legend>{'Selection'| @translate}</legend>295 <legend>{'Selection'|translate}</legend> 337 296 338 297 {if !empty($thumbnails)} 339 298 <p id="checkActions"> 340 {'Select:'| @translate}299 {'Select:'|translate} 341 300 {if $nb_thumbs_set > $nb_thumbs_page} 342 <a href="#" id="selectAll">{'The whole page'| @translate}</a>,343 <a href="#" id="selectSet">{'The whole set'| @translate}</a>,301 <a href="#" id="selectAll">{'The whole page'|translate}</a>, 302 <a href="#" id="selectSet">{'The whole set'|translate}</a>, 344 303 {else} 345 <a href="#" id="selectAll">{'All'| @translate}</a>,304 <a href="#" id="selectAll">{'All'|translate}</a>, 346 305 {/if} 347 <a href="#" id="selectNone">{'None'| @translate}</a>,348 <a href="#" id="selectInvert">{'Invert'| @translate}</a>306 <a href="#" id="selectNone">{'None'|translate}</a>, 307 <a href="#" id="selectInvert">{'Invert'|translate}</a> 349 308 350 309 <span id="selectedMessage"></span> 351 310 <input type="checkbox" name="setSelected" style="display:none"> 352 <span id="loader_display" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'| @translate}</i></span>311 <span id="loader_display" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i></span> 353 312 </p> 354 313 … … 359 318 <label> 360 319 <span class="wrap2"> 361 <div class="actions"><a href="{$thumbnail.src}" class="preview-box">{'Zoom'| @translate}</a> · <a href="{$thumbnail.url}" target="_blank" title="{'Open Flickr page in a new tab'|@translate}">Flickr</a></div>320 <div class="actions"><a href="{$thumbnail.src}" class="preview-box">{'Zoom'|translate}</a> · <a href="{$thumbnail.url}" target="_blank" title="{'Open Flickr page in a new tab'|translate}">Flickr</a></div> 362 321 <span> 363 <img src="{$thumbnail.thumb}" alt="{$thumbnail.title}" title="{$thumbnail.title| @escape:'html'}" class="thumbnail">322 <img src="{$thumbnail.thumb}" alt="{$thumbnail.title}" title="{$thumbnail.title|escape:'html'}" class="thumbnail"> 364 323 </span> 365 324 </span> … … 370 329 {/foreach} 371 330 </ul> 372 373 331 332 374 333 <div style="clear:both;" id="navigation"> 375 334 {if !empty($navbar) } 376 335 <div style="float:left"> 377 {include file='navigation_bar.tpl'| @get_extent:'navbar'}336 {include file='navigation_bar.tpl'|get_extent:'navbar'} 378 337 </div> 379 338 {/if} 380 381 <div style="float:right;margin-top:10px;">{'display'| @translate}339 340 <div style="float:right;margin-top:10px;">{'display'|translate} 382 341 <a href="{$U_DISPLAY}&display=20">20</a> 383 342 · <a href="{$U_DISPLAY}&display=50">50</a> 384 343 · <a href="{$U_DISPLAY}&display=100">100</a> 385 · <a href="{$U_DISPLAY}&display=all">{'all'| @translate}</a>386 {'photos per page'| @translate}344 · <a href="{$U_DISPLAY}&display=all">{'all'|translate}</a> 345 {'photos per page'|translate} 387 346 </div> 388 347 </div> 389 348 390 349 {else} 391 <div>{'No photo in the current set.'| @translate}</div>350 <div>{'No photo in the current set.'|translate}</div> 392 351 {/if} 393 352 </fieldset> 394 353 395 354 <fieldset> 396 <legend>{'Import options'| @translate}</legend>355 <legend>{'Import options'|translate}</legend> 397 356 398 357 <p> 399 <label for="albumSelect"><b>{'Album'| @translate}:</b></label>358 <label for="albumSelect"><b>{'Album'|translate}:</b></label> 400 359 <select style="width:400px" name="associate" id="albumSelect" size="1"> 401 360 {html_options options=$category_parent_options} 402 361 </select> 403 {'... or '| @translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>362 {'... or '|translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a> 404 363 </p> 405 364 406 365 <p> 407 <b>{'Fill these fields from Flickr datas'| @translate}:</b>408 <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'| @translate}</label>409 <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'| @translate}</label>410 <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'| @translate}</label>411 <label><input type="checkbox" name="fill_taken" checked="checked"> {'Creation date'| @translate}</label>412 <label><input type="checkbox" name="fill_posted"> {'Post date'| @translate}</label>366 <b>{'Fill these fields from Flickr datas'|translate}:</b> 367 <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'|translate}</label> 368 <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|translate}</label> 369 <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|translate}</label> 370 <label><input type="checkbox" name="fill_taken" checked="checked"> {'Creation date'|translate}</label> 371 <label><input type="checkbox" name="fill_posted"> {'Post date'|translate}</label> 413 372 <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|@translate}</label> 414 {if $GMAPS_LOADED}<label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label>{/if}373 <label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label> 415 374 </p> 416 375 417 376 <p> 418 377 <input type="hidden" name="album" value="{$album}"> 419 <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'| @translate}" style="display:none;">420 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'| @translate}</i> <span id="progress"></span></span>378 <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'|translate}" style="display:none;"> 379 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i> <span id="progress"></span></span> 421 380 </p> 422 381 </fieldset> -
extensions/flickr2piwigo/admin/template/import.tpl
r25789 r26180 1 {combine_css path=$FLICKR_PATH| @cat:"admin/template/style.css"}1 {combine_css path=$FLICKR_PATH|cat:'admin/template/style.css'} 2 2 3 3 {include file='include/colorbox.inc.tpl'} 4 4 {include file='include/add_album.inc.tpl'} 5 {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} 5 6 {combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'} 6 7 {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js'} … … 13 14 {* <!-- LOGIN --> *} 14 15 {if $ACTION == 'init_login'} 15 <p><input type="submit" on Click="javascript:window.location.href ='{$flickr_login}';" value="{'Login'|@translate}"></p>16 <p><input type="submit" onclick="javascript:window.location.href ='{$flickr_login}';" value="{'Login'|translate}"></p> 16 17 17 18 {* <!-- MAIN MENU --> *} 18 {elseif $ACTION == 'main'} 19 {footer_script}{literal} 19 {else if $ACTION == 'main'} 20 21 {footer_script} 20 22 jQuery('input[type="submit"]').click(function() { 21 23 window.location.href = $(this).attr("data"); … … 24 26 $("#loader_import").fadeIn(); 25 27 }); 26 {/ literal}{/footer_script}28 {/footer_script} 27 29 28 30 <p> 29 <b>{'Logged in as'| @translate}</b> : <a href="{$profile_url}" target="_blank">{$username}</a><br><br>30 <input type="submit" data="{$logout_url}" value="{'Logout'| @translate}">31 <b>{'Logged in as'|translate}</b> : <a href="{$profile_url}" target="_blank">{$username}</a><br><br> 32 <input type="submit" data="{$logout_url}" value="{'Logout'|translate}"> 31 33 </p> 32 34 <br> 33 35 <p> 34 <input type="submit" data="{$list_albums_url}" class="load" value="{'List my albums'| @translate}">35 <input type="submit" data="{$import_all_url}" class="load" value="{'Import all my pictures'| @translate}">36 <input type="submit" data="{$list_albums_url}" class="load" value="{'List my albums'|translate}"> 37 <input type="submit" data="{$import_all_url}" class="load" value="{'Import all my pictures'|translate}"> 36 38 <br> 37 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'| @translate}</i></span>39 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i></span> 38 40 </p> 39 41 40 42 {* <!-- ALBUMS LIST --> *} 41 {elseif $ACTION == 'list_albums'} 42 {footer_script}{literal} 43 {else if $ACTION == 'list_albums'} 44 45 {footer_script} 43 46 jQuery('.load').click(function() { 44 47 $("#loader_import").fadeIn(); 45 48 }); 46 {/ literal}{/footer_script}49 {/footer_script} 47 50 48 <h3>{'%d albums'| @translate|@sprintf:$total_albums}</h3>51 <h3>{'%d albums'|translate:$total_albums}</h3> 49 52 <ul id="albumsList"> 50 53 {foreach from=$albums item=album} 51 54 <li {if $album.id == "not_in_set"}class="not_in_set"{/if}> 52 <b><a href="{$album.U_LIST}" class="load">{$album.title}</a></b> <i>{'(%d photos)'| @translate|@sprintf:$album.photos}</i>53 {if $album.description}- {$album.description| @truncate:100}{/if}55 <b><a href="{$album.U_LIST}" class="load">{$album.title}</a></b> <i>{'(%d photos)'|translate:$album.photos}</i> 56 {if $album.description}- {$album.description|truncate:100}{/if} 54 57 </li> 55 58 {/foreach} 56 59 </ul> 57 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'| @translate}</i></span>60 <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i></span> 58 61 59 62 {* <!-- PHOTOS LIST --> *} 60 {else if $ACTION == 'list_photos'}61 {include file=$FLICKR_ABS_PATH| @cat:'admin/template/import.list_photos.tpl'}63 {else if $ACTION == 'list_photos'} 64 {include file=$FLICKR_ABS_PATH|cat:'admin/template/import.list_photos.tpl'} 62 65 63 66 {* <!-- IMPORT ALL --> *} 64 {else if $ACTION == 'list_all'}65 {include file=$FLICKR_ABS_PATH| @cat:'admin/template/import.list_all.tpl'}67 {else if $ACTION == 'list_all'} 68 {include file=$FLICKR_ABS_PATH|cat:'admin/template/import.list_all.tpl'} 66 69 67 70 {/if}
Note: See TracChangeset
for help on using the changeset viewer.