Index: /extensions/Google2Piwigo/admin.php
===================================================================
--- /extensions/Google2Piwigo/admin.php	(revision 26197)
+++ /extensions/Google2Piwigo/admin.php	(revision 26198)
@@ -1,4 +1,4 @@
 <?php
-if (!defined('PICASA_WA_PATH')) die('Hacking attempt!');
+defined('PICASA_WA_PATH') or die('Hacking attempt!');
 
 global $template, $page, $conf;
@@ -20,5 +20,4 @@
   'PICASA_WA_ADMIN' => PICASA_WA_ADMIN,
   ));
+
 $template->assign_var_from_handle('ADMIN_CONTENT', 'picasa_web_albums');
-
-?>
Index: /extensions/Google2Piwigo/admin/import.php
===================================================================
--- /extensions/Google2Piwigo/admin/import.php	(revision 26197)
+++ /extensions/Google2Piwigo/admin/import.php	(revision 26198)
@@ -1,4 +1,4 @@
 <?php
-if (!defined('PICASA_WA_PATH')) die('Hacking attempt!');
+defined('PICASA_WA_PATH') or die('Hacking attempt!');
 
 set_time_limit(600);
@@ -6,7 +6,7 @@
 include_once(PICASA_WA_PATH . 'include/functions.inc.php');
 
-if ( !test_remote_download() )
+if (!test_remote_download())
 {
-  array_push($page['errors'], l10n('No download method available'));
+  $page['errors'][] = l10n('No download method available');
   $_GET['action'] = 'error';
 }
@@ -39,5 +39,8 @@
 
 
-if (!isset($_GET['action'])) $_GET['action'] = 'main';
+if (!isset($_GET['action']))
+{
+  $_GET['action'] = 'main';
+}
 
 switch ($_GET['action'])
@@ -102,10 +105,10 @@
     foreach ($userFeed as $userEntry)
     {
-      array_push($albums, array(
+      $albums[] = array(
         'title' =>       $userEntry->title->text,
         'description' => $userEntry->mediaGroup->description->text,
         'photos' =>      $userEntry->gphotoNumPhotos->text,
         'U_LIST' => PICASA_WA_ADMIN . '-import&amp;action=list_photos&amp;album=' . $userEntry->gphotoId->text,
-        ));
+        );
     }
     
@@ -139,5 +142,5 @@
     foreach ($albumFeed as $albumEntry)
     {
-      array_push($all_photos, array(
+      $all_photos[] = array(
         'id' =>    $albumEntry->getGphotoId()->getText(),
         'name' =>  $albumEntry->mediaGroup->title->text,
@@ -145,5 +148,5 @@
         'src' =>   $albumEntry->mediaGroup->content[0]->url,
         'url' =>   $albumEntry->link[2]->href,
-        ));
+        );
     }
     
@@ -170,6 +173,9 @@
     if ($duplicates>0)
     {
-      $page['infos'][] = '<a href="admin.php?page=batch_manager&amp;prefilter=picasa">'
-          .l10n_dec('One picture is not displayed because already existing in the database.', '%d pictures are not displayed because already existing in the database.', $duplicates)
+      $page['infos'][] = '<a href="admin.php?page=batch_manager&amp;filter=prefilter-picasa">'
+          .l10n_dec(
+            'One picture is not displayed because already existing in the database.',
+            '%d pictures are not displayed because already existing in the database.',
+            $duplicates)
         .'</a>';
     }
@@ -260,6 +266,9 @@
     if ($duplicates>0)
     {
-      $page['infos'][] = '<a href="admin.php?page=batch_manager&amp;prefilter=picasa">'
-          .l10n_dec('One picture is not displayed because already existing in the database.', '%d pictures are not displayed because already existing in the database.', $duplicates)
+      $page['infos'][] = '<a href="admin.php?page=batch_manager&amp;filter=prefilter-picasa">'
+          .l10n_dec(
+            'One picture is not displayed because already existing in the database.',
+            '%d pictures are not displayed because already existing in the database.',
+            $duplicates)
         .'</a>';
     }
@@ -267,5 +276,5 @@
     $template->assign(array(
       'nb_elements' =>  count($all_photos),
-      'all_elements' => json_encode($all_photos),
+      'all_elements' => $all_photos,
       'F_ACTION' =>     PICASA_WA_ADMIN . '-import&amp;action=import_set',
       ));
@@ -285,5 +294,5 @@
     if (isset($_POST['done']))
     {
-      $_SESSION['page_infos'][] = sprintf(l10n('%d pictures imported'), $_POST['done']);
+      $_SESSION['page_infos'][] = l10n('%d pictures imported', $_POST['done']);
     }
     redirect(PICASA_WA_ADMIN . '-import');
@@ -292,10 +301,5 @@
 
 
-$template->assign(array(
-  'ACTION' => $_GET['action'],
-  'GMAPS_LOADED' => !empty($pwg_loaded_plugins['rv_gmaps']) || !empty($pwg_loaded_plugins['piwigo-openstreetmap']),
-  ));
+$template->assign('ACTION', $_GET['action']);
 
 $template->set_filename('picasa_web_albums', realpath(PICASA_WA_PATH . '/admin/template/import.tpl'));
-
-?>
Index: /extensions/Google2Piwigo/admin/template/import.list_all.tpl
===================================================================
--- /extensions/Google2Piwigo/admin/template/import.list_all.tpl	(revision 26197)
+++ /extensions/Google2Piwigo/admin/template/import.list_all.tpl	(revision 26198)
@@ -1,55 +1,67 @@
 {footer_script require='jquery.ajaxmanager,jquery.jgrowl'}
-/* global vars */
-var errorHead   = '{'ERROR'|@translate|@escape:'javascript'}';
-var errorMsg    = '{'an error happened'|@translate|@escape:'javascript'}';
-var successHead = '{'Success'|@translate|@escape:'javascript'}';
+(function($){
+  /* global vars */
+  var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}];
+  var import_done = 0;
+  var import_selected = {$nb_elements};
+  var queuedManager = $.manageAjax.create('queued', {
+    queue: true,  
+    maxRequests: 1
+  });
 
-var import_done = 0;
-var import_selected = {$nb_elements};
-var queuedManager = jQuery.manageAjax.create('queued', {ldelim}
-  queue: true,  
-  maxRequests: 1
-});
+  /* import queue */
+  function performImport(photo, album, fills, pwa_album) {
+    queuedManager.add({
+      type: 'GET',
+      dataType: 'json',
+      url: 'ws.php',
+      data: {
+        method: 'pwg.images.addPicasa',
+        id: photo,
+        category: album,
+        fills: fills,
+        pwa_album: pwa_album,
+        format: 'json'
+      },
+      success: function(data) {
+        if (data['stat'] == 'ok') {
+          $.jGrowl(data['result'], {
+            theme: 'success', life: 4000, sticky: false,
+            header: '{'Success'|translate}'
+          });
+        }
+        else {
+          $.jGrowl(data['result'], {
+            theme: 'error', sticky: true,
+            header: '{'ERROR'|translate}'
+          });
+        }
+        
+        import_done++;
+        $("#progress").html(import_done +"/"+ import_selected);
+        
+        if (import_done == import_selected) {
+          $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">');
+          $("#import_form").submit();
+        }
+      },
+      error: function(data) {
+        $.jGrowl('{'an error happened'|translate|escape:javascript}', {
+          theme: 'error', sticky: true,
+          header: '{'ERROR'|translate}'
+        });
+      }
+    });
+  }
 
-{literal}
-/* import queue */
-function performImport(photo, album, fills, pwa_album) {
-  queuedManager.add({
-    type: 'GET',
-    dataType: 'json',
-    url: 'ws.php',
-    data: { method: 'pwg.images.addPicasa', id: photo, category: album, fills: fills, pwa_album: pwa_album, format: 'json' },
-    success: function(data) {
-      if (data['stat'] == 'ok') {
-        jQuery.jGrowl(data['result'], { theme: 'success', header: successHead, life: 4000, sticky: false });
-      } else {
-        jQuery.jGrowl(data['result'], { theme: 'error', header: errorHead, sticky: true });
-      }
-      
-      import_done++;
-      $("#progress").html(import_done +"/"+ import_selected);
-      
-      if (import_done == import_selected) {
-        $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">');
-        $("#import_form").submit();
-      }
-    },
-    error: function(data) {
-      jQuery.jGrowl(errorMsg, { theme: 'error', header: errorHead, sticky: true });
-    }
-  });
-}
-
-
-$(document).ready(function() {
-  var all_elements = {/literal}{$all_elements}{literal};
   
   /* begin import */
-  jQuery('#beginImport').click(function() {
+  $('#beginImport').click(function() {
     $("#loader_import").fadeIn();
     
     if ($("input[name='album_mode']:checked").val() == 'identical') {
       album = "<!-- create -->";
-    } else {
+    }
+    else {
       album = $("#albumSelect option:selected").val();
     }
@@ -74,10 +86,10 @@
     if ($(this).val() == 'one_album') {
       $("#albumSelectWrapper").slideDown();
-    } else {
+    }
+    else {
       $("#albumSelectWrapper").slideUp();
     }
   });
-});
-{/literal}
+}(jQuery));
 {/footer_script}
 
@@ -85,19 +97,19 @@
 
   <fieldset>
-    <legend>{'Selection'|@translate}</legend>
+    <legend>{'Selection'|translate}</legend>
 
   {if $nb_elements}
-    {'%d elements ready for importation'|@translate|@sprintf:$nb_elements}
+    {'%d elements ready for importation'|translate:$nb_elements}
   {else}
-    <div>{'No photo in the current set.'|@translate}</div>
+    <div>{'No photo in the current set.'|translate}</div>
   {/if}
   </fieldset>
   
   <fieldset>
-    <legend>{'Import options'|@translate}</legend>
+    <legend>{'Import options'|translate}</legend>
     
     <p>
-      <label><input type="radio" name="album_mode" value="identical" checked="checked"> {'Reproduce Google albums'|@translate}</label><br>
-      <label><input type="radio" name="album_mode" value="one_album"> {'Import all photos in this album'|@translate} :</label>
+      <label><input type="radio" name="album_mode" value="identical" checked="checked"> {'Reproduce Google albums'|translate}</label><br>
+      <label><input type="radio" name="album_mode" value="one_album"> {'Import all photos in this album'|translate} :</label>
     </p>
 
@@ -106,20 +118,20 @@
         {html_options options=$category_parent_options}
       </select>
-      {'... or '|@translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
+      {'... or '|translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a>
     </p>
     
     <p>
-      <b>{'Fill these fields from Google datas'|@translate}:</b>
-      <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'|@translate}</label>
-      <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|@translate}</label>
-      <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|@translate}</label>
-      <label><input type="checkbox" name="fill_date" checked="checked"> {'Creation date'|@translate}</label>
-      <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|@translate}</label>
-      {if $GMAPS_LOADED}<label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label>{/if}
+      <b>{'Fill these fields from Google datas'|translate}:</b>
+      <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'|translate}</label>
+      <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|translate}</label>
+      <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|translate}</label>
+      <label><input type="checkbox" name="fill_date" checked="checked"> {'Creation date'|translate}</label>
+      <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|translate}</label>
+      <label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|translate}</label>
     </p>
     
     <p>
-      <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'|@translate}" {if not $nb_elements}style="display:none;"{/if}>
-      <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>
+      <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'|translate}" {if not $nb_elements}style="display:none;"{/if}>
+      <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>
     </p>
   </fieldset>
Index: /extensions/Google2Piwigo/admin/template/import.list_photos.tpl
===================================================================
--- /extensions/Google2Piwigo/admin/template/import.list_photos.tpl	(revision 26197)
+++ /extensions/Google2Piwigo/admin/template/import.list_photos.tpl	(revision 26198)
@@ -1,29 +1,18 @@
 {footer_script require='jquery.ajaxmanager,jquery.jgrowl'}
-/* global vars */
-var nb_thumbs_page = {$nb_thumbs_page};
-var nb_thumbs_set = {$nb_thumbs_set};
-var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}];
-
-var errorHead   = '{'ERROR'|@translate|@escape:'javascript'}';
-var errorMsg    = '{'an error happened'|@translate|@escape:'javascript'}';
-var successHead = '{'Success'|@translate|@escape:'javascript'}';
-var selectedMessage_pattern = "{'%d of %d photos selected'|@translate}";
-var selectedMessage_none = "{'No photo selected, %d photos in current set'|@translate}";
-var selectedMessage_all = "{'All %d photos are selected'|@translate}";
-var applyOnDetails_pattern = "{'on the %d selected photos'|@translate}";
-
-var import_done = 0;
-var import_selected = 0;
-var queuedManager = jQuery.manageAjax.create('queued', {ldelim}
-  queue: true,  
-  maxRequests: 1
-});
-
-{literal}
-/* Shift-click: select all photos between the click and the shift+click */
-jQuery(document).ready(function() {
+(function($){
+  /* global vars */
+  var nb_thumbs_set = {$nb_thumbs_set};
+  var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}];
+  var import_done = 0;
+  var import_selected = 0;
+  var queuedManager = $.manageAjax.create('queued', {ldelim}
+    queue: true,  
+    maxRequests: 1
+  });
+
+  /* Shift-click: select all photos between the click and the shift+click */
   var last_clicked=0;
   var last_clickedstatus=true;
-  jQuery.fn.enableShiftClick = function() {
+  $.fn.enableShiftClick = function() {
     var inputs = [];
     var count=0;
@@ -60,138 +49,109 @@
         return true;
       });
-      $(this).click(function(event) {$(this).triggerHandler("shclick",event)});
-    });
-  }
-});
-
-/* sprintf */
-function str_repeat(i, m) {
-    for (var o = []; m > 0; o[--m] = i);
-    return o.join('');
-}
-
-function sprintf() {
-  var i = 0, a, f = arguments[i++], o = [], m, p, c, x, s = '';
-  while (f) {
-    if (m = /^[^\x25]+/.exec(f)) {
-      o.push(m[0]);
-    }
-    else if (m = /^\x25{2}/.exec(f)) {
-      o.push('%');
-    }
-    else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) {
-      if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) {
-        throw('Too few arguments.');
-      }
-      if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) {
-        throw('Expecting number but found ' + typeof(a));
-      }
-      switch (m[7]) {
-        case 'b': a = a.toString(2); break;
-        case 'c': a = String.fromCharCode(a); break;
-        case 'd': a = parseInt(a); break;
-        case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break;
-        case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break;
-        case 'o': a = a.toString(8); break;
-        case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break;
-        case 'u': a = Math.abs(a); break;
-        case 'x': a = a.toString(16); break;
-        case 'X': a = a.toString(16).toUpperCase(); break;
-      }
-      a = (/[def]/.test(m[7]) && m[2] && a >= 0 ? '+'+ a : a);
-      c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
-      x = m[5] - String(a).length - s.length;
-      p = m[5] ? str_repeat(c, x) : '';
-      o.push(s + (m[4] ? a + p : p + a));
-    }
-    else {
-      throw('Huh ?!');
-    }
-    f = f.substring(m[0].length);
-  }
-  return o.join('');
-}
-
-/* update displaying */
-function checkPermitAction() {
-  var nbSelected = 0;
-  if ($("input[name=setSelected]").is(':checked')) {
-    nbSelected = nb_thumbs_set;
-  } else {
-    $(".thumbnails input[type=checkbox]").each(function() {
-      if ($(this).is(':checked')) nbSelected++;
-    });
-  }
-
-  if (nbSelected == 0) {
-    $("#beginImport").hide();
-  } else {
-    $("#beginImport").show();
-  }
-
-  $("#applyOnDetails").text(
-    sprintf(
-      applyOnDetails_pattern,
-      nbSelected
-    )
-  );
-
-  // display the number of currently selected photos in the "Selection" fieldset
-  if (nbSelected == 0) {
-    $("#selectedMessage").text(
+      $(this).click(function(event) { $(this).triggerHandler("shclick",event); });
+    });
+  };
+
+  /* update displaying */
+  function checkPermitAction() {
+    var nbSelected = 0;
+    if ($("input[name=setSelected]").is(':checked')) {
+      nbSelected = nb_thumbs_set;
+    }
+    else {
+      $(".thumbnails input[type=checkbox]").each(function() {
+        if ($(this).is(':checked')) nbSelected++;
+      });
+    }
+
+    if (nbSelected == 0) {
+      $("#beginImport").hide();
+    }
+    else {
+      $("#beginImport").show();
+    }
+
+    $("#applyOnDetails").text(
       sprintf(
-        selectedMessage_none,
-        nb_thumbs_set
+        '{'on the %d selected photos'|translate|escape:javascript}',
+        nbSelected
       )
     );
-  } else if (nbSelected == nb_thumbs_set) {
-    $("#selectedMessage").text(
-      sprintf(
-        selectedMessage_all,
-        nb_thumbs_set
-      )
-    );
-  } else {
-    $("#selectedMessage").text(
-      sprintf(
-        selectedMessage_pattern,
-        nbSelected,
-        nb_thumbs_set
-      )
-    );
+
+    // display the number of currently selected photos in the "Selection" fieldset
+    if (nbSelected == 0) {
+      $("#selectedMessage").text(
+        sprintf(
+          '{'No photo selected, %d photos in current set'|translate|escape:javascript}',
+          nb_thumbs_set
+        )
+      );
+    }
+    else if (nbSelected == nb_thumbs_set) {
+      $("#selectedMessage").text(
+        sprintf(
+          '{'All %d photos are selected'|translate|escape:javascript}',
+          nb_thumbs_set
+        )
+      );
+    }
+    else {
+      $("#selectedMessage").text(
+        sprintf(
+          '{'%d of %d photos selected'|translate|escape:javascript}',
+          nbSelected,
+          nb_thumbs_set
+        )
+      );
+    }
   }
-}
-
-/* import queue */
-function performImport(photo, album, fills, pwa_album) {
-  queuedManager.add({
-    type: 'GET',
-    dataType: 'json',
-    url: 'ws.php',
-    data: { method: 'pwg.images.addPicasa', id: photo, category: album, fills: fills, pwa_album: pwa_album, format: 'json' },
-    success: function(data) {
-      if (data['stat'] == 'ok') {
-        jQuery.jGrowl(data['result'], { theme: 'success', header: successHead, life: 4000, sticky: false });
-        jQuery("#photo-"+photo).fadeOut(function(){ $(this).remove(); });
-      } else {
-        jQuery.jGrowl(data['result'], { theme: 'error', header: errorHead, sticky: true });
+
+  /* import queue */
+  function performImport(photo, album, fills, pwa_album) {
+    queuedManager.add({
+      type: 'GET',
+      dataType: 'json',
+      url: 'ws.php',
+      data: {
+        method: 'pwg.images.addPicasa',
+        id: photo,
+        category: album,
+        fills: fills,
+        pwa_album: pwa_album,
+        format: 'json'
+      },
+      success: function(data) {
+        if (data['stat'] == 'ok') {
+          $.jGrowl(data['result'], {
+            theme: 'success', life: 4000, sticky: false,
+            header: '{'Success'|translate}'
+          });
+          $("#photo-"+photo).fadeOut(function(){ $(this).remove(); });
+        }
+        else {
+          $.jGrowl(data['result'], {
+            theme: 'error', sticky: true,
+            header: '{'ERROR'|translate}'
+          });
+        }
+        
+        import_done++;
+        $("#progress").html(import_done +"/"+ import_selected);
+        
+        if (import_done == import_selected) {
+          $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">');
+          $("#import_form").submit();
+        }
+      },
+      error: function(data) {
+        $.jGrowl('{'an error happened'|translate|escape:javascript}', {
+          theme: 'error', sticky: true,
+          header: '{'ERROR'|translate}'
+        });
       }
-      
-      import_done++;
-      $("#progress").html(import_done +"/"+ import_selected);
-      
-      if (import_done == import_selected) {
-        $("#import_form").append('<input type="hidden" name="done" value="' + import_done + '">');
-        $("#import_form").submit();
-      }
-    },
-    error: function(data) {
-      jQuery.jGrowl(errorMsg, { theme: 'error', header: errorHead, sticky: true });
-    }
-  });
-}
-
-
-$(document).ready(function() {
+    });
+  }
+
+
   checkPermitAction();
   $("a.preview-box").colorbox();
@@ -207,5 +167,5 @@
   /* thumbnail click */
   $(".wrap1 label").click(function (event) {
-    $("input[name=setSelected]").attr('checked', false);
+    $("input[name=setSelected]").prop('checked', false);
 
     var wrap2 = $(this).children(".wrap2");
@@ -226,5 +186,5 @@
   /* select all */
   $("#selectAll").click(function () {
-    $("input[name=setSelected]").attr('checked', false);
+    $("input[name=setSelected]").prop('checked', false);
     
     $(".thumbnails label").each(function() {
@@ -232,5 +192,5 @@
       var checkbox = $(this).children("input[type=checkbox]");
 
-      $(checkbox).attr('checked', true);
+      $(checkbox).prop('checked', true);
       $(wrap2).addClass("thumbSelected"); 
     });
@@ -242,5 +202,5 @@
   /* select none */
   $("#selectNone").click(function () {
-    $("input[name=setSelected]").attr('checked', false);
+    $("input[name=setSelected]").prop('checked', false);
     
     $(".thumbnails label").each(function() {
@@ -248,5 +208,5 @@
       var checkbox = $(this).children("input[type=checkbox]");
 
-      $(checkbox).attr('checked', false);
+      $(checkbox).prop('checked', false);
       $(wrap2).removeClass("thumbSelected"); 
     });
@@ -258,5 +218,5 @@
   /* select invert */
   $("#selectInvert").click(function () {
-    $("input[name=setSelected]").attr('checked', false);
+    $("input[name=setSelected]").prop('checked', false);
     
     $(".thumbnails label").each(function() {
@@ -264,9 +224,10 @@
       var checkbox = $(this).children("input[type=checkbox]");
 
-      $(checkbox).attr('checked', !$(checkbox).is(':checked'));
+      $(checkbox).prop('checked', !$(checkbox).is(':checked'));
 
       if ($(checkbox).is(':checked')) {
         $(wrap2).addClass("thumbSelected"); 
-      } else {
+      }
+      else {
         $(wrap2).removeClass('thumbSelected'); 
       }
@@ -279,5 +240,5 @@
   /* select set */
   $("#selectSet").click(function () {
-    $("input[name=setSelected]").attr('checked', true);
+    $("input[name=setSelected]").prop('checked', true);
     
     $(".thumbnails label").each(function() {
@@ -285,5 +246,5 @@
       var checkbox = $(this).children("input[type=checkbox]");
 
-      $(checkbox).attr('checked', true);
+      $(checkbox).prop('checked', true);
       $(wrap2).addClass("thumbSelected"); 
     });
@@ -294,8 +255,8 @@
  
   /* begin import */
-  jQuery('#beginImport').click(function() {
+  $('#beginImport').click(function() {
     $("#loader_import").fadeIn();
     var album = $("#albumSelect option:selected").val();
-    var pwa_album = "{/literal}{$album}{literal}";
+    var pwa_album = "{$album}";
     
     var fills = '';
@@ -304,5 +265,5 @@
     }); 
     
-    if (jQuery('input[name="setSelected"]').attr('checked')) {
+    if ($('input[name="setSelected"]').prop('checked')) {
       import_selected = all_elements.length;
       $("#progress").html("0/"+ import_selected);
@@ -311,10 +272,11 @@
         performImport(all_elements[i], album, fills, pwa_album);
       }
-		} else {
+		}
+    else {
       import_selected = $("input[name='selection[]']:checked").length;
       $("#progress").html("0/"+ import_selected);
       
-			jQuery("input[name='selection[]']:checked").each(function() {
-        performImport(jQuery(this).attr('value'), album, fills, pwa_album);
+			$("input[name='selection[]']:checked").each(function() {
+        performImport($(this).attr('value'), album, fills, pwa_album);
       });
     }
@@ -324,10 +286,10 @@
   
   /* pagination loader */
-  jQuery('#navigation a').click(function() {
+  $('#navigation a').click(function() {
     $("#loader_display").fadeIn();
   });
-});
-{/literal}
+}(jQuery));
 {/footer_script}
+
 
 <div id="batchManagerGlobal">
@@ -335,21 +297,21 @@
 
   <fieldset>
-    <legend>{'Selection'|@translate}</legend>
+    <legend>{'Selection'|translate}</legend>
 
   {if !empty($thumbnails)}
     <p id="checkActions">
-      {'Select:'|@translate}
+      {'Select:'|translate}
     {if $nb_thumbs_set > $nb_thumbs_page}
-      <a href="#" id="selectAll">{'The whole page'|@translate}</a>,
-      <a href="#" id="selectSet">{'The whole set'|@translate}</a>,
+      <a href="#" id="selectAll">{'The whole page'|translate}</a>,
+      <a href="#" id="selectSet">{'The whole set'|translate}</a>,
     {else}
-      <a href="#" id="selectAll">{'All'|@translate}</a>,
+      <a href="#" id="selectAll">{'All'|translate}</a>,
     {/if}
-      <a href="#" id="selectNone">{'None'|@translate}</a>,
-      <a href="#" id="selectInvert">{'Invert'|@translate}</a>
+      <a href="#" id="selectNone">{'None'|translate}</a>,
+      <a href="#" id="selectInvert">{'Invert'|translate}</a>
 
       <span id="selectedMessage"></span>
       <input type="checkbox" name="setSelected" style="display:none">
-      <span id="loader_display" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|@translate}</i></span>
+      <span id="loader_display" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i></span>
     </p>
 
@@ -360,5 +322,5 @@
 					<label>
 						<span class="wrap2">
-						<div class="actions"><a href="{$thumbnail.src}" class="preview-box">{'Zoom'|@translate}</a> &middot; <a href="{$thumbnail.url}" target="_blank" title="{'Open Google page in a new tab'|@translate}">Picasa</a></div>
+						<div class="actions"><a href="{$thumbnail.src}" class="preview-box">{'Zoom'|translate}</a> &middot; <a href="{$thumbnail.url}" target="_blank" title="{'Open Google page in a new tab'|translate}">Picasa</a></div>
 							<span>
 								<img src="{$thumbnail.thumb}" alt="{$thumbnail.title}" title="{$thumbnail.title|@escape:'html'}" class="thumbnail">
@@ -380,43 +342,43 @@
     {/if}
     
-      <div style="float:right;margin-top:10px;">{'display'|@translate}
+      <div style="float:right;margin-top:10px;">{'display'|translate}
         <a href="{$U_DISPLAY}&amp;display=20">20</a>
         &middot; <a href="{$U_DISPLAY}&amp;display=50">50</a>
         &middot; <a href="{$U_DISPLAY}&amp;display=100">100</a>
-        &middot; <a href="{$U_DISPLAY}&amp;display=all">{'all'|@translate}</a>
-        {'photos per page'|@translate}
+        &middot; <a href="{$U_DISPLAY}&amp;display=all">{'all'|translate}</a>
+        {'photos per page'|translate}
       </div>
     </div>
 
   {else}
-    <div>{'No photo in the current set.'|@translate}</div>
+    <div>{'No photo in the current set.'|translate}</div>
   {/if}
   </fieldset>
   
   <fieldset>
-    <legend>{'Import options'|@translate}</legend>
+    <legend>{'Import options'|translate}</legend>
 
     <p>
-      <label for="albumSelect"><b>{'Album'|@translate}:</b></label>
+      <label for="albumSelect"><b>{'Album'|translate}:</b></label>
       <select style="width:400px" name="associate" id="albumSelect" size="1">
         {html_options options=$category_parent_options}
       </select>
-      {'... or '|@translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
+      {'... or '|translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a>
     </p>
     
     <p>
-      <b>{'Fill these fields from Google datas'|@translate}:</b>
-      <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'|@translate}</label>
-      <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|@translate}</label>
-      <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|@translate}</label>
-      <label><input type="checkbox" name="fill_taken" checked="checked"> {'Creation date'|@translate}</label>
-      <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|@translate}</label>
-      {if $GMAPS_LOADED}<label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|@translate}</label>{/if}
+      <b>{'Fill these fields from Google datas'|translate}:</b>
+      <label><input type="checkbox" name="fill_name" checked="checked"> {'Photo name'|translate}</label>
+      <label><input type="checkbox" name="fill_author" checked="checked"> {'Author'|translate}</label>
+      <label><input type="checkbox" name="fill_tags" checked="checked"> {'Tags'|translate}</label>
+      <label><input type="checkbox" name="fill_taken" checked="checked"> {'Creation date'|translate}</label>
+      <label><input type="checkbox" name="fill_description" checked="checked"> {'Description'|translate}</label>
+      <label><input type="checkbox" name="fill_geotag" checked="checked"> {'Geolocalization'|translate}</label>
     </p>
 
     <p>
       <input type="hidden" name="album" value="{$album}">
-      <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'|@translate}" style="display:none;">
-      <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>
+      <input type="submit" name="import_set" id="beginImport" value="{'Begin transfer'|translate}" style="display:none;">
+      <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>
     </p>
   </fieldset>
Index: /extensions/Google2Piwigo/admin/template/import.tpl
===================================================================
--- /extensions/Google2Piwigo/admin/template/import.tpl	(revision 26197)
+++ /extensions/Google2Piwigo/admin/template/import.tpl	(revision 26198)
@@ -1,18 +1,20 @@
 {include file='include/colorbox.inc.tpl'}
 {include file='include/add_album.inc.tpl'}
+{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
 {combine_script id='jquery.ajaxmanager' load='footer' path='themes/default/js/plugins/jquery.ajaxmanager.js'}
 {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js'}
 {combine_css path="themes/default/js/plugins/jquery.jGrowl.css"}
 
-{combine_css path=$PICASA_WA_PATH|@cat:"admin/template/style.css"}
+{combine_css path=$PICASA_WA_PATH|cat:"admin/template/style.css"}
 
-{footer_script}{literal}
+{footer_script}
 $("input.login").click(function() {
-  window.location.href = "{/literal}{$picasa_login}{literal}";
+  window.location.href = "{$picasa_login}";
 });
 $(".login_help").click(function() {
   $(".infos.tip").slideToggle();
 });
-{/literal}{/footer_script}
+{/footer_script}
+
 
 <div class="titrePage">
@@ -22,6 +24,6 @@
 {* <!-- LOGIN --> *}
 {if $ACTION == 'login'}
-<p><input type="submit" class="login" value="{'Login'|@translate}"></p>
-<p><a href="#" class="login_help">{'Help! I get the error "The site [...] has not been registered."'|@translate}</a></p>
+<p><input type="submit" class="login" value="{'Login'|translate}"></p>
+<p><a href="#" class="login_help">{'Help! I get the error "The site [...] has not been registered."'|translate}</a></p>
 
 <div class="infos tip" style="display:none;">
@@ -30,6 +32,6 @@
 
 {* <!-- MAIN MENU --> *}
-{elseif $ACTION == 'main'}
-{footer_script}{literal}
+{else if $ACTION == 'main'}
+{footer_script}
 jQuery('input[type="submit"]').click(function() {
   window.location.href = $(this).attr("data");
@@ -38,43 +40,43 @@
   $("#loader_import").fadeIn();
 });
-{/literal}{/footer_script}
+{/footer_script}
 
 <p>
-  <b>{'Logged in as'|@translate}</b> : {$username}<br><br>
-  <input type="submit" data="{$logout_url}" value="{'Logout'|@translate}">
+  <b>{'Logged in as'|translate}</b> : {$username}<br><br>
+  <input type="submit" data="{$logout_url}" value="{'Logout'|translate}">
 </p>
 <br>
 <p>
-  <input type="submit" data="{$list_albums_url}" class="load" value="{'List my albums'|@translate}">
-  <input type="submit" data="{$import_all_url}" class="load" value="{'Import all my pictures'|@translate}">
+  <input type="submit" data="{$list_albums_url}" class="load" value="{'List my albums'|translate}">
+  <input type="submit" data="{$import_all_url}" class="load" value="{'Import all my pictures'|translate}">
   <br>
-  <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|@translate}</i></span>
+  <span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i></span>
 </p>
 
 {* <!-- ALBUMS LIST --> *}
-{elseif $ACTION == 'list_albums'}
-{footer_script}{literal}
+{else if $ACTION == 'list_albums'}
+{footer_script}
 jQuery('.load').click(function() {
   $("#loader_import").fadeIn();
 });
-{/literal}{/footer_script}
+{/footer_script}
 
-<h3>{'%d albums'|@translate|@sprintf:$total_albums}</h3>
+<h3>{'%d albums'|translate:$total_albums}</h3>
 <ul id="albumsList">
 {foreach from=$albums item=album}
   <li>
-    <b><a href="{$album.U_LIST}" class="load">{$album.title}</a></b> <i>{'(%d photos)'|@translate|@sprintf:$album.photos}</i> 
-    {if $album.description}- {$album.description|@truncate:100}{/if}
+    <b><a href="{$album.U_LIST}" class="load">{$album.title}</a></b> <i>{'(%d photos)'|translate:$album.photos}</i> 
+    {if $album.description}- {$album.description|truncate:100}{/if}
   </li>
 {/foreach}
 </ul>
-<span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|@translate}</i></span>
+<span id="loader_import" style="display:none;"><img src="admin/themes/default/images/ajax-loader.gif"> <i>{'Processing...'|translate}</i></span>
 
 {* <!-- PHOTOS LIST --> *}
-{elseif $ACTION == 'list_photos'}
+{else if $ACTION == 'list_photos'}
 {include file=$PICASA_WA_ABS_PATH|@cat:'admin/template/import.list_photos.tpl'}
 
 {* <!-- IMPORT ALL --> *}
-{elseif $ACTION == 'list_all'}
+{else if $ACTION == 'list_all'}
 {include file=$PICASA_WA_ABS_PATH|@cat:'admin/template/import.list_all.tpl'}
 
Index: /extensions/Google2Piwigo/include/functions.inc.php
===================================================================
--- /extensions/Google2Piwigo/include/functions.inc.php	(revision 26197)
+++ /extensions/Google2Piwigo/include/functions.inc.php	(revision 26198)
@@ -1,4 +1,4 @@
 <?php
-if (!defined('PICASA_WA_PATH')) die('Hacking attempt!');
+defined('PICASA_WA_PATH') or die('Hacking attempt!');
 
 /**
@@ -116,4 +116,2 @@
   return false;
 }
-
-?>
Index: /extensions/Google2Piwigo/include/ws_functions.inc.php
===================================================================
--- /extensions/Google2Piwigo/include/ws_functions.inc.php	(revision 26197)
+++ /extensions/Google2Piwigo/include/ws_functions.inc.php	(revision 26198)
@@ -1,4 +1,4 @@
 <?php
-if (!defined('PICASA_WA_PATH')) die('Hacking attempt!');
+defined('PICASA_WA_PATH') or die('Hacking attempt!');
 
 function picasa_wa_add_ws_method($arr)
@@ -15,5 +15,7 @@
       'fills' => array('default' => 'fill_name,fill_author,fill_tags,fill_date,fill_description'),
       ),
-    'Used by Picasa Web Albums'
+    'Used by Picasa Web Albums',
+    null,
+    array('hidden'=>true)
     );
 }
@@ -72,5 +74,5 @@
   $photo['path'] = PICASA_WA_CACHE . 'picasa-'.$photo['id'].'.'.get_extension($photo['url']);
   
-  if ($photoEntry->getGeoRssWhere() !== null && !empty($pwg_loaded_plugins['rv_gmaps']))
+  if ($photoEntry->getGeoRssWhere() !== null)
   {
     $photo['latlon'] = $photoEntry->getGeoRssWhere()->getPoint()->getPos()->getText();
@@ -136,11 +138,11 @@
     if (in_array('fill_author', $params['fills']))      $updates['author'] = pwg_db_real_escape_string($photo['author']);
     if (in_array('fill_description', $params['fills'])) $updates['comment'] = pwg_db_real_escape_string($photo['description']);
-    if (in_array('fill_geotag', $params['fills']) and !empty($photo['latlon']) )
+    if (in_array('fill_geotag', $params['fills']) and !empty($photo['latlon']))
     {
       $latlon = explode(' ', $photo['latlon']);
       if (count($latlon) == 2)
       {
-        $updates['lat'] = pwg_db_real_escape_string($latlon[0]);
-        $updates['lon'] = pwg_db_real_escape_string($latlon[1]);
+        $updates['latitude'] = pwg_db_real_escape_string($latlon[0]);
+        $updates['longitude'] = pwg_db_real_escape_string($latlon[1]);
       }
     }
@@ -155,5 +157,5 @@
     }
     
-    if ( !empty($photo['tags']) and in_array('fill_tags', $params['fills']) )
+    if (!empty($photo['tags']) and in_array('fill_tags', $params['fills']))
     {
       set_tags(get_tag_ids($photo['tags']), $photo['image_id']);
@@ -161,6 +163,4 @@
   }
   
-  return sprintf(l10n('Photo "%s" imported'), $photo['title']);
+  return l10n('Photo "%s" imported', $photo['title']);
 }
-
-?>
Index: /extensions/Google2Piwigo/main.inc.php
===================================================================
--- /extensions/Google2Piwigo/main.inc.php	(revision 26197)
+++ /extensions/Google2Piwigo/main.inc.php	(revision 26198)
@@ -9,25 +9,31 @@
 */
 
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
 
 global $conf;
 
-define('PICASA_WA_PATH',  PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
-define('PICASA_WA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . basename(dirname(__FILE__)));
+define('PICASA_WA_ID',    basename(dirname(__FILE__)));
+define('PICASA_WA_PATH',  PHPWG_PLUGINS_PATH . PICASA_WA_ID . '/');
+define('PICASA_WA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . PICASA_WA_ID);
 define('PICASA_WA_CACHE', PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/');
+
+
+include_once(PICASA_WA_PATH . 'include/ws_functions.inc.php');
+
+add_event_handler('ws_add_methods', 'picasa_wa_add_ws_method');
 
 if (defined('IN_ADMIN'))
 {
   add_event_handler('get_admin_plugin_menu_links', 'picasa_wa_admin_menu');
+
   add_event_handler('get_batch_manager_prefilters', 'picasa_wa_add_batch_manager_prefilters');
   add_event_handler('perform_batch_manager_prefilters', 'picasa_wa_perform_batch_manager_prefilters', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
-  add_event_handler('loc_begin_admin_page', 'picasa_wa_prefilter_from_url');
 
   function picasa_wa_admin_menu($menu) 
   {
-    array_push($menu, array(
+    $menu[] = array(
       'NAME' => 'Google2Piwigo',
       'URL' => PICASA_WA_ADMIN,
-    ));
+      );
     return $menu;
   }
@@ -35,8 +41,8 @@
   function picasa_wa_add_batch_manager_prefilters($prefilters)
   {
-    array_push($prefilters, array(
+    $prefilters[] = array(
       'ID' => 'picasa',
       'NAME' => l10n('Imported from Google/Picasa'),
-    ));
+      );
     return $prefilters;
   }
@@ -51,25 +57,8 @@
     WHERE file LIKE "picasa-%"
   ;';
-      $filter_sets[] = array_from_query($query, 'id');
+      $filter_sets[] = query2array($query, null, 'id');
     }
     
     return $filter_sets;
   }
-  
-  function picasa_wa_prefilter_from_url()
-  {
-    global $page;
-    if ($page['page'] == 'batch_manager' && @$_GET['prefilter'] == 'picasa')
-    {
-      $_SESSION['bulk_manager_filter'] = array('prefilter' => 'picasa');
-      unset($_GET['prefilter']);
-    }
-  }
 }
-
-
-include_once(PICASA_WA_PATH . 'include/ws_functions.inc.php');
-
-add_event_handler('ws_add_methods', 'picasa_wa_add_ws_method');
-
-?>
Index: tensions/Google2Piwigo/maintain.inc.php
===================================================================
--- /extensions/Google2Piwigo/maintain.inc.php	(revision 26197)
+++ 	(revision )
@@ -1,58 +1,0 @@
-<?php
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-
-function plugin_install() 
-{
-  global $conf;
-  
-  mkgetdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/', MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
-}
-
-function plugin_activate()
-{
-  global $conf;
-  
-  if (!file_exists(PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/'))
-  {
-    mkgetdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/', MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR);
-  }
-}
-
-function plugin_uninstall() 
-{
-  global $conf;
-  
-  rrmdir(PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/');
-}
-
-function rrmdir($dir)
-{
-  if (!is_dir($dir))
-  {
-    return false;
-  }
-  $dir = rtrim($dir, '/');
-  $objects = scandir($dir);
-  $return = true;
-  
-  foreach ($objects as $object)
-  {
-    if ($object !== '.' && $object !== '..')
-    {
-      $path = $dir.'/'.$object;
-      if (filetype($path) == 'dir') 
-      {
-        $return = $return && rrmdir($path); 
-      }
-      else 
-      {
-        $return = $return && @unlink($path);
-      }
-    }
-  }
-  
-  return $return && @rmdir($dir);
-} 
-
-?>
