Index: /extensions/AMetaData/admin/amd_admin.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_admin.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_admin.tpl	(revision 5935)
@@ -1,7 +1,3 @@
-<div class="titrePage">
-  <h2 style="position:absolute;right:0px;top:32px;height:auto;font-size:12px;font-weight:normal;">:: {$plugin.AMD_VERSION} ::</h2>
-  <h2>{'amd_title_page'|@translate} <span style="font-size:-1;font-weight:normal;">{$TABSHEET_TITLE}</span></h2>
-
-</div>
+<h2 style="float:right;top:-24px;position:relative;height:auto;font-size:12px;font-weight:normal;">{$plugin.AMD_VERSION}</h2>
 
 {$AMD_BODY_PAGE}
Index: /extensions/AMetaData/admin/amd_metadata.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata.tpl	(revision 5935)
@@ -1,8 +1,9 @@
-{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
-{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
-{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.sortable.packed.js"}
-{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.dialog.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
+{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js"}
+{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"}
 
 {$statTabsheet}
-{$sheetContent}
+<div id="pageTabContent">
+  {$sheetContent}
+</div>
 
Index: /extensions/AMetaData/admin/amd_metadata_database.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_database.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata_database.tpl	(revision 5935)
@@ -1,24 +1,8 @@
-{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
-{known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.slider.packed.js"}
-{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.dialog.packed.js"}
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
+{known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.slider.packed.js"}
+{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"}
+
 
 {literal}
-<style>
- .ui-slider {
-    width:350px;
-    height:10px;
-    border:1px solid;
-    margin-left:10px;
-  }
- .ui-slider-handle {
-    width:12px;
-    height:12px;
-    position:relative;
-    top:-2px;
-    border:1px solid;
-    background:#cccccc;
-  }
-</style>
-
 <script type="text/javascript">
 
@@ -89,8 +73,10 @@
 
     doAnalyze="<br><form id='iDialogProgress' class='formtable'>"+
-      "<div id='iprogressbar_contener'>"+
-      "<span id='iprogressbar_bg' style='width:0%;'>&nbsp;</span>"+
-      "<span id='iprogressbar_fg'>0%</span>"+
-      "</div>{/literal}{'g003_analyze_in_progress'|@translate}{literal}</form>";
+      "<div id='iprogressbar_contener' class='gcBorderInput'>"+
+      "<span id='iprogressbar_bg' class='gcBgInput' style='width:0%;'>&nbsp;</span>"+
+      "<span id='iprogressbar_fg' class='gcLink'>0%</span>"+
+      "</div><p>{/literal}{'g003_analyze_in_progress'|@translate}{literal}"+
+      "<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>"
+      "</p></form>";
 
     $("#dialog")
@@ -102,11 +88,7 @@
         height:120,
         modal: true,
-        draggable:false,
+        draggable:true,
+        dialogClass: 'gcBgTabSheet gcBorder',
         title: '{/literal}{"g003_updating_metadata"|@translate}{literal}&nbsp;('+modeLabel+')',
-        overlay:
-        {
-          backgroundColor: '#000',
-          opacity: 0.5,
-        }
       }
     ).html(doAnalyze);
@@ -184,11 +166,8 @@
         height:120,
         modal: true,
-        draggable:false,
+        draggable:true,
+        dialogClass: 'gcBgTabSheet gcBorder',
         title: '{/literal}{"g003_updating_metadata"|@translate}{literal}',
-        overlay:
-        {
-          backgroundColor: '#000',
-          opacity: 0.5
-        },
+        dialogClass: 'gcBgTabSheet gcBorder',
         open: function(event, ui)
         {
@@ -205,5 +184,6 @@
         }
       }
-    ).html("<br>{/literal}{'g003_analyze_is_finished'|@translate}{literal}&nbsp;("+displayTime(timeElapsed/1000)+")");
+    )
+    .html("<br>{/literal}{'g003_analyze_is_finished'|@translate}{literal}&nbsp;("+displayTime(timeElapsed/1000)+")");
 
     getStatus();
Index: /extensions/AMetaData/admin/amd_metadata_display.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_display.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata_display.tpl	(revision 5935)
@@ -2,4 +2,12 @@
 
 {literal}
+<style>
+ .ui-widget-overlay {
+    background:#000000;
+    opacity:0.88;
+    filter:alpha(opacity:88);
+ }
+</style>
+
 <script type="text/javascript">
 
@@ -159,10 +167,6 @@
           modal: true,
           draggable:true,
+          dialogClass: 'gcBgTabSheet gcBorder',
           title: "{/literal}{'g003_deleting_a_group'|@translate}{literal}",
-          overlay:
-          {
-            backgroundColor: '#000',
-            opacity: 0.5
-          },
           buttons:
           {
@@ -222,10 +226,6 @@
         modal: true,
         draggable:true,
+        dialogClass: 'gcBgTabSheet gcBorder',
         title: dialogTitle,
-        overlay:
-        {
-          backgroundColor: '#000',
-          opacity: 0.5
-        },
         buttons:
         {
@@ -294,10 +294,6 @@
         modal: true,
         draggable:true,
+        dialogClass: 'gcBgTabSheet gcBorder',
         title: '{/literal}{"g003_add_delete_tags"|@translate}{literal}',
-        overlay:
-        {
-          backgroundColor: '#000',
-          opacity: 0.5
-        },
         open: function(event, ui)
         {
@@ -330,4 +326,5 @@
                 }
               ).responseText;
+
               $(this).dialog('destroy').html("").get(0).removeAttribute('style');
               loadGroupTags(groupId);
@@ -341,13 +338,18 @@
       }
     )
-    .html(
-      $.ajax(
-        {
-          type: "POST",
-          url: "{/literal}{$datas.urlRequest}{literal}",
-          async: false,
-          data: { ajaxfct:"groupGetTagList", id:groupId }
-        }
-      ).responseText
+    .html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
+
+    $.ajax(
+      {
+        type: "POST",
+        url: "{/literal}{$datas.urlRequest}{literal}",
+        async: true,
+        data: { ajaxfct:"groupGetTagList", id:groupId },
+        success:
+          function(msg)
+          {
+            $("#dialog").html(msg);
+          }
+      }
     );
   }
Index: /extensions/AMetaData/admin/amd_metadata_display_groupList.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_display_groupList.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata_display_groupList.tpl	(revision 5935)
@@ -1,4 +1,4 @@
 {foreach from=$datas.groups key=name item=data}
-  <li id="iGroupId{$data.id}" class="groupItems">
+  <li id="iGroupId{$data.id}" class="groupItems gcBgPage">
     <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}"/>
     <input type="hidden" id="iGroupName{$data.id}" value="{$data.name}">
Index: /extensions/AMetaData/admin/amd_metadata_display_groupListTagOrder.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_display_groupListTagOrder.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata_display_groupListTagOrder.tpl	(revision 5935)
@@ -1,4 +1,4 @@
 {foreach from=$datas key=name item=data}
-<li id="g{$group}t{$data.numId}">
+<li id="g{$group}t{$data.numId}" class="gcBgTabSheet">
   <table class="tagListOrderItem">
     <tr>
@@ -8,5 +8,5 @@
       <td style="width:35px;text-align:right;">{$data.nbItems}</td>
       <td style="width:50px;text-align:right;">{$data.pct}%</td>
-      <td style="width:104px;"><span class="pctBar" style="display:inline-block;width:{$data.pct}px;"></td>
+      <td style="width:104px;"><span class="pctBar{$themeconf.name}" style="display:inline-block;width:{$data.pct}px;"></td>
     </tr>
   </table>
Index: /extensions/AMetaData/admin/amd_metadata_display_groupListTagSelect.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_display_groupListTagSelect.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata_display_groupListTagSelect.tpl	(revision 5935)
@@ -9,5 +9,5 @@
 
 
-<table class="littlefont listTags" style="width:100%;">
+<table class="littlefont listTags {$themeconf.name}" style="width:100%;">
   {foreach from=$datas key=name item=data}
   <tr>
Index: /extensions/AMetaData/admin/amd_metadata_select.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_select.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata_select.tpl	(revision 5935)
@@ -1,3 +1,12 @@
 {literal}
+<style>
+ .ui-widget-overlay {
+    background:#000000;
+    opacity:0.88;
+    filter:alpha(opacity:88);
+ }
+</style>
+
+
 <script type="text/javascript">
 
@@ -16,11 +25,7 @@
         height:computedHeight,
         modal: true,
-        draggable:false,
+        draggable:true,
+        dialogClass: 'gcBgTabSheet gcBorder',
         title: '{/literal}{"g003_metadata_detail"|@translate}{literal}',
-        overlay:
-        {
-          backgroundColor: '#000',
-          opacity: 0.5
-        },
         open: function(event, ui)
         {
@@ -43,5 +48,4 @@
   function loadTagList()
   {
-    $("body").css("cursor", "wait");
     order=$('#iSelectOrderTagList').val();
     filter=$("#iSelectFilterTagList").val();
@@ -51,39 +55,43 @@
     displayTagListOrder();
 
-    $("#iListTags").html(
-      $.ajax({
+    $("#iListTags").html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
+
+    $.ajax(
+      {
         type: "POST",
         url: "{/literal}{$datas.urlRequest}{literal}",
-        async: false,
-        data: { ajaxfct:"showStatsGetListTags", orderType:order, filterType:filter, excludeUnusedTag:unusedTag, selectedTagOnly:selectedOnly }
-       }).responseText
-    );
-    $("#iListTagsNb").html(
-      "{/literal}{'g003_number_of_filtered_metadata'|@translate}{literal} "+$("#iListTags table tr").length
-    );
-
-    //onclick="updateTagSelect('iNumId{$data.numId}', '')"
-    $("input.cbiListTags")
-      .bind('click',
-        function(event)
-        {
-          event.stopPropagation();
-          updateTagSelect($(this).get(0).id, '');
-        }
-      );
-
-    $("a.cbiListTags")
-      .bind('click',
-        function(event)
-        {
-          event.stopPropagation();
-          loadTagDetail($(this).get(0).id.substr(7));
-        }
-      );
-
-
-
-
-    $("body").css("cursor", "default");
+        async: true,
+        data: { ajaxfct:"showStatsGetListTags", orderType:order, filterType:filter, excludeUnusedTag:unusedTag, selectedTagOnly:selectedOnly },
+        success:
+          function(msg)
+          {
+            $("#iListTags").html(msg);
+
+            $("#iListTagsNb").html(
+              "{/literal}{'g003_number_of_filtered_metadata'|@translate}{literal} "+$("#iListTags table tr").length
+            );
+
+            //onclick="updateTagSelect('iNumId{$data.numId}', '')"
+            $("input.cbiListTags")
+              .bind('click',
+                function(event)
+                {
+                  event.stopPropagation();
+                  updateTagSelect($(this).get(0).id, '');
+                }
+              );
+
+            $("a.cbiListTags")
+              .bind('click',
+                function(event)
+                {
+                  event.stopPropagation();
+                  loadTagDetail($(this).get(0).id.substr(7));
+                }
+              );
+          }
+      }
+    );
+
   }
 
@@ -94,5 +102,5 @@
     globalTagId=tag;
     order=$('#iSelectOrderImageList').val();
-    $("#iListImages").html("<br>{/literal}{'g003_loading'|@translate}{literal}");
+    $("#iListImages").html("<br>{/literal}{'g003_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
     $("#iHeaderListImagesTagName").html("["+tag+"]");
 
@@ -117,5 +125,4 @@
   function updateTagSelect(numId, mode)
   {
-    $("body").css("cursor", "wait");
 
     if(mode=='switch')
@@ -134,5 +141,5 @@
        }).responseText
     );
-    $("body").css("cursor", "default");
+
   }
 
@@ -168,7 +175,9 @@
     {
       // by label
+      /* not fully implemented
       $("#iHLTOrderTag").html("");
       $("#iHLTOrderLabel").html("&#8593;");
       $("#iHLTOrderNum").html("");
+      */
     }
   }
@@ -224,5 +233,6 @@
   <tr>
     <th style="width:35%;min-width:340px;"><span id="iHLTOrderTag"></span><a onclick="sortTagList('tag');">{'g003_TagId'|@translate}</a></th>
-    <th><span id="iHLTOrderLabel"></span><a onclick="sortTagList('label');">{'g003_TagLabel'|@translate}</a></th>
+    {* <th><span id="iHLTOrderLabel"></span><a onclick="sortTagList('label');">{'g003_TagLabel'|@translate}</a></th> *}
+    <th>{'g003_TagLabel'|@translate}</th>
     <th width="80px"><span id="iHLTOrderNum"></span><a onclick="sortTagList('num');">{'g003_NumOfImage'|@translate}</a></th>
     <th width="40px">{'g003_Pct'|@translate}</th>
@@ -230,5 +240,5 @@
   </tr>
 </table>
-<div id='iListTags'>
+<div id='iListTags' class="{$themeconf.name}">
 </div>
 <div id="iListTagsNb"></div>
@@ -249,5 +259,5 @@
   </table>
 
-  <div id='iListImages'>
+  <div id='iListImages' class="{$themeconf.name}">
     <div style="width:100%;text-align:center;padding-top:20px;">{'g003_no_items_selected'|@translate}</div>
   </div>
Index: /extensions/AMetaData/admin/amd_metadata_select_iListImages.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_select_iListImages.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata_select_iListImages.tpl	(revision 5935)
@@ -6,5 +6,5 @@
     <td width="40px">{$data.pct}</td>
     <td width="110px">
-      <div class="pctBar" style="width:{$data.pct}px;"></div>
+      <div class="pctBar{$themeconf.name}" style="width:{$data.pct}px;"></div>
     </td>
 
Index: /extensions/AMetaData/admin/amd_metadata_select_iListTags.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_select_iListTags.tpl	(revision 5934)
+++ /extensions/AMetaData/admin/amd_metadata_select_iListTags.tpl	(revision 5935)
@@ -10,5 +10,5 @@
     <td width="40px">{$data.pct}</td>
     <td width="110px">
-      <div class="pctBar" style="width:{$data.pct}px;"></div>
+      <div class="pctBar{$themeconf.name}" style="width:{$data.pct}px;"></div>
     </td>
   </tr>
Index: /extensions/AMetaData/admin/plugin_admin.php
===================================================================
--- /extensions/AMetaData/admin/plugin_admin.php	(revision 5934)
+++ /extensions/AMetaData/admin/plugin_admin.php	(revision 5935)
@@ -28,5 +28,5 @@
 $main_plugin_object = get_plugin_data($plugin_id);
 
-$plugin_ai = new AMD_AIP($prefixeTable, $main_plugin_object->get_filelocation());
+$plugin_ai = new AMD_AIP($prefixeTable, $main_plugin_object->getFileLocation());
 $plugin_ai->manage();
 
Index: /extensions/AMetaData/amd.css
===================================================================
--- /extensions/AMetaData/amd.css	(revision 5934)
+++ /extensions/AMetaData/amd.css	(revision 5935)
@@ -6,14 +6,16 @@
 table.littlefont th { padding:3px; text-align:left;}
 table.littlefont td { padding:1px 3px; }
-#iprogressbar_contener { border:1px solid #606060; margin:0px; padding:0px; display:block; height:20px; }
-#iprogressbar_bg { background:#606060; display:block; z-index:100; position:relative; height:20px; }
-#iprogressbar_fg { color:#FF3363; width:100%; text-align:center; display: block; z-index:200; position:relative; top:-18px;  }
+#iprogressbar_contener { margin:0px; padding:0px; display:block; height:20px; border-width:1px; border-style:solid;}
+#iprogressbar_bg { display:block; z-index:100; position:relative; height:20px; }
+#iprogressbar_fg { width:100%; text-align:center; display: block; z-index:200; position:relative; top:-18px;  }
 #iHeaderListTags { width:100%; border:1px solid; border-collapse: collapse; margin-top:3px; }
-#iListTags { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto;}
+#iListTags { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto; position:relative; left:-1px;}
 #iListImages { width:100%; border-bottom:1px solid; overflow:auto;}
 #iListTagsNb, #iListImagesNb { width:99%; text-align:right; margin-bottom:8px; padding:2px; font-size:80%; }
 #iListTags table, #iListImages table, table.listTags { width:100%; text-align:left; border-collapse: collapse; }
-#iListTags table tr:hover { cursor:pointer; background:#303030; }
-#iListImages table tr:hover, table.listTags tr:hover { background:#303030; cursor:default; }
+#iListTags.roma table tr:hover { cursor:pointer; background:#303030; }
+#iListImages.roma table tr:hover, table.roma tr:hover { background:#303030; cursor:default; }
+#iListTags.clear table tr:hover { cursor:pointer; color: #D54E21; background:#dbe8f3; }
+#iListImages.clear table tr:hover, table.clear tr:hover { color: #D54E21; background:#dbe8f3; cursor:default; }
 #iHeaderListImages { width:100%; border-bottom:1px solid; }
 .nfo ul { margin-top:0em; margin-bottom:1em; }
@@ -21,12 +23,14 @@
 .warning p, .nfo p { margin-top:0.5em; margin-bottom:0em; }
 .warning ul { margin-top:0em; margin-bottom:0.5em; }
-.pctBar { height:6px; background:#FF7700; }
+.pctBarroma { height:6px; background:#FF7700; }
+.pctBarclear { height:6px; background:#005E89; }
 li.groupItems { border:1px solid #666666; margin-bottom:5px; padding:0 5px; width:90%; cursor:move; padding:4px; }
 div.addGroup { padding-left:40px; text-align:left; }
 #iGroups { list-style: none; }
-.ui-dialog { background: #222222; border:2px solid #FF3363; }
+
+.ui-dialog { border-width:1px; border-style:solid; }
 .ui-dialog-buttonpane { padding:4px; }
 .ui-dialog-buttonpane button { margin-right:8px; }
-.ui-dialog-titlebar { background:#111111; font-weight:bold; }
+.ui-dialog-titlebar { font-weight:bold; }
 .ui-dialog-title-dialog { text-align: left; }
 .ui-dialog-titlebar-close { float: right; }
@@ -34,11 +38,14 @@
 .ui-dialog-container { }
 .ui-dialog-titlebar-close { display:none; }
+
+.ui-widget-overlay { background:#000000; opacity:0.5; filter:alpha(opacity:50); position:absolute; top:0px; left:0px; }
+
 .tagListOrder { list-style: none; padding:0px; margin-right:8px; margin-left:35px; }
-.tagListOrder li { border:none; background:#333333; padding:1px; margin-bottom:2px; width:100%; }
+.tagListOrder li { border:none; padding:1px; margin-bottom:2px; width:100%; }
 .groupTags { padding-top:8px; }
 .editGroupListButton { margin-left:8px; position:absolute; z-index:1000; }
 table.tagListOrderItem { width:100%; border-collapse:collapse; }
 .dialogForm { text-align:left; margin:8px; }
-#ianalyzestatus { background: #333333; margin:8px; padding:8px; }
+#ianalyzestatus { margin:8px; padding:8px; }
 #ianalyzestatus ul { margin:0px; padding:0 0 0 20px; }
 #iamd_nb_item_per_request_display { display:inline-block; width:70px; }
@@ -48,3 +55,24 @@
 #helpBody ul { padding:0px; margin:0px; }
 #helpBody li { margin-left:30px; }
+#iDialogProgress p { text-align: center; margin-top: 8px; margin-bottom: 0pt; }
 
+.tabsheet2 {
+display:table;
+font-family:verdana,arial,helvetica,sans-serif; font-size:8px;
+list-style-image:none; padding: 0 0 0 10px; position:relative; text-decoration:none;
+white-space:nowrap; margin: 0 0 0 -6px;top:-21px;border-bottom:1px solid;
+width:100%;
+}
+.tabsheet2 li { float:left; margin:0 0 0 0; overflow:hidden; text-align:right; border-width:1px; position:relative; }
+.tabsheet2 a {
+display:block; font-size:11px; border:0;
+font-weight:bold; overflow:hidden; padding:2px 6px;
+text-align:right; text-decoration:none; margin: 0; }
+.tabsheet2 a:first-letter { text-transform:capitalize; }
+
+.tabsheet2 li:hover, .tabsheet2 li.selected_tab  {
+padding-top:6px; border-bottom:5px solid;
+ }
+/* .tabsheet a:hover */
+.tabsheet2 a span { display:block; font-size:10px; margin-right:2px; padding:0 3px 0 1px; }
+
Index: /extensions/AMetaData/amd_aim.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_aim.class.inc.php	(revision 5934)
+++ /extensions/AMetaData/amd_aim.class.inc.php	(revision 5935)
@@ -34,8 +34,8 @@
     initialize events call for the plugin
   */
-  function init_events()
+  function initEvents()
   {
-    parent::init_events();
-    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'plugin_admin_menu') );
+    parent::initEvents();
+    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') );
   }
 
Index: /extensions/AMetaData/amd_aip.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_aip.class.inc.php	(revision 5934)
+++ /extensions/AMetaData/amd_aip.class.inc.php	(revision 5935)
@@ -23,7 +23,7 @@
 
 include_once('amd_root.class.inc.php');
-include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
-include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/ajax.class.inc.php');
-include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/genericjs.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTabSheet.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/genericjs.class.inc.php');
 
 
@@ -32,5 +32,4 @@
 {
   protected $tabsheet;
-  protected $ajax;
 
   /**
@@ -45,15 +44,14 @@
     parent::__construct($prefixeTable, $filelocation);
 
-    $this->load_config();
-    $this->init_events();
+    $this->loadConfig();
+    $this->initEvents();
 
     $this->tabsheet = new tabsheet();
     $this->tabsheet->add('metadata',
                           l10n('g003_metadata'),
-                          $this->page_link.'&amp;fAMD_tabsheet=metadata');
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata');
     $this->tabsheet->add('help',
                           l10n('g003_help'),
-                          $this->page_link.'&amp;fAMD_tabsheet=help');
-    $this->ajax = new Ajax();
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=help');
   }
 
@@ -91,5 +89,5 @@
     $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]");
 
-    $template_plugin["AMD_VERSION"] = "<i>".$this->plugin_name."</i> ".l10n('g003_version').AMD_VERSION;
+    $template_plugin["AMD_VERSION"] = "<i>".$this->getPluginName()."</i> ".l10n('g003_version').AMD_VERSION;
     $template_plugin["AMD_PAGE"] = $_REQUEST['fAMD_tabsheet'];
     $template_plugin["PATH"] = AMD_PATH;
@@ -111,8 +109,10 @@
   /**
    * initialize events call for the plugin
-   */
-  public function init_events()
-  {
-    add_event_handler('loc_end_page_header', array(&$this->css, 'apply_CSS'));
+   *
+   * don't inherits from its parent => it's normal
+   */
+  public function initEvents()
+  {
+    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
   }
 
@@ -191,5 +191,5 @@
           break;
       }
-      $this->ajax->return_result($result);
+      GPCAjax::returnResult($result);
     }
   }
@@ -511,15 +511,15 @@
     $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_metadata.tpl');
 
-    $statTabsheet = new tabsheet('statTabsheet', $this->tabsheet->get_titlename());
+    $statTabsheet = new GPCTabSheet('statTabsheet', $this->tabsheet->get_titlename(), 'tabsheet2 gcBorder', 'itab2');
     $statTabsheet->select($tab);
     $statTabsheet->add('database',
                           l10n('g003_database'),
-                          $this->page_link.'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=database');
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=database');
     $statTabsheet->add('select',
                           l10n('g003_select'),
-                          $this->page_link.'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=select');
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=select');
     $statTabsheet->add('display',
                           l10n('g003_display'),
-                          $this->page_link.'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=display');
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=metadata&amp;fAMD_page=display');
     $statTabsheet->assign();
 
@@ -549,16 +549,20 @@
   protected function displayMetaDataSelect()
   {
-    global $template;
+    global $template, $theme, $themes, $themeconf;
+    /*echo "A".print_r($theme, true)."<br>";
+    echo "B".print_r($themes, true)."<br>";
+    echo "C".print_r($themeconf, true)."<br>";
+    echo "D".print_r($template->smarty->[], true)."<br>";*/
 
     $template->set_filename('sheet_page',
-                  dirname($this->filelocation).'/admin/amd_metadata_select.tpl');
+                  dirname($this->getFileLocation()).'/admin/amd_metadata_select.tpl');
 
     $datas=array(
-      'urlRequest' => $this->page_link,
-      'config_GetListTags_OrderType' => $this->my_config['amd_GetListTags_OrderType'],
-      'config_GetListTags_FilterType' => $this->my_config['amd_GetListTags_FilterType'],
-      'config_GetListTags_ExcludeUnusedTag' => $this->my_config['amd_GetListTags_ExcludeUnusedTag'],
-      'config_GetListTags_SelectedTagOnly' => $this->my_config['amd_GetListTags_SelectedTagOnly'],
-      'config_GetListImages_OrderType' => $this->my_config['amd_GetListImages_OrderType']
+      'urlRequest' => $this->getAdminLink(),
+      'config_GetListTags_OrderType' => $this->config['amd_GetListTags_OrderType'],
+      'config_GetListTags_FilterType' => $this->config['amd_GetListTags_FilterType'],
+      'config_GetListTags_ExcludeUnusedTag' => $this->config['amd_GetListTags_ExcludeUnusedTag'],
+      'config_GetListTags_SelectedTagOnly' => $this->config['amd_GetListTags_SelectedTagOnly'],
+      'config_GetListImages_OrderType' => $this->config['amd_GetListImages_OrderType']
     );
 
@@ -581,9 +585,9 @@
     //$local_tpl = new Template(AMD_PATH."admin/", "");
     $template->set_filename('sheet_page',
-                  dirname($this->filelocation).'/admin/amd_metadata_display.tpl');
+                  dirname($this->getFileLocation()).'/admin/amd_metadata_display.tpl');
 
 
     $datas=array(
-      'urlRequest' => $this->page_link,
+      'urlRequest' => $this->getAdminLink(),
       'selectedTags' => Array(),
       'groups' => Array(),
@@ -688,6 +692,6 @@
 
     $datas=array(
-      'urlRequest' => $this->page_link,
-      'NumberOfItemsPerRequest' => $this->my_config['amd_NumberOfItemsPerRequest'],
+      'urlRequest' => $this->getAdminLink(),
+      'NumberOfItemsPerRequest' => $this->config['amd_NumberOfItemsPerRequest'],
     );
 
@@ -711,18 +715,18 @@
     $template->set_filename('body_page', dirname(__FILE__).'/admin/amd_help.tpl');
 
-    $statTabsheet = new tabsheet('statTabsheet', $this->tabsheet->get_titlename());
+    $statTabsheet = new GPCTabSheet('statTabsheet', $this->tabsheet->get_titlename(), 'tabsheet2 gcBorder', 'itab2');
     $statTabsheet->select($tab);
     $statTabsheet->add('exif',
                           l10n('g003_help_tab_exif'),
-                          $this->page_link.'&amp;fAMD_tabsheet=help&amp;fAMD_page=exif');
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=help&amp;fAMD_page=exif');
     $statTabsheet->add('iptc',
                           l10n('g003_help_tab_iptc'),
-                          $this->page_link.'&amp;fAMD_tabsheet=help&amp;fAMD_page=iptc');
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=help&amp;fAMD_page=iptc');
     $statTabsheet->add('xmp',
                           l10n('g003_help_tab_xmp'),
-                          $this->page_link.'&amp;fAMD_tabsheet=help&amp;fAMD_page=xmp');
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=help&amp;fAMD_page=xmp');
     $statTabsheet->add('magic',
                           l10n('g003_help_tab_magic'),
-                          $this->page_link.'&amp;fAMD_tabsheet=help&amp;fAMD_page=magic');
+                          $this->getAdminLink().'&amp;fAMD_tabsheet=help&amp;fAMD_page=magic');
     $statTabsheet->assign();
 
@@ -811,6 +815,6 @@
 
     $returned="";
-    $this->my_config['amd_NumberOfItemsPerRequest']=$nbOfItems;
-    $this->save_config();
+    $this->config['amd_NumberOfItemsPerRequest']=$nbOfItems;
+    $this->saveConfig();
 
     $sql="SELECT ait.imageId FROM ".$this->tables['images']." ait";
@@ -982,13 +986,15 @@
   private function ajax_amd_showStatsGetListTags($orderType, $filterType, $excludeUnusedTag, $selectedTagOnly)
   {
-    $this->my_config['amd_GetListTags_OrderType'] = $orderType;
-    $this->my_config['amd_GetListTags_FilterType'] = $filterType;
-    $this->my_config['amd_GetListTags_ExcludeUnusedTag'] = $excludeUnusedTag;
-    $this->my_config['amd_GetListTags_SelectedTagOnly'] = $selectedTagOnly;
-    $this->save_config();
+    global $template;
+
+    $this->config['amd_GetListTags_OrderType'] = $orderType;
+    $this->config['amd_GetListTags_FilterType'] = $filterType;
+    $this->config['amd_GetListTags_ExcludeUnusedTag'] = $excludeUnusedTag;
+    $this->config['amd_GetListTags_SelectedTagOnly'] = $selectedTagOnly;
+    $this->saveConfig();
 
     $local_tpl = new Template(AMD_PATH."admin/", "");
     $local_tpl->set_filename('body_page',
-                  dirname($this->filelocation).'/admin/amd_metadata_select_iListTags.tpl');
+                  dirname($this->getFileLocation()).'/admin/amd_metadata_select_iListTags.tpl');
 
     $numOfPictures=$this->getNumOfPictures();
@@ -1058,4 +1064,5 @@
     }
 
+    $local_tpl->assign('themeconf', Array('name' => $template->get_themeconf('name')));
     $local_tpl->assign('datas', $datas);
 
@@ -1070,10 +1077,12 @@
   private function ajax_amd_showStatsGetListImages($tagId, $orderType)
   {
-    $this->my_config['amd_GetListImages_OrderType'] = $orderType;
-    $this->save_config();
+    global $template;
+
+    $this->config['amd_GetListImages_OrderType'] = $orderType;
+    $this->saveConfig();
 
     $local_tpl = new Template(AMD_PATH."admin/", "");
     $local_tpl->set_filename('body_page',
-                  dirname($this->filelocation).'/admin/amd_metadata_select_iListImages.tpl');
+                  dirname($this->getFileLocation()).'/admin/amd_metadata_select_iListImages.tpl');
 
 
@@ -1113,4 +1122,5 @@
     if(count($datas)>0)
     {
+      $local_tpl->assign('themeconf', Array('name' => $template->get_themeconf('name')));
       $local_tpl->assign('datas', $datas);
       return($local_tpl->parse('body_page', true));
@@ -1153,6 +1163,6 @@
     {
       $sql="DELETE FROM ".$this->tables['selected_tags']." st
-              USING phpwebgallery_amd_used_tags ut
-                LEFT JOIN phpwebgallery_amd_selected_tags st
+              USING ".$this->tables['used_tags']." ut
+                LEFT JOIN ".$this->tables['selected_tags']." st
                   ON ut.tagID = st.tagId
               WHERE ut.numId = $numId;";
@@ -1174,4 +1184,6 @@
   private function ajax_amd_groupGetTagList($id)
   {
+    global $template;
+
     if($id!="")
     {
@@ -1213,5 +1225,6 @@
           $local_tpl = new Template(AMD_PATH."admin/", "");
           $local_tpl->set_filename('body_page',
-                        dirname($this->filelocation).'/admin/amd_metadata_display_groupListTagSelect.tpl');
+                        dirname($this->getFileLocation()).'/admin/amd_metadata_display_groupListTagSelect.tpl');
+          $local_tpl->assign('themeconf', Array('name' => $template->get_themeconf('name')));
           $local_tpl->assign('datas', $datas);
           return($local_tpl->parse('body_page', true));
@@ -1299,5 +1312,5 @@
         {
           $template->set_filename('list_page',
-                        dirname($this->filelocation).'/admin/amd_metadata_display_groupListTagOrder.tpl');
+                        dirname($this->getFileLocation()).'/admin/amd_metadata_display_groupListTagOrder.tpl');
           $template->assign('datas', $datas);
           $template->assign('group', $id);
@@ -1432,5 +1445,5 @@
     $local_tpl = new Template(AMD_PATH."admin/", "");
     $local_tpl->set_filename('body_page',
-                  dirname($this->filelocation).'/admin/amd_metadata_display_groupEdit.tpl');
+                  dirname($this->getFileLocation()).'/admin/amd_metadata_display_groupEdit.tpl');
 
     $datasLang=array(
@@ -1490,5 +1503,5 @@
     //$local_tpl = new Template(AMD_PATH."admin/", "");
     $template->set_filename('group_list',
-                  dirname($this->filelocation).'/admin/amd_metadata_display_groupList.tpl');
+                  dirname($this->getFileLocation()).'/admin/amd_metadata_display_groupList.tpl');
 
 
Index: /extensions/AMetaData/amd_install.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_install.class.inc.php	(revision 5934)
+++ /extensions/AMetaData/amd_install.class.inc.php	(revision 5935)
@@ -30,5 +30,5 @@
     {
       parent::__construct($prefixeTable, $filelocation);
-      $this->tablef= new manage_tables($this->tables);
+      $this->tablef= new GPCTables($this->tables);
     }
 
@@ -46,4 +46,9 @@
     {
       global $user, $lang;
+
+      $this->initConfig();
+      $this->loadConfig();
+      $this->config['installed']=AMD_VERSION2;
+      $this->saveConfig();
 
       $tables_def=array(
@@ -90,5 +95,5 @@
       //$table_def array
       $tables_def = create_table_add_character_set($tables_def);
-      $result=$this->tablef->create_tables($tables_def);
+      $result=$this->tablef->create($tables_def);
       unset($tables_def);
 
@@ -121,6 +126,6 @@
     public function uninstall()
     {
-      $this->delete_config();
-      $this->tablef->drop_tables();
+      $this->deleteConfig();
+      $this->tablef->drop();
     }
 
@@ -142,5 +147,5 @@
       foreach(AMD_JpegMetaData::getTagList(Array('filter' => AMD_JpegMetaData::TAGFILTER_IMPLEMENTED, 'xmp' => true, 'maker' => true, 'iptc' => true)) as $key => $val)
       {
-        $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".L10n::get($val['name'])."');";
+        $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".addslashes(L10n::get($val['name']))."');";
         pwg_query($sql);
       }
@@ -154,4 +159,5 @@
               LEFT JOIN ".IMAGES_TABLE." ti ON ti.id = tc.element_id
             WHERE tc.user_id = ".$user['id']."
+              AND ti.id IS NOT NULL
             ORDER BY RAND() LIMIT 25;";
       $result=pwg_query($sql);
@@ -207,7 +213,8 @@
       }
 
-      $this->init_config();
-      $this->load_config();
-      $this->save_config();
+      $this->initConfig();
+      $this->loadConfig();
+      $this->config['installed']=AMD_VERSION2; //update the installed release number
+      $this->saveConfig();
     }
 
Index: /extensions/AMetaData/amd_pip.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_pip.class.inc.php	(revision 5934)
+++ /extensions/AMetaData/amd_pip.class.inc.php	(revision 5935)
@@ -22,17 +22,14 @@
 
 include_once('amd_root.class.inc.php');
-include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/ajax.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
 
 class AMD_PIP extends AMD_root
 {
-  protected $ajax;
-
   function AMD_PIP($prefixeTable, $filelocation)
   {
     parent::__construct($prefixeTable, $filelocation);
-    $this->ajax = new Ajax();
 
-    $this->load_config();
-    $this->init_events();
+    $this->loadConfig();
+    $this->initEvents();
   }
 
@@ -46,7 +43,7 @@
     initialize events call for the plugin
   */
-  public function init_events()
+  public function initEvents()
   {
-    parent::init_events();
+    parent::initEvents();
     add_event_handler('loc_begin_picture', array(&$this, 'loadMetadata'));
   }
@@ -162,6 +159,6 @@
 
     if($analyzed=='n' and
-       $this->my_config['amd_FillDataBaseContinuously']=='y' and
-       $this->my_config['amd_AllPicturesAreAnalyzed']=='n')
+       $this->config['amd_FillDataBaseContinuously']=='y' and
+       $this->config['amd_AllPicturesAreAnalyzed']=='n')
     {
       /* if picture is not analyzed, do analyze
Index: /extensions/AMetaData/amd_root.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_root.class.inc.php	(revision 5934)
+++ /extensions/AMetaData/amd_root.class.inc.php	(revision 5935)
@@ -21,6 +21,6 @@
 if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
 
-include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php');
-include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/css.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
 
 include_once('amd_jpegmetadata.class.inc.php');
@@ -28,5 +28,5 @@
 include_once(JPEG_METADATA_DIR."TagDefinitions/XmpTags.class.php");
 
-class AMD_root extends common_plugin
+class AMD_root extends CommonPlugin
 {
   protected $css;   //the css object
@@ -36,12 +36,12 @@
   {
     global $user;
-    $this->plugin_name="AMetaData";
-    $this->plugin_name_files="amd";
+    $this->setPluginName("AMetaData");
+    $this->setPluginNameFiles("amd");
     parent::__construct($prefixeTable, $filelocation);
 
     $tableList=array('used_tags', 'images_tags', 'images', 'selected_tags', 'groups_names', 'groups');
-    $this->set_tables_list($tableList);
-
-    $this->css = new css(dirname($this->filelocation).'/'.$this->plugin_name_files.".css");
+    $this->setTablesList($tableList);
+
+    $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
     $this->jpegMD=new AMD_JpegMetaData();
 
@@ -64,8 +64,8 @@
   --------------------------------------------------------------------------- */
 
-  /* this function initialize var $my_config with default values */
-  public function init_config()
-  {
-    $this->my_config=array(
+  /* this function initialize var $config with default values */
+  public function initConfig()
+  {
+    $this->config=array(
       'amd_NumberOfItemsPerRequest' => 25,
       'amd_GetListTags_OrderType' => "tag",
@@ -79,17 +79,17 @@
   }
 
-  public function load_config()
-  {
-    parent::load_config();
-  }
-
-  public function init_events()
-  {
-    parent::init_events();
+  public function loadConfig()
+  {
+    parent::loadConfig();
+  }
+
+  public function initEvents()
+  {
+    parent::initEvents();
 
 
     if(!isset($_REQUEST['ajaxfct']) and
-       $this->my_config['amd_FillDataBaseContinuously']=='y' and
-       $this->my_config['amd_AllPicturesAreAnalyzed']=='n')
+       $this->config['amd_FillDataBaseContinuously']=='y' and
+       $this->config['amd_AllPicturesAreAnalyzed']=='n')
     {
       /* do analyze for a random picture only if :
@@ -270,9 +270,9 @@
       while($row=mysql_fetch_assoc($result))
       {
-        $this->my_config['amd_AllPicturesAreAnalyzed']=($row['nb']==0)?'y':'n';
-      }
-
-    }
-    $this->save_config();
+        $this->config['amd_AllPicturesAreAnalyzed']=($row['nb']==0)?'y':'n';
+      }
+
+    }
+    $this->saveConfig();
   }
 
Index: /extensions/AMetaData/amd_version.inc.php
===================================================================
--- /extensions/AMetaData/amd_version.inc.php	(revision 5935)
+++ /extensions/AMetaData/amd_version.inc.php	(revision 5935)
@@ -0,0 +1,21 @@
+<?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 ! >>
+ *
+ * -----------------------------------------------------------------------------
+ *
+ */
+
+  if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+  define('AMD_VERSION',  '0.4.0');
+  define('AMD_VERSION2', '00.04.00');
+?>
Index: /extensions/AMetaData/main.inc.php
===================================================================
--- /extensions/AMetaData/main.inc.php	(revision 5934)
+++ /extensions/AMetaData/main.inc.php	(revision 5935)
@@ -2,9 +2,9 @@
 /*
 Plugin Name: Advanced MetaData
-Version: 0.3b
+Version: 0.4b
 Description: An advanced metadata manager
-Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=364
-Author: Piwigo team
-Author URI: http://piwigo.org
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=364
+Author: grum@piwigo.org
+Author URI: http://photos.grum.fr/
 */
 
@@ -26,4 +26,5 @@
 | 0.2b    | 2010/03/23 | * beta release
 | 0.3b    | 2010/04/11 | * beta release
+| 0.4b    | 2010/04/18 | * beta release for Piwigo 2.1
 |         |            |
 |         |            |
@@ -46,6 +47,6 @@
 
 // pour faciliter le debug - make debug easier :o)
-ini_set('error_reporting', E_ALL);
-ini_set('display_errors', true);
+// ini_set('error_reporting', E_ALL);
+// ini_set('display_errors', true);
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
@@ -54,5 +55,5 @@
 define('AMD_PATH' , PHPWG_PLUGINS_PATH . AMD_DIR . '/');
 
-define('AMD_VERSION' , '0.3b'); //=> ne pas oublier la version dans l'entête !!
+include_once('amd_version.inc.php'); // => Don't forget to update this file !!
 
 global $prefixeTable, $page;
@@ -64,5 +65,5 @@
   include_once("amd_aim.class.inc.php");
   $obj = new AMD_AIM($prefixeTable, __FILE__);
-  $obj->init_events();
+  $obj->initEvents();
   set_plugin_data($plugin['id'], $obj);
 }
Index: /extensions/AMetaData/maintain.inc.php
===================================================================
--- /extensions/AMetaData/maintain.inc.php	(revision 5934)
+++ /extensions/AMetaData/maintain.inc.php	(revision 5935)
@@ -20,21 +20,25 @@
 //ini_set('display_errors', true);
 
+include_once('amd_version.inc.php'); // => Don't forget to update this file !!
+
+
 defined('AMD_DIR') || define('AMD_DIR' , basename(dirname(__FILE__)));
 defined('AMD_PATH') || define('AMD_PATH' , PHPWG_PLUGINS_PATH . AMD_DIR . '/');
-@include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCore.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php');
 
 
-global $gpc_installed, $lang; //needed for plugin manager compatibility
+global $gpc_installed, $gpcNeeded, $lang; //needed for plugin manager compatibility
 
 /* -----------------------------------------------------------------------------
-AMD needs the Grum Plugin Classe
------------------------------------------------------------------------------ */
+ * AMD needs the Grum Plugin Classe
+ * -------------------------------------------------------------------------- */
 $gpc_installed=false;
-if(file_exists(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/common_plugin.class.inc.php'))
+$gpcNeeded="3.0.0";
+if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
 {
-  @include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/main.inc.php');
-  // need GPC release greater or equal than 2.0.4
-
-  if(checkGPCRelease(2,0,4))
+  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
+  // need GPC release greater or equal than 3.0.0
+  if(CommonPlugin::checkGPCRelease(3,0,0))
   {
     @include_once("amd_install.class.inc.php");
@@ -45,5 +49,14 @@
 function gpcMsgError(&$errors)
 {
-  array_push($errors, sprintf(l10n('Grum Plugin Classes is not installed (release >= %s)'), "2.0.4"));
+  global $gpcNeeded;
+  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), $gpcNeeded);
+  if(is_array($errors))
+  {
+    array_push($errors, $msg);
+  }
+  else
+  {
+    $errors=Array($msg);
+  }
 }
 // -----------------------------------------------------------------------------
@@ -55,9 +68,10 @@
 function plugin_install($plugin_id, $plugin_version, &$errors)
 {
-  global $prefixeTable, $gpc_installed;
+  global $prefixeTable, $gpc_installed, $gpcNeeded;
   if($gpc_installed)
   {
     $amd=new AMD_install($prefixeTable, __FILE__);
     $result=$amd->install();
+    GPCCore::register($amd->getPluginName(), AMD_VERSION, $gpcNeeded);
   }
   else
@@ -81,9 +95,10 @@
 function plugin_uninstall($plugin_id)
 {
-  global $prefixeTable, $gpc_installed;
+  global $prefixeTable, $gpc_installed, $gpcNeeded;
   if($gpc_installed)
   {
     $amd=new AMD_install($prefixeTable, __FILE__);
     $result=$amd->uninstall();
+    GPCCore::unregister($amd->getPluginName());
   }
   else
