Index: /extensions/AMetaData/admin/amd_install_page.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_install_page.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_install_page.tpl	(revision 16007)
@@ -22,5 +22,5 @@
         url: "{/literal}{$urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.install.chooseInterface", interfaceMode:interfaceMode },
+        data: { ajaxfct:"admin.install.chooseInterface", token:'{/literal}{$token}{literal}', interfaceMode:interfaceMode },
         success:
           function(msg)
Index: /extensions/AMetaData/admin/amd_metadata_database.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_database.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_database.tpl	(revision 16007)
@@ -36,5 +36,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.makeStats.getStatus" },
+        data: { ajaxfct:"admin.makeStats.getStatus", token:'{/literal}{$token}{literal}' },
         success: function (msg) {
           list=msg.split(";");
@@ -101,5 +101,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.makeStats.getList", selectMode:mode, numOfItems:NumberOfItemsPerRequest },
+        data: { ajaxfct:"admin.makeStats.getList", token:'{/literal}{$token}{literal}', selectMode:mode, numOfItems:NumberOfItemsPerRequest },
         success: function(msg)
           {
@@ -135,5 +135,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.makeStats.doAnalyze", imagesList:processAnalyze.lists[processAnalyze.step] },
+        data: { ajaxfct:"admin.makeStats.doAnalyze", token:'{/literal}{$token}{literal}', imagesList:processAnalyze.lists[processAnalyze.step] },
         success: function(msg)
           {
@@ -154,5 +154,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: false,
-        data: { ajaxfct:"admin.makeStats.consolidate" }
+        data: { ajaxfct:"admin.makeStats.consolidate", token:'{/literal}{$token}{literal}' }
        }).responseText;
 
Index: /extensions/AMetaData/admin/amd_metadata_database_database.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_database_database.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_database_database.tpl	(revision 16007)
@@ -119,4 +119,5 @@
           {
             ajaxfct:"admin.makeStats.getList",
+            token:'{/literal}{$token}{literal}',
             selectMode:mode,
             numOfItems:NumberOfItemsPerRequest,
@@ -157,5 +158,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.makeStats.doAnalyze", imagesList:processAnalyze.lists[processAnalyze.step] },
+        data: { ajaxfct:"admin.makeStats.doAnalyze", token:'{/literal}{$token}{literal}', imagesList:processAnalyze.lists[processAnalyze.step] },
         success: function(msg)
           {
@@ -176,5 +177,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: false,
-        data: { ajaxfct:"admin.makeStats.consolidate" }
+        data: { ajaxfct:"admin.makeStats.consolidate", token:'{/literal}{$token}{literal}' }
        }).responseText;
 
@@ -224,5 +225,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.config.setOption", id:'amd_FillDataBaseContinuously', value:$('#iamd_FillDataBaseContinuously').get(0).checked?'y':'n' },
+        data: { ajaxfct:"admin.config.setOption", token:'{/literal}{$token}{literal}', id:'amd_FillDataBaseContinuously', value:$('#iamd_FillDataBaseContinuously').get(0).checked?'y':'n' },
       }
     );
Index: /extensions/AMetaData/admin/amd_metadata_display.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_display.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_display.tpl	(revision 16007)
@@ -11,5 +11,5 @@
           url: "{/literal}{$datas.urlRequest}{literal}",
           async: false,
-          data: { ajaxfct:"admin.group.getList" }
+          data: { ajaxfct:"admin.group.getList", token:'{/literal}{$token}{literal}' }
         }
       ).responseText
@@ -43,5 +43,5 @@
                 url: "{/literal}{$datas.urlRequest}{literal}",
                 async: false,
-                data: { ajaxfct:"admin.group.setOrder", listGroup:list }
+                data: { ajaxfct:"admin.group.setOrder", token:'{/literal}{$token}{literal}', listGroup:list }
               }
             ).responseText;
@@ -83,5 +83,5 @@
                 url: "{/literal}{$datas.urlRequest}{literal}",
                 async: false,
-                data: { ajaxfct:"admin.group.setOrderedTagList", id:groupId, listTag:list }
+                data: { ajaxfct:"admin.group.setOrderedTagList", token:'{/literal}{$token}{literal}', id:groupId, listTag:list }
               }
             ).responseText;
@@ -100,5 +100,5 @@
           url: "{/literal}{$datas.urlRequest}{literal}",
           async: false,
-          data: { ajaxfct:"admin.group.getOrderedTagList", id:groupId }
+          data: { ajaxfct:"admin.group.getOrderedTagList", token:'{/literal}{$token}{literal}', id:groupId }
         }
       ).responseText
@@ -169,5 +169,5 @@
                     url: "{/literal}{$datas.urlRequest}{literal}",
                     async: false,
-                    data: { ajaxfct:"admin.group.delete", id:groupId }
+                    data: { ajaxfct:"admin.group.delete", token:'{/literal}{$token}{literal}', id:groupId }
                   }
                 ).responseText;
@@ -178,5 +178,5 @@
                       url: "{/literal}{$datas.urlRequest}{literal}",
                       async: false,
-                      data: { ajaxfct:"admin.group.getList" }
+                      data: { ajaxfct:"admin.group.getList", token:'{/literal}{$token}{literal}' }
                     }
                   ).responseText
@@ -237,5 +237,5 @@
                   url: "{/literal}{$datas.urlRequest}{literal}",
                   async: false,
-                  data: { ajaxfct:"admin.group.setNames", id:groupId, listNames:list }
+                  data: { ajaxfct:"admin.group.setNames", token:'{/literal}{$token}{literal}', id:groupId, listNames:list }
                 }
               ).responseText;
@@ -246,5 +246,5 @@
                     url: "{/literal}{$datas.urlRequest}{literal}",
                     async: false,
-                    data: { ajaxfct:"admin.group.getList" }
+                    data: { ajaxfct:"admin.group.getList", token:'{/literal}{$token}{literal}' }
                   }
                 ).responseText
@@ -266,5 +266,5 @@
           url: "{/literal}{$datas.urlRequest}{literal}",
           async: false,
-          data: { ajaxfct:"admin.group.getNames", id:groupId }
+          data: { ajaxfct:"admin.group.getNames", token:'{/literal}{$token}{literal}', id:groupId }
         }
       ).responseText
@@ -313,5 +313,5 @@
                   url: "{/literal}{$datas.urlRequest}{literal}",
                   async: false,
-                  data: { ajaxfct:"admin.group.setTagList", id:groupId, listTag:list }
+                  data: { ajaxfct:"admin.group.setTagList", token:'{/literal}{$token}{literal}', id:groupId, listTag:list }
                 }
               ).responseText;
@@ -335,5 +335,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.group.getTagList", id:groupId },
+        data: { ajaxfct:"admin.group.getTagList", token:'{/literal}{$token}{literal}', id:groupId },
         success:
           function(msg)
Index: /extensions/AMetaData/admin/amd_metadata_display_groupList.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_display_groupList.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_display_groupList.tpl	(revision 16007)
@@ -1,21 +1,18 @@
 {foreach from=$datas.groups key=name item=data}
   <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}"/>
+    <span class='listMove' title="{'Drag to re-order'|@translate}"></span>
     <input type="hidden" id="iGroupName{$data.id}" value="{$data.name}">
     {$data.name}
 
     <a onclick="deleteGroup('{$data.id}');">
-      <img src="{$themeconf.admin_icon_dir}/delete.png"  class="button drag_button" alt="{'g003_click_to_delete_group'|@translate}" title="{'g003_click_to_delete_group'|@translate}"
-            style="float:right;"/>
+      <span class='buttonDelete button' title="{'g003_click_to_delete_group'|@translate}"></span>
     </a>
 
     <a onclick="editGroup('{$data.id}');">
-      <img src="{$themeconf.admin_icon_dir}/category_edit.png"  class="button drag_button" alt="{'g003_click_to_edit_group'|@translate}" title="{'g003_click_to_edit_group'|@translate}"
-            style="float:right;"/>
+      <span class='buttonEdit button' title="{'g003_click_to_edit_group'|@translate}"></span>
     </a>
 
     <a onclick="manageGroup('{$data.id}', '');">
-      <img src="{$themeconf.admin_icon_dir}/preferences.png"  class="button drag_button" alt="{'g003_click_to_manage_group'|@translate}" title="{'g003_click_to_manage_group'|@translate}"
-            style="float:right;"/>
+      <span class='buttonPreferences button' title="{'g003_click_to_manage_group'|@translate}"></span>
     </a>
 
@@ -23,5 +20,5 @@
     <div name="fGroupId{$data.id}_content" id="iGroupId{$data.id}_content" style="visibility:hidden;height:0px;" class="groupTags">
       <a onclick="editGroupList('{$data.id}');" class="button editGroupListButton">
-      <img src="{$themeconf.admin_icon_dir}/edit_s.png"  class="button drag_button" alt="{'g003_click_to_manage_list'|@translate}" title="{'g003_click_to_manage_list'|@translate}"/>
+        <span class='buttonEdit' title="{'g003_click_to_manage_list'|@translate}"></span>
       </a>
       <ul id="iGroupId{$data.id}_tags" class="tagListOrder g{$data.id}_connectedSortableTags">
Index: /extensions/AMetaData/admin/amd_metadata_display_groupListTagOrder.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_display_groupListTagOrder.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_display_groupListTagOrder.tpl	(revision 16007)
@@ -3,5 +3,7 @@
   <table class="tagListOrderItem">
     <tr>
-      <td style="width:20px;"><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}"/></td>
+      <td style="width:20px;">
+        <span class='listMove' title="{'Drag to re-order'|@translate}"></span>
+      </td>
       <td style="width:30%;">{$data.tagId}</td>
       <td>{$data.name}</td>
Index: /extensions/AMetaData/admin/amd_metadata_personnal.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_personnal.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_personnal.tpl	(revision 16007)
@@ -95,5 +95,5 @@
                   url: "{/literal}{$datas.urlRequest}{literal}",
                   async: true,
-                  data: { ajaxfct:"admin.userDefined.getTag", id:options.numId },
+                  data: { ajaxfct:"admin.userDefined.getTag", token:'{/literal}{$token}{literal}', id:options.numId },
                   success:
                     function(msg)
@@ -139,5 +139,5 @@
                         url: "{/literal}{$datas.urlRequest}{literal}",
                         async: true,
-                        data: { ajaxfct:"admin.userDefined.deleteTag", id:id },
+                        data: { ajaxfct:"admin.userDefined.deleteTag", token:'{/literal}{$token}{literal}', id:id },
                         success:
                           function(msg)
@@ -203,5 +203,5 @@
           url: "{/literal}{$datas.urlRequest}{literal}",
           async: true,
-          data: { ajaxfct:"admin.userDefined.getList" },
+          data: { ajaxfct:"admin.userDefined.getList", token:'{/literal}{$token}{literal}' },
           success:
             function(msg)
@@ -560,5 +560,5 @@
           url: "{/literal}{$datas.urlRequest}{literal}",
           async: true,
-          data: { ajaxfct:"admin.userDefined.setTag", id:options.numId, properties:properties },
+          data: { ajaxfct:"admin.userDefined.setTag", token:'{/literal}{$token}{literal}', id:options.numId, properties:properties },
           success:
             function(msg)
@@ -604,5 +604,5 @@
 
 
-  $(window).loaded(
+  $(window).load(
     function ()
     {
@@ -684,10 +684,9 @@
 <ul style='display:none' id='iBDModel'>
   <li id='iBDRuleNumZZZZZ' class='groupItems gcBgPage rmSortable rmItem' value='ZZZZZ'>
-    <img onclick='udm.deleteRule("ZZZZZ");' src='{$themeconf.admin_icon_dir}/delete.png' class='button pointer' alt='{"g003_delete"|@translate}' title='{"g003_delete"|@translate}' style='float:right;'/>
+    <span onclick='udm.deleteRule("ZZZZZ");' class='buttonDelete button' title='{"g003_delete"|@translate}' /></span>
     <div class='rmContent'>
 
       <div class='ruleSelector'>
-        <img src='{$themeconf.admin_icon_dir}/cat_move.png' class='rmSortHandle button drag_button' alt='{"Drag to re-order"|@translate}' title='{"Drag to re-order"|@translate}'/>
-
+        <span class='buttonMove rmSortHandle drag_button' title='{"Drag to re-order"|@translate}'/></span>
 
         <select id='iBDRuleTypeZZZZZ' onchange='udm.changeRuleType("ZZZZZ");'>
Index: /extensions/AMetaData/admin/amd_metadata_personnal_iListTags.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_personnal_iListTags.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_personnal_iListTags.tpl	(revision 16007)
@@ -6,13 +6,10 @@
     <th style="width:15%;">{$data.numOfRules}</th>
     <td width="40px">
-      <img src="{$themeconf.admin_icon_dir}/edit_s.png"
-           class="button" alt="{'g003_edit'|@translate}"
-           title="{'g003_edit'|@translate}"
-           onclick='udm.editMetadata({$data.numId});'/>
-      <img src="{$themeconf.admin_icon_dir}/delete.png"
-           class="button"
-           alt="{'g003_delete'|@translate}"
-           title="{'g003_delete'|@translate}"
-           onclick='udm.deleteMetadata({$data.numId});'/>
+      <span class="buttonEdit"
+            title="{'g003_edit'|@translate}"
+            onclick='udm.editMetadata({$data.numId});'></span>
+      <span class="buttonDelete"
+            title="{'g003_delete'|@translate}"
+            onclick='udm.deleteMetadata({$data.numId});'></span>
     </td>
   </tr>
Index: /extensions/AMetaData/admin/amd_metadata_select.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_select.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_select.tpl	(revision 16007)
@@ -53,5 +53,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.showStats.getListTags", orderType:order, filterType:filter, excludeUnusedTag:unusedTag, selectedTagOnly:selectedOnly },
+        data: { ajaxfct:"admin.showStats.getListTags", token:'{/literal}{$token}{literal}', orderType:order, filterType:filter, excludeUnusedTag:unusedTag, selectedTagOnly:selectedOnly },
         success:
           function(msg)
@@ -101,5 +101,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.showStats.getListImages", orderType:order, tagId:tag,  },
+        data: { ajaxfct:"admin.showStats.getListImages", token:'{/literal}{$token}{literal}', orderType:order, tagId:tag,  },
         success:
           function(msg)
@@ -129,5 +129,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: false,
-        data: { ajaxfct:"admin.updateTag.select", tagSelected:selected, numId:numId.substr(6) }
+        data: { ajaxfct:"admin.updateTag.select", token:'{/literal}{$token}{literal}', tagSelected:selected, numId:numId.substr(6) }
        }).responseText
     );
Index: /extensions/AMetaData/admin/amd_metadata_tags.tpl
===================================================================
--- /extensions/AMetaData/admin/amd_metadata_tags.tpl	(revision 16006)
+++ /extensions/AMetaData/admin/amd_metadata_tags.tpl	(revision 16007)
@@ -15,5 +15,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.tags.getKeywords" },
+        data: { ajaxfct:"admin.tags.getKeywords", token:'{/literal}{$token}{literal}' },
         success: function (msg)
           {
@@ -56,5 +56,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.tags.convertKeywords", keywords:keywords },
+        data: { ajaxfct:"admin.tags.convertKeywords", token:'{/literal}{$token}{literal}', keywords:keywords },
         success: function (msg)
           {
Index: /extensions/AMetaData/amd.css
===================================================================
--- /extensions/AMetaData/amd.css	(revision 16006)
+++ /extensions/AMetaData/amd.css	(revision 16007)
@@ -4,8 +4,4 @@
 #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.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; }
 div.addGroup { padding-left:40px; text-align:left; }
@@ -40,4 +36,5 @@
 img.drag_button { margin-right:8px; }
 li.groupItems input, li.groupItems select { margin-right:4px; }
+
 
 #iBDRules ul { list-style-type:none; }
@@ -140,2 +137,20 @@
   padding:0;
 }
+
+
+
+span.buttonEdit, span.buttonDelete, span.buttonPreferences,span.buttonMove {
+  display:inline-block;
+  width:15px;
+  height:15px;
+  position:relative;
+  background-color:transparent;
+  background-image:url(./../GrumPluginClasses/icons/buttons.png);
+  background-repeat:no-repeat;
+  cursor:pointer;
+}
+span.buttonMove { cursor:move; }
+
+li.groupItems span.button {
+  float:right;
+}
Index: /extensions/AMetaData/amd_aip.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_aip.class.inc.php	(revision 16006)
+++ /extensions/AMetaData/amd_aip.class.inc.php	(revision 16007)
@@ -24,5 +24,4 @@
 include_once('amd_root.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');
 
@@ -81,5 +80,4 @@
   {
     unset($this->tabsheet);
-    unset($this->ajax);
     parent::__destruct();
   }
@@ -116,4 +114,5 @@
 
     $template->assign('plugin', $pluginInfo);
+    GPCCore::setTemplateToken();
 
     switch($_GET['tab'])
@@ -146,4 +145,6 @@
   public function initEvents()
   {
+    parent::initEvents();
+
     if(isset($_GET['tab']) and $_GET['tab']=='search')
     {
@@ -151,8 +152,6 @@
       GPCRequestBuilder::loadJSandCSS();
     }
-
-    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
-    GPCCss::applyGpcCss();
-  }
+  }
+
 
   /**
Index: /extensions/AMetaData/amd_aip_install.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_aip_install.class.inc.php	(revision 16006)
+++ /extensions/AMetaData/amd_aip_install.class.inc.php	(revision 16007)
@@ -48,13 +48,4 @@
     unset($this->tabsheet);
     parent::__destruct();
-  }
-
-  /*
-    initialize events call for the plugin
-  */
-  public function initEvents()
-  {
-    parent::initEvents();
-    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
   }
 
Index: /extensions/AMetaData/amd_aip_release.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_aip_release.class.inc.php	(revision 16006)
+++ /extensions/AMetaData/amd_aip_release.class.inc.php	(revision 16007)
@@ -35,13 +35,4 @@
 
   /*
-    initialize events call for the plugin
-  */
-  public function initEvents()
-  {
-    parent::initEvents();
-    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
-  }
-
-  /*
     display administration page
   */
Index: /extensions/AMetaData/amd_ajax.php
===================================================================
--- /extensions/AMetaData/amd_ajax.php	(revision 16006)
+++ /extensions/AMetaData/amd_ajax.php	(revision 16007)
@@ -20,4 +20,5 @@
 
   define('PHPWG_ROOT_PATH',dirname(dirname(dirname(__FILE__))).'/');
+  if(!defined('AJAX_CALL')) define('AJAX_CALL', true);
 
   /*
@@ -25,8 +26,5 @@
    */
   if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
-  if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']))
-  {
-    define('IN_ADMIN', true);
-  }
+  if(preg_match('/^admin\./i', $_REQUEST['ajaxfct'])) define('IN_ADMIN', true);
 
   // the common.inc.php file loads all the main.inc.php plugins files
@@ -64,42 +62,42 @@
       global $user;
 
-      if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
+      GPCAjax::checkToken();
 
       // check if asked function is valid
       if(!(
-           $_REQUEST['ajaxfct']=='admin.makeStats.getList' or
-           $_REQUEST['ajaxfct']=='admin.makeStats.doAnalyze' or
-           $_REQUEST['ajaxfct']=='admin.makeStats.consolidate' or
-           $_REQUEST['ajaxfct']=='admin.showStats.getListTags' or
-           $_REQUEST['ajaxfct']=='admin.showStats.getListImages' or
-           $_REQUEST['ajaxfct']=='admin.updateTag.select' or
-           $_REQUEST['ajaxfct']=='admin.config.setOption' or
-           $_REQUEST['ajaxfct']=='admin.group.getList' or
-           $_REQUEST['ajaxfct']=='admin.group.delete' or
-           $_REQUEST['ajaxfct']=='admin.group.getNames' or
-           $_REQUEST['ajaxfct']=='admin.group.setNames' or
-           $_REQUEST['ajaxfct']=='admin.group.setOrder' or
-           $_REQUEST['ajaxfct']=='admin.group.getTagList' or
-           $_REQUEST['ajaxfct']=='admin.group.setTagList' or
-           $_REQUEST['ajaxfct']=='admin.group.getOrderedTagList' or
-           $_REQUEST['ajaxfct']=='admin.group.setOrderedTagList' or
-           $_REQUEST['ajaxfct']=='admin.userDefined.getList' or
-           $_REQUEST['ajaxfct']=='admin.userDefined.getTag' or
-           $_REQUEST['ajaxfct']=='admin.userDefined.setTag' or
-           $_REQUEST['ajaxfct']=='admin.userDefined.deleteTag' or
-           $_REQUEST['ajaxfct']=='admin.tag.getValues' or
-           $_REQUEST['ajaxfct']=='admin.tags.getKeywords' or
-           $_REQUEST['ajaxfct']=='admin.tags.convertKeywords' or
-
-           $_REQUEST['ajaxfct']=='public.makeStats.doPictureAnalyze')) $_REQUEST['ajaxfct']='';
-
-      if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']) and !is_admin()) $_REQUEST['ajaxfct']='';
-
-      if($_REQUEST['ajaxfct']!='')
+           $_REQUEST[GPC_AJAX]=='admin.makeStats.getList' or
+           $_REQUEST[GPC_AJAX]=='admin.makeStats.doAnalyze' or
+           $_REQUEST[GPC_AJAX]=='admin.makeStats.consolidate' or
+           $_REQUEST[GPC_AJAX]=='admin.showStats.getListTags' or
+           $_REQUEST[GPC_AJAX]=='admin.showStats.getListImages' or
+           $_REQUEST[GPC_AJAX]=='admin.updateTag.select' or
+           $_REQUEST[GPC_AJAX]=='admin.config.setOption' or
+           $_REQUEST[GPC_AJAX]=='admin.group.getList' or
+           $_REQUEST[GPC_AJAX]=='admin.group.delete' or
+           $_REQUEST[GPC_AJAX]=='admin.group.getNames' or
+           $_REQUEST[GPC_AJAX]=='admin.group.setNames' or
+           $_REQUEST[GPC_AJAX]=='admin.group.setOrder' or
+           $_REQUEST[GPC_AJAX]=='admin.group.getTagList' or
+           $_REQUEST[GPC_AJAX]=='admin.group.setTagList' or
+           $_REQUEST[GPC_AJAX]=='admin.group.getOrderedTagList' or
+           $_REQUEST[GPC_AJAX]=='admin.group.setOrderedTagList' or
+           $_REQUEST[GPC_AJAX]=='admin.userDefined.getList' or
+           $_REQUEST[GPC_AJAX]=='admin.userDefined.getTag' or
+           $_REQUEST[GPC_AJAX]=='admin.userDefined.setTag' or
+           $_REQUEST[GPC_AJAX]=='admin.userDefined.deleteTag' or
+           $_REQUEST[GPC_AJAX]=='admin.tag.getValues' or
+           $_REQUEST[GPC_AJAX]=='admin.tags.getKeywords' or
+           $_REQUEST[GPC_AJAX]=='admin.tags.convertKeywords' or
+
+           $_REQUEST[GPC_AJAX]=='public.makeStats.doPictureAnalyze')) $_REQUEST[GPC_AJAX]='';
+
+      if(preg_match('/^admin\./i', $_REQUEST[GPC_AJAX]) and !is_admin()) $_REQUEST[GPC_AJAX]='';
+
+      if($_REQUEST[GPC_AJAX]!='')
       {
         /*
          * check admin.makeStats.getList values
          */
-        if($_REQUEST['ajaxfct']=="admin.makeStats.getList")
+        if($_REQUEST[GPC_AJAX]=="admin.makeStats.getList")
         {
           if(!isset($_REQUEST['selectMode'])) $_REQUEST['selectMode']="caddieAdd";
@@ -117,5 +115,5 @@
                preg_match('/^\d+$/', $_REQUEST['numOfRandomItems'])==0
               )
-            ) $_REQUEST['ajaxfct']='';
+            ) $_REQUEST[GPC_AJAX]='';
 
 
@@ -128,5 +126,5 @@
          * check admin.makeStats.doAnalyze values
          */
-        if($_REQUEST['ajaxfct']=="admin.makeStats.doAnalyze")
+        if($_REQUEST[GPC_AJAX]=="admin.makeStats.doAnalyze")
         {
           if(!isset($_REQUEST['imagesList'])) $_REQUEST['imagesList']="";
@@ -136,5 +134,5 @@
          * check admin.makeStats.consolidate values
          */
-        if($_REQUEST['ajaxfct']=="admin.makeStats.consolidate")
+        if($_REQUEST[GPC_AJAX]=="admin.makeStats.consolidate")
         {
           if(!isset($_REQUEST['step'])) $_REQUEST['step']="*";
@@ -144,5 +142,5 @@
          * check admin.showStats.getListTags values
          */
-        if($_REQUEST['ajaxfct']=="admin.showStats.getListTags")
+        if($_REQUEST[GPC_AJAX]=="admin.showStats.getListTags")
         {
           if(!isset($_REQUEST['orderType'])) $_REQUEST['orderType']="tag";
@@ -180,5 +178,5 @@
          * check admin.showStats.getListImages values
          */
-        if($_REQUEST['ajaxfct']=="admin.showStats.getListImages")
+        if($_REQUEST[GPC_AJAX]=="admin.showStats.getListImages")
         {
           if(!isset($_REQUEST['orderType'])) $_REQUEST['orderType']="num";
@@ -193,5 +191,5 @@
          * check admin.updateTag.select values
          */
-        if($_REQUEST['ajaxfct']=="admin.updateTag.select")
+        if($_REQUEST[GPC_AJAX]=="admin.updateTag.select")
         {
           if(!isset($_REQUEST['numId'])) $_REQUEST['numId']="";
@@ -203,8 +201,8 @@
          * check admin.config.setOption values
          */
-        if($_REQUEST['ajaxfct']=="admin.config.setOption")
-        {
-          if(!isset($_REQUEST['id'])) $_REQUEST['ajaxfct']='';
-          if(!isset($_REQUEST['value'])) $_REQUEST['ajaxfct']='';
+        if($_REQUEST[GPC_AJAX]=="admin.config.setOption")
+        {
+          if(!isset($_REQUEST['id'])) $_REQUEST[GPC_AJAX]='';
+          if(!isset($_REQUEST['value'])) $_REQUEST[GPC_AJAX]='';
         }
 
@@ -212,5 +210,5 @@
          * check admin.group.delete values
          */
-        if($_REQUEST['ajaxfct']=="admin.group.delete" and !isset($_REQUEST['id']))
+        if($_REQUEST[GPC_AJAX]=="admin.group.delete" and !isset($_REQUEST['id']))
         {
           $_REQUEST['id']="";
@@ -220,5 +218,5 @@
          * check admin.groupSetOrder values
          */
-        if($_REQUEST['ajaxfct']=="admin.group.setOrder" and !isset($_REQUEST['listGroup']))
+        if($_REQUEST[GPC_AJAX]=="admin.group.setOrder" and !isset($_REQUEST['listGroup']))
         {
           $_REQUEST['listGroup']="";
@@ -228,5 +226,5 @@
          * check admin.group.getNames values
          */
-        if($_REQUEST['ajaxfct']=="admin.group.getNames" and !isset($_REQUEST['id']))
+        if($_REQUEST[GPC_AJAX]=="admin.group.getNames" and !isset($_REQUEST['id']))
         {
           $_REQUEST['id']="";
@@ -236,5 +234,5 @@
          * check admin.group.setNames values
          */
-        if($_REQUEST['ajaxfct']=="admin.group.setNames")
+        if($_REQUEST[GPC_AJAX]=="admin.group.setNames")
         {
           if(!isset($_REQUEST['listNames'])) $_REQUEST['listNames']="";
@@ -246,5 +244,5 @@
          * check admin.group.getTagList values
          */
-        if($_REQUEST['ajaxfct']=="admin.group.getTagList" and !isset($_REQUEST['id']))
+        if($_REQUEST[GPC_AJAX]=="admin.group.getTagList" and !isset($_REQUEST['id']))
         {
           $_REQUEST['id']="";
@@ -254,5 +252,5 @@
          * check admin.group.setTagList values
          */
-        if($_REQUEST['ajaxfct']=="admin.group.setTagList")
+        if($_REQUEST[GPC_AJAX]=="admin.group.setTagList")
         {
           if(!isset($_REQUEST['id'])) $_REQUEST['id']="";
@@ -264,5 +262,5 @@
          * check admin.group.getOrderedTagList values
          */
-        if($_REQUEST['ajaxfct']=="admin.group.getOrderedTagList" and !isset($_REQUEST['id']))
+        if($_REQUEST[GPC_AJAX]=="admin.group.getOrderedTagList" and !isset($_REQUEST['id']))
         {
           $_REQUEST['id']="";
@@ -272,5 +270,5 @@
          * check admin.group.setOrderedTagList values
          */
-        if($_REQUEST['ajaxfct']=="admin.group.setOrderedTagList")
+        if($_REQUEST[GPC_AJAX]=="admin.group.setOrderedTagList")
         {
           if(!isset($_REQUEST['id'])) $_REQUEST['id']="";
@@ -282,5 +280,5 @@
          * check admin.userDefined.getTag values
          */
-        if($_REQUEST['ajaxfct']=="admin.userDefined.getTag" and !isset($_REQUEST['id']))
+        if($_REQUEST[GPC_AJAX]=="admin.userDefined.getTag" and !isset($_REQUEST['id']))
         {
           $_REQUEST['id']="";
@@ -290,5 +288,5 @@
          * check admin.userDefined.setTag values
          */
-        if($_REQUEST['ajaxfct']=="admin.userDefined.setTag")
+        if($_REQUEST[GPC_AJAX]=="admin.userDefined.setTag")
         {
           if(!isset($_REQUEST['id'])) $_REQUEST['id']="";
@@ -302,5 +300,5 @@
                 )
               )
-            ) $_REQUEST['ajaxfct']='';
+            ) $_REQUEST[GPC_AJAX]='';
 
           if(isset($_REQUEST['properties']['rules']))
@@ -312,5 +310,5 @@
                    isset($val['parentId']) and
                    isset($val['type']) and
-                   isset($val['defId']))) $_REQUEST['ajaxfct']='';
+                   isset($val['defId']))) $_REQUEST[GPC_AJAX]='';
             }
           }
@@ -320,5 +318,5 @@
          * check admin.userDefined.deleteTag values
          */
-        if($_REQUEST['ajaxfct']=="admin.userDefined.deleteTag" and !isset($_REQUEST['id']))
+        if($_REQUEST[GPC_AJAX]=="admin.userDefined.deleteTag" and !isset($_REQUEST['id']))
         {
           $_REQUEST['id']="";
@@ -329,7 +327,7 @@
          * check admin.tag.getValues values
          */
-        if($_REQUEST['ajaxfct']=="admin.tag.getValues" and !isset($_REQUEST['id']))
-        {
-          $_REQUEST['ajaxfct']='';
+        if($_REQUEST[GPC_AJAX]=="admin.tag.getValues" and !isset($_REQUEST['id']))
+        {
+          $_REQUEST[GPC_AJAX]='';
         }
 
@@ -337,9 +335,9 @@
          * check admin.tags.convertKeywords values
          */
-        if($_REQUEST['ajaxfct']=="admin.tags.convertKeywords")
+        if($_REQUEST[GPC_AJAX]=="admin.tags.convertKeywords")
         {
           if(!isset($_REQUEST['keywords'])) $_REQUEST['keywords']=array();
           if(!is_array($_REQUEST['keywords'])) $_REQUEST['keywords']=array();
-          if(count($_REQUEST['keywords'])==0) $_REQUEST['ajaxfct']='';
+          if(count($_REQUEST['keywords'])==0) $_REQUEST[GPC_AJAX]='';
         }
 
@@ -351,5 +349,5 @@
          * check public.makeStats.doPictureAnalyze values
          */
-        if($_REQUEST['ajaxfct']=="public.makeStats.doPictureAnalyze")
+        if($_REQUEST[GPC_AJAX]=="public.makeStats.doPictureAnalyze")
         {
           if(!isset($_REQUEST['id'])) $_REQUEST['id']="0";
@@ -365,5 +363,5 @@
     {
       $result="<p class='errors'>An error has occured</p>";
-      switch($_REQUEST['ajaxfct'])
+      switch($_REQUEST[GPC_AJAX])
       {
         case 'admin.makeStats.getList':
Index: /extensions/AMetaData/amd_clear.css
===================================================================
--- /extensions/AMetaData/amd_clear.css	(revision 16007)
+++ /extensions/AMetaData/amd_clear.css	(revision 16007)
@@ -0,0 +1,38 @@
+#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; }
+li.groupItems table.tagListOrderItem span.listMove,
+li.groupItems span.listMove {
+  display:inline-block;
+  position:relative;
+  width:15px;
+  height:15px;
+  background:url(./../GrumPluginClasses/icons/buttons.png) transparent no-repeat -285px -90px;
+}
+li.groupItems table.tagListOrderItem:hover span.listMove,
+li.groupItems:hover span.listMove {
+  background-position:-285px -105px;
+}
+span.buttonEdit {
+  background-position:-240px -90px;
+}
+span.buttonDelete {
+  background-position:-255px -90px;
+}
+span.buttonEdit:hover {
+  background-position:-240px -105px;
+}
+span.buttonDelete:hover {
+  background-position:-255px -105px;
+}
+span.buttonPreferences {
+  background-position:-330px -90px;
+}
+span.buttonPreferences:hover {
+  background-position:-330px -105px;
+}
+span.buttonMove{
+  background-position:-285px -90px;
+}
+span.buttonMove:hover {
+  background-position:-285px -105px;
+}
Index: /extensions/AMetaData/amd_pip.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_pip.class.inc.php	(revision 16006)
+++ /extensions/AMetaData/amd_pip.class.inc.php	(revision 16007)
@@ -48,5 +48,5 @@
   public function initEvents()
   {
-    parent::initEvents();
+    //parent::initEvents();
     add_event_handler('loc_begin_picture', array(&$this, 'loadMetadata'));
     add_event_handler('loc_end_page_tail', array(&$this, 'applyJS'));
@@ -209,8 +209,8 @@
       $userDefined=preg_match('/^userDefined\./i', $key);
 
-      if(($group!=$tagProperties['gName']) and
+      if(($group!='AMD'.$tagProperties['groupId']) and
          ( $keyExist or $userDefined) )
       {
-        $group=$tagProperties['gName'];
+        $group='AMD'.$tagProperties['groupId'];
         if(!isset($metadata[$group]))
         {
@@ -272,4 +272,5 @@
       );
 
+      GPCCore::setTemplateToken();
       $template->assign('datas', $datas);
       $template->append('footer_elements', $template->parse('applyJS', true));
Index: /extensions/AMetaData/amd_rb_callback.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_rb_callback.class.inc.php	(revision 16006)
+++ /extensions/AMetaData/amd_rb_callback.class.inc.php	(revision 16007)
@@ -22,7 +22,10 @@
 
   if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+  if(!defined('JPEG_METADATA_DIR')) define('JPEG_METADATA_DIR', dirname(__FILE__)."/JpegMetaData/");
 
   //include_once('')
   include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php');
+  include_once(PHPWG_PLUGINS_PATH.'AMetaData/JpegMetaData/Common/Const.class.php');
+  include_once(PHPWG_PLUGINS_PATH.'AMetaData/JpegMetaData/Common/L10n.class.php');
 
   load_language('plugin.lang', AMD_PATH);
Index: /extensions/AMetaData/amd_roma.css
===================================================================
--- /extensions/AMetaData/amd_roma.css	(revision 16007)
+++ /extensions/AMetaData/amd_roma.css	(revision 16007)
@@ -0,0 +1,38 @@
+#iListTags.roma table tr:hover { cursor:pointer; background:#303030; }
+#iListImages.roma table tr:hover, table.roma tr:hover { background:#303030; cursor:default; }
+li.groupItems table.tagListOrderItem span.listMove,
+li.groupItems span.listMove {
+  display:inline-block;
+  position:relative;
+  width:15px;
+  height:15px;
+  background:url(./../GrumPluginClasses/icons/buttons.png) transparent no-repeat -285px -15px;
+}
+li.groupItems table.tagListOrderItem:hover span.listMove,
+li.groupItems:hover span.listMove {
+  background-position:-285px 0px;
+}
+span.buttonEdit {
+  background-position:-240px -15px;
+}
+span.buttonDelete {
+  background-position:-255px -15px;
+}
+span.buttonEdit:hover {
+  background-position:-240px 0px;
+}
+span.buttonDelete:hover {
+  background-position:-255px 0px;
+}
+span.buttonPreferences {
+  background-position:-330px -15px;
+}
+span.buttonPreferences:hover {
+  background-position:-330px -0px;
+}
+span.buttonMove{
+  background-position:-285px -15px;
+}
+span.buttonMove:hover {
+  background-position:-285px 0px;
+}
Index: /extensions/AMetaData/amd_root.class.inc.php
===================================================================
--- /extensions/AMetaData/amd_root.class.inc.php	(revision 16006)
+++ /extensions/AMetaData/amd_root.class.inc.php	(revision 16007)
@@ -22,5 +22,4 @@
 
 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
-include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
 include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCRequestBuilder.class.inc.php');
 
@@ -31,5 +30,4 @@
 class AMD_root extends CommonPlugin
 {
-  protected $css;   //the css object
   protected $jpegMD;
 
@@ -53,5 +51,4 @@
     $this->setTablesList($tableList);
 
-    $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
     $this->jpegMD=new AMD_JpegMetaData();
 
@@ -65,5 +62,4 @@
   {
     unset($this->jpegMD);
-    unset($this->css);
     //parent::__destruct();
   }
@@ -120,13 +116,15 @@
   }
 
-  public function loadConfig()
-  {
-    parent::loadConfig();
-  }
-
-  public function initEvents()
-  {
-    parent::initEvents();
-  }
+  public function loadCSS()
+  {
+    global $template;
+
+    parent::loadCSS();
+
+    GPCCore::addUI('gpcCSS');
+    GPCCore::addHeaderCSS('amm.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css");
+    GPCCore::addHeaderCSS('amm.cssT', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().'_'.$template->get_themeconf('name').".css");
+  }
+
 
   public function getAdminLink($mode='')
@@ -794,4 +792,5 @@
     }
 
+    GPCCore::setTemplateToken();
     $template->assign('datas', $datas);
     unset($data);
Index: /extensions/AMetaData/main.inc.php
===================================================================
--- /extensions/AMetaData/main.inc.php	(revision 16006)
+++ /extensions/AMetaData/main.inc.php	(revision 16007)
@@ -282,21 +282,24 @@
 
 
-if(defined('IN_ADMIN'))
+if(!defined('AJAX_CALL'))
 {
-  //AMD admin part loaded and active only if in admin page
-  include_once("amd_aim.class.inc.php");
-  $obj = new AMD_AIM($prefixeTable, __FILE__);
-  $obj->initEvents();
-  set_plugin_data($plugin['id'], $obj);
-}
-else
-{
-  //AMD public part loaded and active only if in public page and if GPC is up to date
-  if(CommonPlugin::checkGPCRelease(3,3,2))
+  if(defined('IN_ADMIN'))
   {
-    include_once("amd_pip.class.inc.php");
-    $obj = new AMD_PIP($prefixeTable, __FILE__);
+    //AMD admin part loaded and active only if in admin page
+    include_once("amd_aim.class.inc.php");
+    $obj = new AMD_AIM($prefixeTable, __FILE__);
+    $obj->initEvents();
     set_plugin_data($plugin['id'], $obj);
   }
+  else
+  {
+    //AMD public part loaded and active only if in public page and if GPC is up to date
+    if(CommonPlugin::checkGPCRelease(AMD_GPC_NEEDED) and !mobile_theme())
+    {
+      include_once("amd_pip.class.inc.php");
+      $obj = new AMD_PIP($prefixeTable, __FILE__);
+      set_plugin_data($plugin['id'], $obj);
+    }
+  }
 }
 
Index: /extensions/AMetaData/templates/amd_dialog_metadata_choose.tpl
===================================================================
--- /extensions/AMetaData/templates/amd_dialog_metadata_choose.tpl	(revision 16006)
+++ /extensions/AMetaData/templates/amd_dialog_metadata_choose.tpl	(revision 16007)
@@ -554,5 +554,5 @@
         url: "{/literal}{$datas.urlRequest}{literal}",
         async: true,
-        data: { ajaxfct:"admin.tag.getValues", id:metaId },
+        data: { ajaxfct:"admin.tag.getValues", token:'{/literal}{$token}{literal}', id:metaId },
         success:
           function(msg)
Index: /extensions/AMetaData/templates/doAnalyze.tpl
===================================================================
--- /extensions/AMetaData/templates/doAnalyze.tpl	(revision 16006)
+++ /extensions/AMetaData/templates/doAnalyze.tpl	(revision 16007)
@@ -6,5 +6,5 @@
       url: "{/literal}{$datas.urlRequest}{literal}",
       async: true,
-      data: { ajaxfct:"public.makeStats.doPictureAnalyze", id:{/literal}{$datas.id}{literal} }
+      data: { ajaxfct:"public.makeStats.doPictureAnalyze", token:'{/literal}{$token}{literal}', id:{/literal}{$datas.id}{literal} }
     }
   );
