Index: /extensions/lmt/admin/plugin_admin_list.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_list.tpl	(revision 16013)
+++ /extensions/lmt/admin/plugin_admin_list.tpl	(revision 16014)
@@ -12,5 +12,6 @@
             ajaxfct:'admin.img.list',
             numPage:pagenum,
-            filter:$("#filter").val()
+            filter:$("#filter").val(),
+            token:'{/literal}{$token}{literal}'
           },
         url: "{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}",
Index: /extensions/lmt/admin/plugin_admin_manage.tpl
===================================================================
--- /extensions/lmt/admin/plugin_admin_manage.tpl	(revision 16013)
+++ /extensions/lmt/admin/plugin_admin_manage.tpl	(revision 16014)
@@ -18,5 +18,6 @@
           {
             ajaxfct:'admin.manage.list',
-            numPage:pagenum
+            numPage:pagenum,
+            token:'{/literal}{$token}{literal}'
           },
         url: "{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}",
Index: /extensions/lmt/lmt_aip.class.inc.php
===================================================================
--- /extensions/lmt/lmt_aip.class.inc.php	(revision 16013)
+++ /extensions/lmt/lmt_aip.class.inc.php	(revision 16014)
@@ -70,10 +70,6 @@
       GPCRequestBuilder::loadJSandCSS();
     }
-
-    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
-    add_event_handler('loc_end_page_header', array(&$this->css_icn, 'applyCSS'));
-
-    GPCCss::applyGpcCss();
-  }
+  }
+
 
   /*
@@ -85,4 +81,5 @@
 
     $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/lmt_admin.tpl");
+    GPCCore::setTemplateToken();
 
     if(!isset($_GET['tab'])) $_GET['tab']='list';
Index: /extensions/lmt/lmt_aip_release.class.inc.php
===================================================================
--- /extensions/lmt/lmt_aip_release.class.inc.php	(revision 16013)
+++ /extensions/lmt/lmt_aip_release.class.inc.php	(revision 16014)
@@ -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/lmt/lmt_ajax.php
===================================================================
--- /extensions/lmt/lmt_ajax.php	(revision 16013)
+++ /extensions/lmt/lmt_ajax.php	(revision 16014)
@@ -25,8 +25,6 @@
  */
 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);
+if(!defined('AJAX_CALL')) define('AJAX_CALL', true);
 
 // the common.inc.php file loads all the main.inc.php plugins files
@@ -60,5 +58,5 @@
     global $user;
 
-    if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
+    GPCAjax::checkToken();
     if(!isset($_REQUEST['errcode'])) $_REQUEST['errcode']='';
 
@@ -198,5 +196,5 @@
           'file' => $row['file'],
           'cat' => $tmpcat,
-          'thumb' => str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::thumb_url(array('id'=>$row['image_id'], 'path'=>$row['path'])))
+          'thumb' => str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::url(IMG_SQUARE, array('id'=>$row['image_id'], 'path'=>$row['path'])))
         );
       }
@@ -290,5 +288,5 @@
           'file' => $row['file'],
           'cat' => $tmpcat,
-          'thumb' => str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::thumb_url(array('id'=>$row['image_id'], 'path'=>$row['path'])))
+          'thumb' => str_replace(PHPWG_ROOT_PATH, './', DerivativeImage::url(IMG_SQUARE, array('id'=>$row['image_id'], 'path'=>$row['path'])))
         );
       }
Index: /extensions/lmt/lmt_pip.class.inc.php
===================================================================
--- /extensions/lmt/lmt_pip.class.inc.php	(revision 16013)
+++ /extensions/lmt/lmt_pip.class.inc.php	(revision 16014)
@@ -46,5 +46,4 @@
     if($this->config['lmt_licence_activated']=='y')
     {
-      add_event_handler('loc_end_page_header', array(&$this->css_icn, 'applyCSS'));
       add_event_handler('loc_end_picture', array(&$this, 'manageLicenceElement'));
 
@@ -56,5 +55,9 @@
   }
 
-
+  public function loadCSS()
+  {
+    //parent::loadCSS();  -- don't call the ancestor!
+    GPCCore::addHeaderCSS('lmt_icn.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles()."_icn.css");
+  }
 
   /* -------------------------------------------------------------------------
@@ -110,9 +113,9 @@
         if($url!="")
         {
-          $text = "<table style='margin:auto;'><tr><td><a href='".$url."'".$target."><img $alternateText class='logo88x31' style='top:-4px;' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></a></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
+          $text = "<table style='margin:auto;'><tr><td><a href='".$url."'".$target."><img $alternateText class='logo88x31' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></a></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
         }
         else
         {
-          $text = "<table style='margin:auto;'><tr><td><img $alternateText class='logo88x31' style='top:-4px;' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
+          $text = "<table style='margin:auto;'><tr><td><img $alternateText class='logo88x31' src='". LMT_PATH."img/".strToLower($licence['licence'])."_88x31.png'></td><td>".$licence['aut_text1']."<br/>".$licence['aut_text2']."</td></tr></table>";
         }
         break;
Index: /extensions/lmt/lmt_root.class.inc.php
===================================================================
--- /extensions/lmt/lmt_root.class.inc.php	(revision 16013)
+++ /extensions/lmt/lmt_root.class.inc.php	(revision 16014)
@@ -14,12 +14,7 @@
   --------------------------------------------------------------------------- */
 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/GPCAjax.class.inc.php');
 
 class LMT_root extends CommonPlugin
 {
-  protected $css;   //the css object
-  protected $css_icn;   //the css object
-
   static public $licences=array('BY', 'BY-ND', 'BY-NC', 'BY-NC-ND', 'BY-NC-SA', 'BY-SA', 'CRIGHT', 'CLEFT', 'CC0', 'PD', 'DEFAULT');
 
@@ -35,31 +30,16 @@
 
     $this->setTablesList(array('images', 'licence_author'));
-
-    $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
-    $this->css_icn = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles()."_icn.css");
-  }
-
-  /**
-   * destructor
-   */
-  public function __destruct()
-  {
-    unset($this->css);
-    unset($this->css_icn);
-    parent::__destruct();
-  }
-
-  public function initEvents()
-  {
-    add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );
-  }
-
-  /**
-   * menu block management
-   */
-  public function register_blocks()
-  {
-  }
-
+  }
+
+
+  public function loadCSS()
+  {
+    global $template;
+
+    parent::loadCSS();
+    GPCCore::addUI('gpcCSS');
+    GPCCore::addHeaderCSS('lmt.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css");
+    GPCCore::addHeaderCSS('lmt_icn.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles()."_icn.css");
+  }
 
   /**
Index: /extensions/lmt/main.inc.php
===================================================================
--- /extensions/lmt/main.inc.php	(revision 16013)
+++ /extensions/lmt/main.inc.php	(revision 16014)
@@ -108,19 +108,22 @@
 global $prefixeTable;
 
-if(defined('IN_ADMIN'))
+if(!defined('AJAX_CALL'))
 {
-  //LMT admin interface loaded and active only if in admin page
-  include_once("lmt_aim.class.inc.php");
-  $obj=new LMT_AIM($prefixeTable, __FILE__);
-  $obj->initEvents();
-}
-else
-{
-  //LMT public interface loaded and active only if in public page
-  if(CommonPlugin::checkGPCRelease(LMT_GPC_NEEDED))
+  if(defined('IN_ADMIN'))
+  {
+    //LMT admin interface loaded and active only if in admin page
+    include_once("lmt_aim.class.inc.php");
+    $obj=new LMT_AIM($prefixeTable, __FILE__);
+    $obj->initEvents();
+  }
+  else
   {
     //LMT public interface loaded and active only if in public page
-    include_once("lmt_pip.class.inc.php");
-    $obj=new LMT_PIP($prefixeTable, __FILE__);
+    if(CommonPlugin::checkGPCRelease(LMT_GPC_NEEDED) and !mobile_theme())
+    {
+      //LMT public interface loaded and active only if in public page
+      include_once("lmt_pip.class.inc.php");
+      $obj=new LMT_PIP($prefixeTable, __FILE__);
+    }
   }
 }
