Index: extensions/ASearchEngine/ase_aip.class.inc.php
===================================================================
--- extensions/ASearchEngine/ase_aip.class.inc.php	(revision 15360)
+++ extensions/ASearchEngine/ase_aip.class.inc.php	(revision 16008)
@@ -63,6 +63,13 @@
       GPCRequestBuilder::loadJSandCSS();
     }
-    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
-    GPCCss::applyGpcCss();
+  }
+
+  public function loadCSS()
+  {
+    global $template;
+
+    parent::loadCSS();
+    GPCCore::addUI('gpcCSS');
+    GPCCore::addHeaderCSS('ase.css', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles().".css");
   }
 
@@ -138,7 +145,5 @@
     global $template;
 
-    GPCCore::addHeaderCSS('categorySelector', 'plugins/GrumPluginClasses/css/categorySelector_'.$template->get_themeconf('name').'.css');
-    GPCCore::addHeaderCSS('tagSelector', 'plugins/GrumPluginClasses/css/tagSelector_'.$template->get_themeconf('name').'.css');
-
+    GPCCore::addUI('inputTag,categorySelector');
 
     $template->set_filename('body_page',
Index: extensions/ASearchEngine/ase_ajax.php
===================================================================
--- extensions/ASearchEngine/ase_ajax.php	(revision 15360)
+++ extensions/ASearchEngine/ase_ajax.php	(revision 16008)
@@ -25,8 +25,7 @@
    */
   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
@@ -59,14 +58,14 @@
       global $user;
 
-      if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
+      GPCAjax::checkToken();
 
       // check if asked function is valid
-      if(!($_REQUEST['ajaxfct']=='admin.config.setConfig'
-           )) $_REQUEST['ajaxfct']='';
+      if(!($_REQUEST[GPC_AJAX]=='admin.config.setConfig'
+           )) $_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]='';
 
 
-      if($_REQUEST['ajaxfct']!='')
+      if($_REQUEST[GPC_AJAX]!='')
       {
 
@@ -82,8 +81,7 @@
       $result="<p class='errors'>An error has occured</p>";
 
-      switch($_REQUEST['ajaxfct'])
+      switch($_REQUEST[GPC_AJAX])
       {
         case 'admin.config.setConfig':
-          $result=$this->ajax_gmaps_admin_mapsGetList();
           break;
       }
Index: extensions/ASearchEngine/ase_pip.class.inc.php
===================================================================
--- extensions/ASearchEngine/ase_pip.class.inc.php	(revision 15360)
+++ extensions/ASearchEngine/ase_pip.class.inc.php	(revision 16008)
@@ -23,10 +23,10 @@
   const SEARCH_SECTION = 'ASearch';
   protected $sectionPage;
-  protected $css2;
 
   public function __construct($prefixeTable, $filelocation)
   {
+    global $template;
+
     parent::__construct($prefixeTable, $filelocation);
-    $this->css2 = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles()."2.css",10);
     $this->loadConfig();
 
@@ -72,10 +72,12 @@
 
       add_event_handler('init', array(&$this, 'applyJS'));
-      add_event_handler('loc_begin_page_header', array(&$this->css2, 'applyCSS'), 9); // have to be loaded before other css file (event level from GPCCore=10)
       add_event_handler('user_init', array(&$this, 'load_lang'));
     }
   }
 
-
+  public function loadCSS()
+  {
+    GPCCore::addHeaderCSS('ase.css2', 'plugins/'.$this->getDirectory().'/'.$this->getPluginNameFiles()."2.css",9);  // have to be loaded before other css file (event level from GPCCore=10)
+  }
 
   /* -------------------------------------------------------------------------
@@ -104,4 +106,9 @@
     $file=PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'local/css/ASE'.$theme.'.css';
     if(file_exists(GPCCore::getPiwigoSystemPath().'/'.$file)) GPCCore::addHeaderCSS('ASE2', $file, 45);
+
+/*
+    $template->set_filename('ASEheader', dirname(__FILE__)."/templates/search_page_header.tpl");
+    $template->block_html_head(null, $template->parse('ASEheader', true), null, null);
+    */
   }
 
@@ -116,4 +123,6 @@
     $template->assign('TITLE', $page['title']);
 
+    GPCCore::AddUI('inputTag,categorySelector');
+
     $template->clear_assign(array('U_MODE_CREATED', 'U_MODE_POSTED'));
 
@@ -122,4 +131,10 @@
      * (all content are managed with ajax)
      */
+
+    $template->assign(
+      array(
+        'derivative_params' =>trigger_event('get_index_derivative_params', ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_THUMB) ) )
+      )
+    );
 
     $template->set_filename('ASEmain', dirname(__FILE__)."/templates/search_page.tpl");
Index: extensions/ASearchEngine/ase_root.class.inc.php
===================================================================
--- extensions/ASearchEngine/ase_root.class.inc.php	(revision 15360)
+++ extensions/ASearchEngine/ase_root.class.inc.php	(revision 16008)
@@ -14,10 +14,7 @@
   --------------------------------------------------------------------------- */
   include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
-  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCCss.class.inc.php');
 
   class ASE_root extends CommonPlugin
   {
-    protected $css;
-
     public function __construct($prefixeTable, $filelocation)
     {
@@ -26,6 +23,4 @@
       parent::__construct($prefixeTable, $filelocation);
       $this->section_name=$this->getPluginNameFiles();
-
-      $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
     }
 
@@ -35,7 +30,4 @@
     }
 
-    public function initEvents()
-    {
-    }
 
 
Index: extensions/ASearchEngine/main.inc.php
===================================================================
--- extensions/ASearchEngine/main.inc.php	(revision 15360)
+++ extensions/ASearchEngine/main.inc.php	(revision 16008)
@@ -85,18 +85,21 @@
 global $prefixeTable;
 
-if(defined('IN_ADMIN'))
+if(!defined('AJAX_CALL'))
 {
-  //ASE admin interface loaded and active only if in admin page
-  include_once("ase_aim.class.inc.php");
-  $obj=new ASE_AIM($prefixeTable, __FILE__);
-  $obj->initEvents();
-}
-else
-{
-  if(CommonPlugin::checkGPCRelease(ASE_GPC_NEEDED))
+  if(defined('IN_ADMIN'))
   {
-    //ASE public interface loaded and active only if in public page
-    include_once("ase_pip.class.inc.php");
-    $obj=new ASE_PIP($prefixeTable, __FILE__);
+    //ASE admin interface loaded and active only if in admin page
+    include_once("ase_aim.class.inc.php");
+    $obj=new ASE_AIM($prefixeTable, __FILE__);
+    $obj->initEvents();
+  }
+  else
+  {
+    if(CommonPlugin::checkGPCRelease(ASE_GPC_NEEDED) and !mobile_theme())
+    {
+      //ASE public interface loaded and active only if in public page
+      include_once("ase_pip.class.inc.php");
+      $obj=new ASE_PIP($prefixeTable, __FILE__);
+    }
   }
 }
Index: extensions/ASearchEngine/templates/ase_dialog_category_choose.tpl
===================================================================
--- extensions/ASearchEngine/templates/ase_dialog_category_choose.tpl	(revision 15360)
+++ extensions/ASearchEngine/templates/ase_dialog_category_choose.tpl	(revision 16008)
@@ -1,5 +1,2 @@
-{combine_script id="gpc.categorySelector" path="plugins/GrumPluginClasses/js/ui.categorySelector.js" require='jquery,jquery.ui'}
-{combine_css path="plugins/GrumPluginClasses/css/categorySelector.css"}
-
 {literal}
 <style type='text/css'>
Index: extensions/ASearchEngine/templates/ase_dialog_tag_choose.tpl
===================================================================
--- extensions/ASearchEngine/templates/ase_dialog_tag_choose.tpl	(revision 15360)
+++ extensions/ASearchEngine/templates/ase_dialog_tag_choose.tpl	(revision 16008)
@@ -1,4 +1,2 @@
-{combine_script id="gpc.tagSelector" path="plugins/GrumPluginClasses/js/ui.tagSelector.js" require='jquery,jquery.ui'}
-
 {literal}
 
@@ -48,5 +46,5 @@
               if(checkValidity())
               {
-                dialogOptions.values.tags=$("#iBDTagTags").tagSelector('value');
+                dialogOptions.values.tags=$("#iBDTagTags").inputTag('value');
                 dialogOptions.values.method=$('[name=fBDTagMethod]:checked').val();
 
@@ -72,6 +70,7 @@
     );
 
-    $("#iBDTagTags").tagSelector(
+    $("#iBDTagTags").inputTag(
       {
+        serverUrl:"plugins/GrumPluginClasses/gpc_ajax.php",
         listMaxWidth:400,
         listMaxHeight:350,
@@ -102,5 +101,5 @@
     returned=true;
 
-    if($('#iBDTagTags').tagSelector('numberOfTags')==0)
+    if($('#iBDTagTags').inputTag('numberOfTags')==0)
     {
       $('#iBDTagTags').addClass('error');
@@ -172,5 +171,5 @@
     }
 
-    $("#iBDTagTags").tagSelector('value', 'clear').tagSelector('value', dialogOptions.values.tags);
+    $("#iBDTagTags").inputTag('value', 'clear').inputTag('value', dialogOptions.values.tags);
     $('#iBDTagMethodAND').attr('checked', dialogOptions.values.method=='AND');
     $('#iBDTagMethodOR').attr('checked', dialogOptions.values.method=='OR');
Index: extensions/ASearchEngine/templates/search_page.tpl
===================================================================
--- extensions/ASearchEngine/templates/search_page.tpl	(revision 15360)
+++ extensions/ASearchEngine/templates/search_page.tpl	(revision 16008)
@@ -1,1 +1,9 @@
+{html_style}
+ul.rbResultList li td.rbResultItemImg
+{ldelim}
+  width:{$derivative_params->max_width()}px;
+  height:{$derivative_params->max_height()}px;
+}
+{/html_style}
+
 {$ase_search_page}
Index: extensions/ASearchEngine/themes/Sylvia/ASESylvia.css
===================================================================
--- extensions/ASearchEngine/themes/Sylvia/ASESylvia.css	(revision 15360)
+++ extensions/ASearchEngine/themes/Sylvia/ASESylvia.css	(revision 16008)
@@ -30,7 +30,25 @@
 
 
-.ui-category-selector-arrow { color:#FF3333; }
+.ui-category-selector-arrow {
+  background-image: url("buttons.png");
+  background-position: -30px -30px;
+  background-repeat: no-repeat;
+  border: 0 none;
+  border-radius: 2px 2px 2px 2px;
+}
+.ui-category-selector-arrow:hover {
+  background-position: -30px -15px;
+}
+
 li.ui-category-selector-item:hover, li.ui-tag-selector-list-item:hover { background-color:#303030; }
 .ui-category-selector-selected-item { background-color:#777777; }
+
+li.ui-category-selector-item div { margin:0;}
+li.ui-category-selector-item div.ui-category-selector-name { top:-1px; position:relative;}
+li.ui-category-selector-item div.ui-category-selector-status { margin:1px; }
+#iASECategoryCategory div.ui-category-selector-check {
+  position:relative;
+}
+
 .ui-category-selector-expandable-item { background-image:url(expand.png); }
 .ui-category-selector-collapsable-item { background-image:url(collapse.png); }
@@ -56,8 +74,44 @@
   background:#666666;
 }
-.iconEdit { background:url(edit.png) no-repeat 0 0 transparent; }
-.iconDelete { background:url(delete.png) no-repeat 0 0 transparent; }
-.iconMove { background:url(move.png) no-repeat 0 0 transparent; }
-.iconSwitchCondition  { background:url(switch.png) no-repeat 0 0 transparent; }
+
+
+.iconSwitchCondition,
+.iconMove,
+.iconEdit,
+.iconDelete {
+  background:url(buttons.png) no-repeat 0 0 transparent;
+  -moz-border-radius:2px;
+  -webkit-border-radius:2px;
+  -khtml-border-radius:2px;
+  border-radius:2px;
+}
+
+
+.iconEdit {
+  background-position:-240px -15px;
+}
+.iconDelete {
+  background-position:-255px -15px;
+}
+.iconMove {
+  background-position:-285px -15px;
+}
+.iconSwitchCondition {
+  background-position:-300px -15px;
+}
+.iconEdit:hover {
+  background-position:-240px 0px;
+}
+.iconDelete:hover {
+  background-position:-255px 0px;
+}
+.iconMove:hover {
+  background-position:-285px 0px;
+}
+.iconSwitchCondition:hover {
+  background-position:-300px 0px;
+}
+
+
 .cbItemMultiple { border:1px solid #666666; }
 .cbItemOverGroup { border:1px dotted #666666; }
@@ -97,13 +151,4 @@
 }
 
-.ui-category-selector-arrow {
-  background:none repeat scroll 0 0 #666666;
-  border-color:#999999 #444444 #444444 #999999;
-  color:#FF3363;
-}
-
-.ui-category-selector-arrow-active {
-  border-color:#444444 #999999 #999999 #444444;
-}
 
 
@@ -116,5 +161,5 @@
   background-image:url(sTipArrows.png);
 }
-
+div#iMenuCriterions div#iMenuCItems { margin-left:0px; margin-top:-2px;}
 
 /* AMD specific CSS */
Index: extensions/ASearchEngine/themes/clear/ASEclear.css
===================================================================
--- extensions/ASearchEngine/themes/clear/ASEclear.css	(revision 15360)
+++ extensions/ASearchEngine/themes/clear/ASEclear.css	(revision 16008)
@@ -28,7 +28,18 @@
 .ui-datepicker td:hover { background-color:#EEEEEE; }
 .ui-datepicker td.ui-datepicker-current-day { background-color:#D3D3D3; }
-.ui-category-selector-arrow { color:#005E89; }
+.ui-category-selector-arrow {
+  border: 0 none;
+  border-radius: 2px 2px 2px 2px;
+}
 li.ui-category-selector-item:hover, li.ui-tag-selector-list-item:hover { background-color:#EEEEEE; color:#858460; }
 .ui-category-selector-selected-item { background-color:#D3D3D3; }
+li.ui-category-selector-item div { margin:0;}
+li.ui-category-selector-item div.ui-category-selector-name { top:-1px; position:relative;}
+li.ui-category-selector-item div.ui-category-selector-status { margin:1px; }
+#iASECategoryCategory div.ui-category-selector-check {
+  position:relative;
+}
+
+
 .ui-category-selector-expandable-item { background-image:url(expand.png); }
 .ui-category-selector-collapsable-item { background-image:url(collapse.png); }
@@ -58,5 +69,10 @@
 .cbItemMultiple { border:1px solid #999999; }
 .cbItemOverGroup { border:1px dotted #999999; }
-
+.iconMove, .iconEdit, .iconDelete, .iconSwitchCondition {
+  cursor: pointer;
+  display: inline-block;
+  height: 18px;
+  width: 18px;
+}
 
 
Index: extensions/ASearchEngine/themes/dark/ASEdark.css
===================================================================
--- extensions/ASearchEngine/themes/dark/ASEdark.css	(revision 15360)
+++ extensions/ASearchEngine/themes/dark/ASEdark.css	(revision 16008)
@@ -28,7 +28,18 @@
 .ui-datepicker td:hover { background-color:gray; color:fff48e; }
 .ui-datepicker td.ui-datepicker-current-day { background-color:#505050; color:#fff48e; }
-.ui-category-selector-arrow { color:#000000; }
+.ui-category-selector-arrow {
+  border: 0 none;
+  border-radius: 2px 2px 2px 2px;
+}
 li.ui-category-selector-item:hover, li.ui-tag-selector-list-item:hover  { background-color:gray; color:#fff48e; }
 .ui-category-selector-selected-item { background-color:#505050; color:#fff48e; }
+
+li.ui-category-selector-item div { margin:0;}
+li.ui-category-selector-item div.ui-category-selector-name { top:-1px; position:relative;}
+li.ui-category-selector-item div.ui-category-selector-status { margin:1px; }
+#iASECategoryCategory div.ui-category-selector-check {
+  position:relative;
+}
+
 .ui-category-selector-expandable-item { background-image:url(expand_b.png); }
 .ui-category-selector-collapsable-item { background-image:url(collapse_b.png); }
@@ -61,4 +72,11 @@
 .cbItemMultiple { border:1px solid gray; }
 .cbItemOverGroup { border:1px dotted gray; }
+.iconMove, .iconEdit, .iconDelete, .iconSwitchCondition {
+  cursor: pointer;
+  display: inline-block;
+  height: 18px;
+  width: 18px;
+}
+
 
 .cbButtons { color:#000000; border:1px solid gray; z-index:510; }
@@ -133,4 +151,5 @@
   background-image:url(sTipArrows.png);
 }
+div#iMenuCriterions div#iMenuCItems { margin-left:-1px; margin-top:-2px;}
 
 
Index: extensions/ASearchEngine/themes/elegant/ASEelegant.css
===================================================================
--- extensions/ASearchEngine/themes/elegant/ASEelegant.css	(revision 15360)
+++ extensions/ASearchEngine/themes/elegant/ASEelegant.css	(revision 16008)
@@ -56,8 +56,44 @@
   background:#D3D3D3;
 }
-.iconEdit { background:url(edit.png) no-repeat 0 0 transparent; }
-.iconDelete { background:url(delete.png) no-repeat 0 0 transparent; }
-.iconMove { background:url(move.png) no-repeat 0 0 transparent; }
-.iconSwitchCondition  { background:url(switch.png) no-repeat 0 0 transparent; }
+
+
+.iconSwitchCondition,
+.iconMove,
+.iconEdit,
+.iconDelete {
+  background:url(buttons_gpc.png) no-repeat 0 0 transparent;
+  -moz-border-radius:2px;
+  -webkit-border-radius:2px;
+  -khtml-border-radius:2px;
+  border-radius:2px;
+}
+
+
+.iconEdit {
+  background-position:-240px -15px;
+}
+.iconDelete {
+  background-position:-255px -15px;
+}
+.iconMove {
+  background-position:-285px -15px;
+}
+.iconSwitchCondition {
+  background-position:-300px -15px;
+}
+.iconEdit:hover {
+  background-position:-240px 0px;
+}
+.iconDelete:hover {
+  background-position:-255px 0px;
+}
+.iconMove:hover {
+  background-position:-285px 0px;
+}
+.iconSwitchCondition:hover {
+  background-position:-300px 0px;
+}
+
+
 .cbItemMultiple { border:1px solid #666666; }
 .cbItemOverGroup { border:1px dotted #666666; }
@@ -85,5 +121,12 @@
 
 .ui-category-selector-arrow {
-  color:#005E89;
+  background-image: url("buttons_gpc.png");
+  background-position: -30px -30px;
+  background-repeat: no-repeat;
+  border: 0 none;
+  border-radius: 2px 2px 2px 2px;
+}
+.ui-category-selector-arrow:hover {
+  background-position: -30px -15px;
 }
 
@@ -105,4 +148,10 @@
 }
 
+li.ui-category-selector-item div { margin:0;}
+li.ui-category-selector-item div.ui-category-selector-name { top:-1px; position:relative;}
+li.ui-category-selector-item div.ui-category-selector-status { margin:1px; }
+#iASECategoryCategory div.ui-category-selector-check {
+  position:relative;
+}
 
 /* --- */
@@ -120,13 +169,4 @@
 }
 
-.ui-category-selector-arrow {
-  background:none repeat scroll 0 0 #999999;
-  border-color:#DDDDDD #666666 #666666 #DDDDDD;
-  color:#ffffff;
-}
-
-.ui-category-selector-arrow-active {
-  border-color:#666666 #DDDDDD #DDDDDD #666666;
-}
 
 .cSimpleTipContent {
@@ -137,4 +177,10 @@
 .cSimpleTipArrow {
   background-image:url(sTipArrows.png);
+}
+div#iMenuCriterions div#iMenuCItems { margin-left:-1px; margin-top:-1px;}
+
+div.ui-dialog-content li.valueItems {
+  background:#555555;
+  color:#cccccc;
 }
 
