Index: /extensions/AMetaData/admin.php
===================================================================
--- /extensions/AMetaData/admin.php	(revision 15343)
+++ /extensions/AMetaData/admin.php	(revision 15343)
@@ -0,0 +1,81 @@
+<?php
+/*
+ * -----------------------------------------------------------------------------
+ * Plugin Name: Advanced MetaData
+ * -----------------------------------------------------------------------------
+ * Author     : Grum
+ *   email    : grum@piwigo.org
+ *   website  : http://photos.grum.fr
+ *   PWG user : http://forum.piwigo.org/profile.php?id=3706
+ *
+ *   << May the Little SpaceFrog be with you ! >>
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * See main.inc.php for release information
+ *
+ * -----------------------------------------------------------------------------
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+global $prefixeTable, $template;
+
+load_language('plugin.lang', AMD_PATH);
+
+$main_plugin_object = get_plugin_data($plugin_id);
+
+
+
+
+
+if(CommonPlugin::checkGPCRelease(3,2,0))
+{
+  $config=Array();
+  GPCCore::loadConfig('amd', $config);
+
+
+  if(!isset($config['installed'])) $config['installed']='00.04.00';
+  if($config['installed']!=AMD_VERSION2)
+  {
+    /* the plugin was updated without being deactivated
+     * deactivate + activate the plugin to process the database upgrade
+     */
+    include(AMD_PATH."amd_install.class.inc.php");
+    $amd=new AMD_install($prefixeTable, dirname(__FILE__));
+    $amd->deactivate();
+    $amd->activate();
+    $template->delete_compiled_templates();
+    $config['newInstall']='n';
+  }
+
+  /*
+   * if the plugin is newly installed, display a special configuration page
+   * otherwise, display normal page
+   */
+  if($config['newInstall']=='n')
+  {
+    include(AMD_PATH."amd_aip.class.inc.php");
+    $plugin_ai = new AMD_AIP($prefixeTable, $main_plugin_object->getFileLocation());}
+  else
+  {
+    include(AMD_PATH."amd_aip_install.class.inc.php");
+    $plugin_ai = new AMD_AIPInstall($prefixeTable, $main_plugin_object->getFileLocation());
+  }
+}
+else
+{
+  /*
+   * plugin was upgraded, but GPC was not
+   * display a page to inform user to upgrade GPC
+   */
+  include(AMD_PATH."amd_aip_release.class.inc.php");
+  $plugin_ai = new AMD_AIPRelease($prefixeTable, $main_plugin_object->getFileLocation());
+}
+
+$plugin_ai->manage();
+
+
+
+
+?>
Index: /extensions/AMetaData/admin/amd_metadata.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata.tpl	(revision 15342)
+++ /extensions/AMetaData/admin/amd_metadata.tpl	(revision 15343)
@@ -1,5 +1,8 @@
-{combine_script id="jquery.ui" path="themes/default/js/ui/minified/jquery.ui.core.min.js"}
-{combine_script id="jquery.ui.sortable" path="themes/default/js/ui/minified/jquery.ui.sortable.min.js"}
-{combine_script id="jquery.ui.dialog" src="themes/default/js/ui/minified/jquery.ui.dialog.min.js"}
+{combine_script id="jquery.ui" require='jquery' path="themes/default/js/ui/jquery.ui.core.js"}
+{combine_script id="jquery.ui.widget" require='jquery.ui' path="themes/default/js/ui/jquery.ui.widget.js"}
+{combine_script id="jquery.ui.mouse" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.mouse.js"}
+{combine_script id="jquery.ui.position" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.position.js"}
+{combine_script id="jquery.ui.sortable" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.sortable.js"}
+{combine_script id="jquery.ui.dialog" require='jquery.ui.widget' src="themes/default/js/ui/jquery.ui.dialog.js"}
 
 {$statTabsheet}
Index: /extensions/AMetaData/admin/amd_metadata_database.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_database.tpl	(revision 15342)
+++ /extensions/AMetaData/admin/amd_metadata_database.tpl	(revision 15343)
@@ -1,4 +1,6 @@
+{*
 {combine_script id="jquery.ui" path="themes/default/js/ui/minified/jquery.ui.core.min.js"}
 {combine_script id="jquery.ui.dialog" path="themes/default/js/ui/minified/jquery.ui.dialog.min.js"}
+*}
 
 {literal}
Index: /extensions/AMetaData/admin/amd_metadata_database_database.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_database_database.tpl	(revision 15342)
+++ /extensions/AMetaData/admin/amd_metadata_database_database.tpl	(revision 15343)
@@ -1,4 +1,2 @@
-{combine_script id="jquery.ui" path=$ROOT_URL|@cat:"themes/default/js/ui/minified/jquery.ui.core.min.js"}
-{combine_script id="jquery.ui.dialog" path=$ROOT_URL|@cat:"themes/default/js/ui/minified/jquery.ui.dialog.min.js"}
 
 {literal}
@@ -103,5 +101,5 @@
         resizable: false,
         width:480,
-        height:120,
+        height:150,
         modal: true,
         draggable:true,
@@ -194,5 +192,5 @@
           resizable: false,
           width:480,
-          height:120,
+          height:150,
           modal: true,
           draggable:true,
Index: /extensions/AMetaData/admin/amd_metadata_personnal.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_personnal.tpl	(revision 15342)
+++ /extensions/AMetaData/admin/amd_metadata_personnal.tpl	(revision 15343)
@@ -1,12 +1,17 @@
-{combine_script id="jquery.ui" path="themes/default/js/ui/minified/jquery.ui.core.min.js"}
-{combine_script id="jquery.ui.dialog" path="themes/default/js/ui/minified/jquery.ui.dialog.min.js"}
+{combine_script id="jquery.ui" require='jquery' path="themes/default/js/ui/jquery.ui.core.js"}
+{combine_script id="jquery.ui.widget" require='jquery.ui' path="themes/default/js/ui/jquery.ui.widget.js"}
+{combine_script id="jquery.ui.mouse" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.mouse.js"}
+{combine_script id="jquery.ui.position" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.position.js"}
+{combine_script id="jquery.ui.sortable" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.sortable.js"}
+{combine_script id="jquery.ui.dialog" require='jquery.ui.widget' src="themes/default/js/ui/jquery.ui.dialog.js"}
 
 {combine_script id="gpc.external.interface" path="plugins/GrumPluginClasses/js/external/interface/interface.js" require="jquery.ui"}
 {combine_script id="gpc.external.inestedsortable" path="plugins/GrumPluginClasses/js/external/inestedsortable.pack.js" require="gpc.external.interface"}
-{combine_script id="tagListSelector" path="plugins/AMetaData/js/tagListSelector.js" require="jquery"}
+{combine_script id="tagListSelector" path="plugins/AMetaData/js/tagListSelector.js" require="jquery.ui"}
 
 
 {literal}
 <script type="text/javascript">
+  var udm, tls;
 
 
@@ -598,4 +603,14 @@
 
 
+
+  $(window).loaded(
+    function ()
+    {
+      udm=new userDefManage();
+      tls=new tagListSelector({itemId:'iTagList'});
+    }
+  );
+
+
 </script>
 {/literal}
@@ -742,9 +757,2 @@
   {/foreach}
 </ul>
-
-{literal}
-<script type="text/javascript">
-  var udm=new userDefManage();
-  var tls=new tagListSelector({itemId:'iTagList'});
-</script>
-{/literal}
Index: tensions/AMetaData/admin/plugin_admin.php
===================================================================
--- /extensions/AMetaData/admin/plugin_admin.php	(revision 15342)
+++ 	(revision )
@@ -1,81 +1,0 @@
-<?php
-/*
- * -----------------------------------------------------------------------------
- * Plugin Name: Advanced MetaData
- * -----------------------------------------------------------------------------
- * Author     : Grum
- *   email    : grum@piwigo.org
- *   website  : http://photos.grum.fr
- *   PWG user : http://forum.piwigo.org/profile.php?id=3706
- *
- *   << May the Little SpaceFrog be with you ! >>
- *
- * -----------------------------------------------------------------------------
- *
- * See main.inc.php for release information
- *
- * -----------------------------------------------------------------------------
-*/
-
-if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
-
-global $prefixeTable, $template;
-
-load_language('plugin.lang', AMD_PATH);
-
-$main_plugin_object = get_plugin_data($plugin_id);
-
-
-
-
-
-if(CommonPlugin::checkGPCRelease(3,2,0))
-{
-  $config=Array();
-  GPCCore::loadConfig('amd', $config);
-
-
-  if(!isset($config['installed'])) $config['installed']='00.04.00';
-  if($config['installed']!=AMD_VERSION2)
-  {
-    /* the plugin was updated without being deactivated
-     * deactivate + activate the plugin to process the database upgrade
-     */
-    include(AMD_PATH."amd_install.class.inc.php");
-    $amd=new AMD_install($prefixeTable, dirname(__FILE__));
-    $amd->deactivate();
-    $amd->activate();
-    $template->delete_compiled_templates();
-    $config['newInstall']='n';
-  }
-
-  /*
-   * if the plugin is newly installed, display a special configuration page
-   * otherwise, display normal page
-   */
-  if($config['newInstall']=='n')
-  {
-    include(AMD_PATH."amd_aip.class.inc.php");
-    $plugin_ai = new AMD_AIP($prefixeTable, $main_plugin_object->getFileLocation());}
-  else
-  {
-    include(AMD_PATH."amd_aip_install.class.inc.php");
-    $plugin_ai = new AMD_AIPInstall($prefixeTable, $main_plugin_object->getFileLocation());
-  }
-}
-else
-{
-  /*
-   * plugin was upgraded, but GPC was not
-   * display a page to inform user to upgrade GPC
-   */
-  include(AMD_PATH."amd_aip_release.class.inc.php");
-  $plugin_ai = new AMD_AIPRelease($prefixeTable, $main_plugin_object->getFileLocation());
-}
-
-$plugin_ai->manage();
-
-
-
-
-?>
Index: /extensions/AMetaData/amd_aip.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_aip.class.inc.php	(revision 15342)
+++ /extensions/AMetaData/amd_aip.class.inc.php	(revision 15343)
@@ -53,8 +53,8 @@
       $this->tabsheet->add('metadata',
                             l10n('g003_metadata'),
-                            $this->getAdminLink().'&amp;fAMD_tabsheet=metadata');
+                            $this->getAdminLink().'-metadata');
       $this->tabsheet->add('help',
                             l10n('g003_help'),
-                            $this->getAdminLink().'&amp;fAMD_tabsheet=help');
+                            $this->getAdminLink().'-help');
     }
     else
@@ -62,17 +62,17 @@
       $this->tabsheet->add('database',
                             l10n('g003_database'),
-                            $this->getAdminLink().'&amp;fAMD_tabsheet=database');
+                            $this->getAdminLink().'-database');
       $this->tabsheet->add('metadata',
                             l10n('g003_metadata'),
-                            $this->getAdminLink().'&amp;fAMD_tabsheet=metadata');
+                            $this->getAdminLink().'-metadata');
       $this->tabsheet->add('search',
                             l10n('g003_search'),
-                            $this->getAdminLink().'&amp;fAMD_tabsheet=search');
+                            $this->getAdminLink().'-search');
       $this->tabsheet->add('tags',
                             l10n('g003_tags'),
-                            $this->getAdminLink().'&amp;fAMD_tabsheet=tags');
+                            $this->getAdminLink().'-tags');
       $this->tabsheet->add('help',
                             l10n('g003_help'),
-                            $this->getAdminLink().'&amp;fAMD_tabsheet=help');
+                            $this->getAdminLink().'-help');
     }
   }
@@ -104,5 +104,5 @@
     $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/amd_admin.tpl");
 
-    $this->tabsheet->select($_REQUEST['fAMD_tabsheet']);
+    $this->tabsheet->select($_GET['tab']);
     $this->tabsheet->assign();
     $selected_tab=$this->tabsheet->get_selected();
@@ -111,5 +111,5 @@
     $pluginInfo=array(
       'AMD_VERSION' => "<i>".$this->getPluginName()."</i> ".l10n('g003_version').AMD_VERSION,
-      'AMD_PAGE' => $_REQUEST['fAMD_tabsheet'],
+      'AMD_PAGE' => $_GET['tab'],
       'PATH' => AMD_PATH
     );
@@ -117,5 +117,5 @@
     $template->assign('plugin', $pluginInfo);
 
-    switch($_REQUEST['fAMD_tabsheet'])
+    switch($_GET['tab'])
     {
       case 'help':
@@ -123,11 +123,11 @@
         break;
       case 'database':
-        $this->displayDatabase($_REQUEST['fAMD_page']);
+        $this->displayDatabase($_REQUEST['t']);
         break;
       case 'metadata':
-        $this->displayMetaData($_REQUEST['fAMD_page']);
+        $this->displayMetaData($_REQUEST['t']);
         break;
       case 'search':
-        $this->displaySearch($_REQUEST['fAMD_page']);
+        $this->displaySearch($_REQUEST['t']);
         break;
       case 'tags':
@@ -146,5 +146,5 @@
   public function initEvents()
   {
-    if(isset($_REQUEST['fAMD_tabsheet']) and $_REQUEST['fAMD_tabsheet']=='search')
+    if(isset($_GET['tab']) and $_GET['tab']=='search')
     {
       // load request builder JS only on the search page
@@ -172,33 +172,38 @@
     //initialise $REQUEST values if not defined
 
-    if(!isset($_REQUEST['fAMD_tabsheet']))
+    if(!isset($_GET['tab']))
     {
       if($this->getNumOfPictures()==0 and $this->config['amd_InterfaceMode']=='advanced')
       {
-        $_REQUEST['fAMD_tabsheet']="database";
-        $_REQUEST['fAMD_page']="state";
+        $_GET['tab']="database";
+        $_REQUEST['t']="state";
       }
       else
       {
-        $_REQUEST['fAMD_tabsheet']="metadata";
-        $_REQUEST['fAMD_page']="select";
-      }
-    }
-
-    if(!($_REQUEST['fAMD_tabsheet']=="metadata" or
-         $_REQUEST['fAMD_tabsheet']=="help" or
-         $_REQUEST['fAMD_tabsheet']=="database" or
-         $_REQUEST['fAMD_tabsheet']=="search" or
-         $_REQUEST['fAMD_tabsheet']=="tags")
+        $_GET['tab']="metadata";
+        $_REQUEST['t']="select";
+      }
+    }
+
+    $tmp=explode('/', $_GET['tab'].'/');
+    $_GET['tab']=$tmp[0];
+    $_REQUEST['t']=$tmp[1];
+
+
+    if(!($_GET['tab']=="metadata" or
+         $_GET['tab']=="help" or
+         $_GET['tab']=="database" or
+         $_GET['tab']=="search" or
+         $_GET['tab']=="tags")
          or
          $this->config['amd_InterfaceMode']=='basic' and
          (
-           $_REQUEST['fAMD_tabsheet']=="database" or
-           $_REQUEST['fAMD_tabsheet']=="search" or
-           $_REQUEST['fAMD_tabsheet']=="tags"
+           $_GET['tab']=="database" or
+           $_GET['tab']=="search" or
+           $_GET['tab']=="tags"
          )
       )
     {
-      $_REQUEST['fAMD_tabsheet']="metadata";
+      $_GET['tab']="metadata";
     }
 
@@ -206,25 +211,25 @@
      * metadata tabsheet
      */
-    if($_REQUEST['fAMD_tabsheet']=="metadata")
-    {
-      if(!isset($_REQUEST['fAMD_page']))
+    if($_GET['tab']=="metadata")
+    {
+      if(!isset($_REQUEST['t']))
       {
         if($this->config['amd_InterfaceMode']=='basic')
         {
-          $_REQUEST['fAMD_page']="display";
+          $_REQUEST['t']="display";
         }
         else
         {
-          $_REQUEST['fAMD_page']="select";
-        }
-      }
-
-      if(!($_REQUEST['fAMD_page']=="personnal" or
-           $_REQUEST['fAMD_page']=="select" or
-           $_REQUEST['fAMD_page']=="display")
+          $_REQUEST['t']="select";
+        }
+      }
+
+      if(!($_REQUEST['t']=="personnal" or
+           $_REQUEST['t']=="select" or
+           $_REQUEST['t']=="display")
            or
            $this->config['amd_InterfaceMode']=='basic' and
            (
-             $_REQUEST['fAMD_page']=="select"
+             $_REQUEST['t']=="select"
            )
         )
@@ -232,9 +237,9 @@
         if($this->config['amd_InterfaceMode']=='basic')
         {
-          $_REQUEST['fAMD_page']="display";
+          $_REQUEST['t']="display";
         }
         else
         {
-          $_REQUEST['fAMD_page']="select";
+          $_REQUEST['t']="select";
         }
       }
@@ -244,12 +249,12 @@
      * help tabsheet
      */
-    if($_REQUEST['fAMD_tabsheet']=="help")
-    {
-      if(!isset($_REQUEST['fAMD_page'])) $_REQUEST['fAMD_page']="exif";
-
-      if(!($_REQUEST['fAMD_page']=="exif" or
-           $_REQUEST['fAMD_page']=="iptc" or
-           $_REQUEST['fAMD_page']=="xmp" or
-           $_REQUEST['fAMD_page']=="magic")) $_REQUEST['fAMD_page']="exif";
+    if($_GET['tab']=="help")
+    {
+      if(!isset($_REQUEST['t'])) $_REQUEST['t']="exif";
+
+      if(!($_REQUEST['t']=="exif" or
+           $_REQUEST['t']=="iptc" or
+           $_REQUEST['t']=="xmp" or
+           $_REQUEST['t']=="magic")) $_REQUEST['t']="exif";
     }
 
@@ -257,10 +262,10 @@
      * search tabsheet
      */
-    if($_REQUEST['fAMD_tabsheet']=="search")
-    {
-      if(!isset($_REQUEST['fAMD_page'])) $_REQUEST['fAMD_page']="search";
-
-      if(!($_REQUEST['fAMD_page']=="config" or
-           $_REQUEST['fAMD_page']=="search")) $_REQUEST['fAMD_page']="search";
+    if($_GET['tab']=="search")
+    {
+      if(!isset($_REQUEST['t'])) $_REQUEST['t']="search";
+
+      if(!($_REQUEST['t']=="config" or
+           $_REQUEST['t']=="search")) $_REQUEST['t']="search";
     }
 
@@ -268,10 +273,10 @@
      * database tabsheet
      */
-    if($_REQUEST['fAMD_tabsheet']=="database")
-    {
-      if(!isset($_REQUEST['fAMD_page'])) $_REQUEST['fAMD_page']="state";
-
-      if(!($_REQUEST['fAMD_page']=="state" or
-           $_REQUEST['fAMD_page']=="update")) $_REQUEST['fAMD_page']="state";
+    if($_GET['tab']=="database")
+    {
+      if(!isset($_REQUEST['t'])) $_REQUEST['t']="state";
+
+      if(!($_REQUEST['t']=="state" or
+           $_REQUEST['t']=="update")) $_REQUEST['t']="state";
     }
 
@@ -335,14 +340,14 @@
     $statTabsheet->add('personnal',
                           l10n('g003_personnal'),
-                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=personnal');
+                          $this->getAdminLink().'-metadata/personnal');
     if($this->config['amd_InterfaceMode']=='advanced')
     {
       $statTabsheet->add('select',
                             l10n('g003_select'),
-                            $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=select');
+                            $this->getAdminLink().'-metadata/select');
     }
     $statTabsheet->add('display',
                           l10n('g003_display'),
-                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=display');
+                          $this->getAdminLink().'-metadata/display');
     $statTabsheet->assign();
 
@@ -526,8 +531,8 @@
     $statTabsheet->add('state',
                           l10n('g003_state'),
-                          $this->getAdminLink().'&amp;fAMD_tabsheet=database&amp;fAMD_page=state');
+                          $this->getAdminLink().'-database/state');
     $statTabsheet->add('update',
                           l10n('g003_update'),
-                          $this->getAdminLink().'&amp;fAMD_tabsheet=database&amp;fAMD_page=update');
+                          $this->getAdminLink().'-database/update');
     $statTabsheet->assign();
 
Index: /extensions/AMetaData/amd_aip_install.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_aip_install.class.inc.php	(revision 15342)
+++ /extensions/AMetaData/amd_aip_install.class.inc.php	(revision 15343)
@@ -41,5 +41,5 @@
     $this->tabsheet->add('install',
                           l10n('g003_install'),
-                          $this->getAdminLink()."&amp;f_tabsheet=install");
+                          $this->getAdminLink()."-install");
   }
 
@@ -71,5 +71,5 @@
     $template->set_filename('plugin_admin_content', dirname($this->getFileLocation())."/admin/amd_admin.tpl");
 
-    $this->tabsheet->select($_REQUEST['f_tabsheet']);
+    $this->tabsheet->select($_GET['tab']);
     $this->tabsheet->assign();
     $selected_tab=$this->tabsheet->get_selected();
@@ -80,5 +80,5 @@
     $pluginInfo=array(
       'AMD_VERSION' => "<i>".$this->getPluginName()."</i> ".l10n('g003_version').AMD_VERSION,
-      'AMD_PAGE' => $_REQUEST['f_tabsheet'],
+      'AMD_PAGE' => $_GET['tab'],
       'PATH' => AMD_PATH
     );
@@ -97,5 +97,5 @@
   protected function checkRequest()
   {
-    $_REQUEST['f_tabsheet']='install';
+    $_GET['tab']='install';
 
     if(!isset($_REQUEST['ajaxfct'])) return(false);
@@ -336,5 +336,5 @@
      * select 25 pictures into the caddie
      */
-    $sql="SELECT ti.id, ti.path, ti.has_high
+    $sql="SELECT ti.id, ti.path
           FROM ".CADDIE_TABLE." tc
             LEFT JOIN ".IMAGES_TABLE." ti ON ti.id = tc.element_id
@@ -365,5 +365,5 @@
         $excludeList="";
       }
-      $sql="SELECT ti.id, ti.path, ti.has_high
+      $sql="SELECT ti.id, ti.path
             FROM ".IMAGES_TABLE." ti ".$excludeList."
             ORDER BY RAND() LIMIT ".(25-count($listToAnalyze[0])).";";
@@ -388,12 +388,5 @@
       foreach($listToAnalyze[0] as $val)
       {
-        if($val['has_high']==='true' and $this->config['amd_UseMetaFromHD']=='y')
-        {
-          $this->analyzeImageFile($path."/".dirname($val['path'])."/pwg_high/".basename($val['path']), $val['id']);
-        }
-        else
-        {
-          $this->analyzeImageFile($path."/".$val['path'], $val['id']);
-        }
+        $this->analyzeImageFile($path."/".$val['path'], $val['id']);
       }
       $this->makeStatsConsolidation();
Index: /extensions/AMetaData/amd_ajax.php
===================================================================
--- /extensions/AMetaData/amd_ajax.php	(revision 15342)
+++ /extensions/AMetaData/amd_ajax.php	(revision 15343)
@@ -455,5 +455,5 @@
       {
         // get a randomly picture...
-        $sql="SELECT pai.imageId, pi.path, pi.has_high
+        $sql="SELECT pai.imageId, pi.path
               FROM ".$this->tables['images']." pai
                 LEFT JOIN ".IMAGES_TABLE." pi ON pai.imageId=pi.id
@@ -475,12 +475,5 @@
         {
           $imageId=$row['imageId'];
-          if($row['has_high']==='true' and $this->config['amd_UseMetaFromHD']=='y')
-          {
-            $filename=$path."/".dirname($row['path'])."/pwg_high/".basename($row['path']);
-          }
-          else
-          {
-            $filename=$path."/".$row['path'];
-          }
+          $filename=$path."/".$row['path'];
         }
 
@@ -609,5 +602,5 @@
         $path=dirname(dirname(dirname(__FILE__)));
 
-        $sql="SELECT id, path, has_high FROM ".IMAGES_TABLE." WHERE id IN (".implode(", ", $list).")";
+        $sql="SELECT id, path FROM ".IMAGES_TABLE." WHERE id IN (".implode(", ", $list).")";
         $result=pwg_query($sql);
         if($result)
@@ -627,12 +620,5 @@
             //$mem1=memory_get_usage();
             //echo "memory before analyze:".$mem1."\n";
-            if($row['has_high']==='true' and $this->config['amd_UseMetaFromHD']=='y')
-            {
-              $returned.=$this->analyzeImageFile($path."/".dirname($row['path'])."/pwg_high/".basename($row['path']), $row['id']);
-            }
-            else
-            {
-              $returned.=$this->analyzeImageFile($path."/".$row['path'], $row['id']);
-            }
+            $returned.=$this->analyzeImageFile($path."/".$row['path'], $row['id']);
             //echo $returned."\n";
             //$mem2=memory_get_usage();
Index: /extensions/AMetaData/amd_pip.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_pip.class.inc.php	(revision 15342)
+++ /extensions/AMetaData/amd_pip.class.inc.php	(revision 15343)
@@ -67,5 +67,5 @@
     $this->pictureProperties['id']=$page['image_id'];
 
-    $sql="SELECT ti.path, tai.analyzed, ti.has_high FROM ".IMAGES_TABLE." ti
+    $sql="SELECT ti.path, tai.analyzed FROM ".IMAGES_TABLE." ti
             LEFT JOIN ".$this->tables['images']." tai ON tai.imageId = ti.id
           WHERE ti.id=".$page['image_id'].";";
@@ -73,17 +73,10 @@
     if($result)
     {
-      $hasHigh='';
       while($row=pwg_db_fetch_assoc($result))
       {
         $filename=$row['path'];
-        $hasHigh=$row['has_high'];
         $this->pictureProperties['analyzed']=$row['analyzed'];
       }
       $filename=$path."/".$filename;
-
-      if($hasHigh==='true' and $this->config['amd_UseMetaFromHD']=='y')
-      {
-        $filename=dirname($filename)."/pwg_high/".basename($filename);
-      }
     }
 
@@ -220,13 +213,11 @@
       {
         $group=$tagProperties['gName'];
-        if(!is_null($md))
-        {
-          $metadata[]=$md;
-          unset($md);
-        }
-        $md=Array(
-          'TITLE' => $tagProperties['gName'],
-          'lines' => Array()
-        );
+        if(!isset($metadata[$group]))
+        {
+          $metadata[$group]=Array(
+                              'TITLE' => $tagProperties['gName'],
+                              'lines' => Array()
+                            );
+        }
       }
 
@@ -249,16 +240,11 @@
         if($value!="")
         {
-          $md['lines'][L10n::get($picturesTags[$key]->getName())]=AMD_root::prepareValueForDisplay($value, $picturesTags[$key]->isTranslatable());
+          $metadata[$group]['lines'][L10n::get($picturesTags[$key]->getName())]=AMD_root::prepareValueForDisplay($value, $picturesTags[$key]->isTranslatable());
         }
       }
       elseif($userDefined and isset($userDefinedValues[$tagProperties['numId']]) and $userDefinedValues[$tagProperties['numId']]!='')
       {
-        $md['lines'][$tagProperties['name']]=$userDefinedValues[$tagProperties['numId']];
-      }
-    }
-
-    if(!is_null($md) and count($md['lines'])>0)
-    {
-      $metadata[]=$md;
+        $metadata[$group]['lines'][$tagProperties['name']]=$userDefinedValues[$tagProperties['numId']];
+      }
     }
 
Index: /extensions/AMetaData/amd_root.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_root.class.inc.php	(revision 15342)
+++ /extensions/AMetaData/amd_root.class.inc.php	(revision 15343)
@@ -86,5 +86,4 @@
       'amd_FillDataBaseContinuously' => "y",
       'amd_FillDataBaseIgnoreSchemas' => array(),
-      'amd_UseMetaFromHD' => "y",
       'amd_InterfaceMode' => "advanced",    // 'advanced' or 'basic'
 
@@ -182,5 +181,5 @@
   public function doRandomAnalyze()
   {
-    $sql="SELECT tai.imageId, ti.path, ti.has_high FROM ".$this->tables['images']." tai
+    $sql="SELECT tai.imageId, ti.path FROM ".$this->tables['images']." tai
             LEFT JOIN ".IMAGES_TABLE." ti ON tai.imageId = ti.id
           WHERE tai.analyzed = 'n'
@@ -194,12 +193,5 @@
       while($row=pwg_db_fetch_assoc($result))
       {
-        if($row['has_high']==='true' and $this->config['amd_UseMetaFromHD']=='y')
-        {
-          $this->analyzeImageFile($path."/".dirname($row['path'])."/pwg_high/".basename($row['path']), $row['imageId']);
-        }
-        else
-        {
-          $this->analyzeImageFile($path."/".$row['path'], $row['imageId']);
-        }
+        $this->analyzeImageFile($path."/".$row['path'], $row['imageId']);
       }
 
Index: /extensions/AMetaData/amd_version.inc.php
===================================================================
--- /extensions/AMetaData/amd_version.inc.php	(revision 15342)
+++ /extensions/AMetaData/amd_version.inc.php	(revision 15343)
@@ -17,6 +17,6 @@
   if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-  define('AMD_VERSION',  '0.6.1');
-  define('AMD_VERSION2', '00.06.01');
+  define('AMD_VERSION',  '0.7.0');
+  define('AMD_VERSION2', '00.07.00');
   define('AMD_GPC_NEEDED', '3.5.2');
 ?>
Index: /extensions/AMetaData/main.inc.php
===================================================================
--- /extensions/AMetaData/main.inc.php	(revision 15342)
+++ /extensions/AMetaData/main.inc.php	(revision 15343)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Advanced MetaData
-Version: 0.6.0
+Version: 0.7.0
 Description: An advanced metadata manager
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=364
@@ -224,4 +224,12 @@
 |         |            |   . metadata tab is hidden when a tab name is not
 |         |            |     specified for certain language
+|         |            |
+| 0.7.0   | 2012-05-25 | * mantis feature:2637
+|         |            |   . Compatibility with piwigo 2.4
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
 |         |            |
 |         |            |
Index: /extensions/AMetaData/templates/amd_dialog_metadata_choose.tpl
===================================================================
--- /extensions/AMetaData/templates/amd_dialog_metadata_choose.tpl	(revision 15342)
+++ /extensions/AMetaData/templates/amd_dialog_metadata_choose.tpl	(revision 15343)
@@ -1,5 +1,10 @@
-{combine_script id="jquery.ui" path="themes/default/js/ui/minified/jquery.ui.core.min.js"}
-{combine_script id="jquery.ui.dialog" path="themes/default/js/ui/minified/jquery.ui.dialog.min.js"}
-{combine_script id="tagListSelector" path="plugins/AMetaData/js/tagListSelector.js"}
+{combine_script id="jquery.ui" require='jquery' path="themes/default/js/ui/jquery.ui.core.js"}
+{combine_script id="jquery.ui.widget" require='jquery.ui' path="themes/default/js/ui/jquery.ui.widget.js"}
+{combine_script id="jquery.ui.mouse" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.mouse.js"}
+{combine_script id="jquery.ui.position" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.position.js"}
+{combine_script id="jquery.ui.sortable" require='jquery.ui.widget' path="themes/default/js/ui/jquery.ui.sortable.js"}
+{combine_script id="jquery.ui.dialog" require='jquery.ui.widget' src="themes/default/js/ui/jquery.ui.dialog.js"}
+
+{combine_script id="tagListSelector" path="plugins/AMetaData/js/tagListSelector.js" require="jquery.ui"}
 
 {literal}
