Index: /extensions/Histogram/hgram_aip.class.inc.php
===================================================================
--- /extensions/Histogram/hgram_aip.class.inc.php	(revision 16012)
+++ /extensions/Histogram/hgram_aip.class.inc.php	(revision 16013)
@@ -59,6 +59,10 @@
       GPCRequestBuilder::loadJSandCSS();
     }
-    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
-    GPCCss::applyGpcCss();
+  }
+
+  public function loadCSS()
+  {
+    parent::loadCSS();
+    GPCCore::addUI('gpcCSS');
   }
 
Index: /extensions/Histogram/hgram_ajax.php
===================================================================
--- /extensions/Histogram/hgram_ajax.php	(revision 16012)
+++ /extensions/Histogram/hgram_ajax.php	(revision 16013)
@@ -19,8 +19,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
@@ -55,29 +53,27 @@
       global $user;
 
-      if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
-
       // check if asked function is valid
       if(!(
-           $_REQUEST['ajaxfct']=='public.histo.build'
+           $_REQUEST[GPC_AJAX]=='public.histo.build'
           )
-        ) $_REQUEST['ajaxfct']='';
+        ) $_REQUEST[GPC_AJAX]='';
 
 
-      if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']) and !is_admin()) $_REQUEST['ajaxfct']='';
+      if(preg_match('/^admin\./i', $_REQUEST[GPC_AJAX]) and !is_admin()) $_REQUEST[GPC_AJAX]='';
 
-      // check token validity
+      // check token validity - don't use GPCAjax::checkToken() because using an homemade token..
       if(!isset($_REQUEST['token'])) $_REQUEST['token']='';
 
 
 
-      if($_REQUEST['ajaxfct']!='')
+      if($_REQUEST[GPC_AJAX]!='')
       {
         /*
          * check public.histo.build
          */
-        if($_REQUEST['ajaxfct']=="public.histo.build")
+        if($_REQUEST[GPC_AJAX]=="public.histo.build")
         {
-          if(!isset($_REQUEST['id'])) $_REQUEST['ajaxfct']='';
-          if($_REQUEST['token']!=self::getToken($_REQUEST['id'])) $_REQUEST['ajaxfct']='';
+          if(!isset($_REQUEST['id'])) $_REQUEST[GPC_AJAX]='';
+          if($_REQUEST['token']!=self::getToken($_REQUEST['id'])) $_REQUEST[GPC_AJAX]='';
         }
       }
@@ -91,5 +87,5 @@
     {
       $result="<p class='errors'>An error has occured</p>";
-      switch($_REQUEST['ajaxfct'])
+      switch($_REQUEST[GPC_AJAX])
       {
         case 'public.histo.build':
Index: /extensions/Histogram/hgram_root.class.inc.php
===================================================================
--- /extensions/Histogram/hgram_root.class.inc.php	(revision 16012)
+++ /extensions/Histogram/hgram_root.class.inc.php	(revision 16013)
@@ -19,5 +19,4 @@
   include_once('hgram_histogram.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(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
 
@@ -29,6 +28,4 @@
     static public $pluginNameFile='hgram';
     static public $pluginTables=array('histo');
-
-    protected $css;   //the css object
 
     public function __construct($prefixeTable, $filelocation)
@@ -40,26 +37,4 @@
 
       $this->setTablesList(self::$pluginTables);
-
-
-      $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
-    }
-
-    public function __destruct()
-    {
-      unset($this->css);
-      parent::__destruct();
-    }
-
-    public function initEvents()
-    {
-      parent::initEvents();
-      add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );
-    }
-
-    /**
-     * menu block management
-     */
-    public function register_blocks()
-    {
     }
 
Index: /extensions/Histogram/main.inc.php
===================================================================
--- /extensions/Histogram/main.inc.php	(revision 16012)
+++ /extensions/Histogram/main.inc.php	(revision 16013)
@@ -68,21 +68,25 @@
 global $prefixeTable;
 
-if(defined('IN_ADMIN'))
+if(!defined('AJAX_CALL'))
 {
-  // HGram admin interface loaded and active only if in admin page
-  include_once("hgram_aim.class.inc.php");
-  $obj=new HGram_AIM($prefixeTable, __FILE__);
-  $obj->initEvents();
-  set_plugin_data($plugin['id'], $obj);
-}
-else
-{
-  // HGram public interface loaded and active only if in public page
-  include_once("hgram_pip.class.inc.php");
-  $obj=new HGram_PIP($prefixeTable, __FILE__);
-  set_plugin_data($plugin['id'], $obj);
+  if(defined('IN_ADMIN'))
+  {
+    // HGram admin interface loaded and active only if in admin page
+    include_once("hgram_aim.class.inc.php");
+    $obj=new HGram_AIM($prefixeTable, __FILE__);
+    $obj->initEvents();
+    set_plugin_data($plugin['id'], $obj);
+  }
+  else
+  {
+    if(CommonPlugin::checkGPCRelease(HGRAM_GPC_NEEDED) and !mobile_theme())
+    {
+      // HGram public interface loaded and active only if in public page
+      include_once("hgram_pip.class.inc.php");
+      $obj=new HGram_PIP($prefixeTable, __FILE__);
+      set_plugin_data($plugin['id'], $obj);
+    }
+  }
 }
 
-
-
 ?>
