Index: /extensions/set_plugins/admin.tpl
===================================================================
--- /extensions/set_plugins/admin.tpl	(revision 11275)
+++ /extensions/set_plugins/admin.tpl	(revision 11276)
@@ -10,69 +10,68 @@
 {else}
  var no_affiche = false;
- {/if}
+{/if}
 </script> 
-<div>   
+{if !isset($liste_plugins)}
+<div class="infos"></div> 
+<div class="errors"></div> 
+{/if}
 {if isset($liste_plugins)}
 {foreach from=$plugin_states item=plugin_state}
 {if $plugin_state==$state}
-</div> 
 <fieldset >
     <legend>    
-    {if $plugin_state == 'active'} {'Last '|@translate} {'Active Plugins'|@translate}
-    {elseif $plugin_state == 'inactive'} {'Last '|@translate} {'Inactive Plugins'|@translate}
+    {if $plugin_state == 'active'} 
+    {'Last '|@translate} {'Active Plugins'|@translate}
+    {elseif $plugin_state == 'inactive'} 
+    {'Last '|@translate} {'Inactive Plugins'|@translate}
     {/if}
-
-    </legend>
+</legend>
   <form action="{$action}" method="post" name="form_set_plugins" id="form_set_plugins"> 
     <input name="unset_plugins" type="submit" value="{'Deactivate'|@translate}" />
     <input name="set_plugins" type="submit" value="{'Activate'|@translate}" />
     <input name="nb" type="text" value="{$nb}" />
+    <input name="list_visible" id="list_visible" type="hidden" value="{$list_visible}" />
     </form>
   <p>
-</p>
-    {foreach from=$liste_plugins item=plugin name=plugins_loop}
-      {if $plugin.STATE == $plugin_state}
 
-    <div class="pluginBox">
-      <table>
-        <tr>
-          <td name="plugins_name" class="pluginBoxNameCell{if $plugin.INCOMPATIBLE} warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}{/if}">
-            {$plugin.NAME}
-          </td>
-          <td>{$plugin.DESC}</td>
-        </tr>
-        <tr>
-          <td>
-      {if $plugin.STATE == 'active'}
-            <a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
+  {foreach from=$liste_plugins item=plugin name=plugins_loop}
+      <div class="pluginBox" id="{$plugin.NAME}">
+ <table width="100%"  >    <tr>
+<td width="50%" align="left" name="plugins_name" rel="actif" class="pluginBoxNameCell" >
+    {if $plugin.STATE == 'active'}
+{$plugin.NAME}
+{else} 
+{/if}
+</td>        
 
-      {elseif $plugin_state == 'inactive'}
-            <a href="{$plugin.U_ACTION}&amp;action=activate" {if $plugin.INCOMPATIBLE}class="incompatible"{/if}>{'Activate'|@translate}</a>
-            | <a href="{$plugin.U_ACTION}&amp;action=uninstall" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
+        <td width="50%" align="left" name="plugins_name" rel="inactif"  class="pluginBoxNameCell">
+          {if $plugin.STATE == 'inactive'} 
+              {$plugin.NAME} 
+      {else} 
+      {/if} 
+</td>  
+</tr>
+<tr>
 
+        <td width="50%" align="left" rel="actif">
+          {if $plugin.STATE == 'active'}          
+            <a href="{$plugin.U_ACTION}&amp;action=deactivate">
+            {'Deactivate'|@translate}</a>
+          {else} {/if}
+        </td>
+        <td width="50%" align="left" rel="inactif">
+          {if $plugin.STATE == 'inactive'} 
+            <a href="{$plugin.U_ACTION}&amp;action=activate" >{'Activate'|@translate}</a>
+            
+             {else}  {/if}
+        </td>
+      </tr>
+    
+</table> 
 
-      {/if}
-          </td>
-          <td>
-            {'Version'|@translate} {$plugin.VERSION}
-      {if not empty($plugin.AUTHOR)}
-        {if not empty($plugin.AUTHOR_URL)}
-          {assign var='author' value='<a href="%s">%s</a>'|@sprintf:$plugin.AUTHOR_URL:$plugin.AUTHOR}
-        {else}
-          {assign var='author' value=$plugin.AUTHOR}
-        {/if}
-            | {'By %s'|@translate|@sprintf:$author}
-      {/if}
-
-      {if not empty($plugin.VISIT_URL)}
-            | <a class="externalLink" href="{$plugin.VISIT_URL}">{'Visit plugin site'|@translate}</a>
-      {/if}
-          </td>
-        </tr>
-      </table>
-    </div>
-   
-      {/if}
-    {/foreach}
+</div>  
+{/foreach}
+  </p>
+  
   </fieldset>
 {/if}
Index: /extensions/set_plugins/include/affiche.php
===================================================================
--- /extensions/set_plugins/include/affiche.php	(revision 11275)
+++ /extensions/set_plugins/include/affiche.php	(revision 11276)
@@ -1,32 +1,51 @@
 <?php  
 //=================================================================================================
-global $conf ;
-$nb="10";
+global $conf ; 
+global $list_visible, $val_state,$liste_plugins,$nb,$infos_message,$erreur_message,$page;
+
 if (isset($conf['set_plugins']))
 $set_plugins_parametres =  unserialize($conf['set_plugins']);
 
+$nb="10";
 if(isset($set_plugins_parametres) && isset($set_plugins_parametres['nb']))
     $nb=$set_plugins_parametres['nb'];
+    $nb=isset($_POST['nb'])?$_POST['nb']:$nb ;   
+
     $liste=array();
-if(isset($set_plugins_parametres['list']))
-  $liste=$set_plugins_parametres['list'];
+  if(isset($set_plugins_parametres['list']))
+    $liste=$set_plugins_parametres['list'];
+    $liste=isset($_POST['liste'])?$_POST['liste']:$liste ;   
 
+  $state="active";
   if(isset($set_plugins_parametres['state']))
    $state =$set_plugins_parametres['state'];
+   $state=isset($_POST['state'])?$_POST['state']:$state ;   
 
- $state=isset($state)?$state:"active";
+   $list_visible="on,on,on,on";
+     if(isset($set_plugins_parametres['list_visible']))
+      $list_visible =$set_plugins_parametres['list_visible'];
+      $list_visible=(isset($_POST['list_visible']))?$_POST['list_visible']:$list_visible ;
 
-$set=isset($_POST['set'])?$_POST['set']:"true";
- $list="test1,test2,test2";
+  $set=isset($_POST['set'])?$_POST['set']:"true";
 
-  $template->assign( array( 'list'=>$list,
-                   'nb' => isset($_POST['nb'])?$_POST['nb']:$nb,
-                   'state' => $state ,
-                        'set' => $set,                      
-                        'cl_plugins' => $cl_set_plugins_plugin ,
-                        'cl_version' => $cl_set_plugins_plugin['version'] ,
-                        'name' => $cl_set_plugins_plugin['name'] ,
-                        'Version_pwg' => PHPWG_VERSION,
-                        'SET_PLUGINS_PATH' => SET_PLUGINS_PATH
+   $liste_plugins=$set=isset($_POST['liste_plugins'])?$_POST['liste_plugins']:$liste;
+
+
+
+ 
+
+ if (isset($_POST['set']) || isset($_POST['list_visible']) || isset($_POST['nb'])){
+    save_config();
+ }
+  $template->assign( array(  
+                    'nb' => $nb,
+                    'state' => $state ,
+                    'set' => $set,                      
+                    'cl_plugins' => $cl_set_plugins_plugin ,
+                    'cl_version' => $cl_set_plugins_plugin['version'] ,
+                    'name' => $cl_set_plugins_plugin['name'] ,
+                    'Version_pwg' => PHPWG_VERSION,
+                    'SET_PLUGINS_PATH' => SET_PLUGINS_PATH,
+                    'list_visible' => $list_visible
 											)
 									);	         
@@ -48,8 +67,7 @@
 }
 
+//==========================================================
+$liste_tpl=array();
 
-
-$liste_tpl=array();
-//==========================================================
 foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) {   
 //==== test si $plugin_id fait partie de $liste_plugins ==============  
@@ -100,6 +118,39 @@
                          
 											)
-									);	         
-   
+									);	        
+
+//================================================================
+if (!isset($infos_message)){
+		  $infos_message = "";
+		}  		  
+		if  ($infos_message != "")  {
+		   array_push($page['infos'],  $infos_message);
+		   $infos_message="";
+		 }
+		if (!isset($erreur_message)){
+		  $erreur_message = "";
+		} 		 
+		if  ($erreur_message != "")  {
+	
+		  array_push($page['errors'], $erreur_message);
+		  $erreur_message="";
+	
+		 
+		 }		 
+		 
+//================================================================
+function save_config(){
+  global $list_visible, $val_state,$liste_plugins,$nb,$page ;
+  global $infos_message;
+  $infos_message=l10n("save_config");
+  $config=array();
+  $config = array(
+                'list_visible' => $list_visible,
+                'state' => $val_state,
+                'list'=>$liste_plugins,
+                'nb' =>$nb
+            );
+        conf_update_param('set_plugins', pwg_db_real_escape_string(serialize($config)));
+    }
 //==========================================================================================
 ?>
Index: /extensions/set_plugins/js/field_set.js
===================================================================
--- /extensions/set_plugins/js/field_set.js	(revision 11275)
+++ /extensions/set_plugins/js/field_set.js	(revision 11276)
@@ -1,76 +1,143 @@
+jQuery("fieldset").hide();
+jQuery(document).ready(function () {
+  jQuery(window).unload(function () {
+    // jQuery("#form_set_plugins").submit();
+  });
+
+  if (typeof plus_path == "undefined") {
+    var plus_path = './plugins/set_plugins/js/icon/plus.png';
+    var minus_path = './plugins/set_plugins/js/icon/minus.png';
+  }
+  var h_min = 0;
+
+  jQuery(window).load(function () {
+    if (jQuery("fieldset").length >= 1) {
+
+      jQuery("div.titrePage h2").parent().hide();
+
+      var reg = new RegExp("[,]", "g");
+      liste_visible = jQuery("input[name=list_visible]").val();
+      n1 = liste_visible;
+      liste = n1.split(reg);
+      reg = new RegExp("['off']", "g");
+      jQuery("fieldset").each(
+        function (i) {
+
+          id0 = jQuery(this).attr("id");
+          if (id0 == "") jQuery(this).attr("id", "fieldset_" + i);
+          jQuery(this).attr("rel", i);
+
+          if (!jQuery(this).hasClass("field_set"))
+            jQuery(this).addClass("field_set");
 
 
+          if (liste[i] == "off") {
+            liste[i] = "off";
 
-jQuery(document).ready(function () {
-  if (jQuery("fieldset").length >= 1) {
-    jQuery("div .titrePage h2").remove();
+           h_min = jQuery("#" + this.id + ' legend').height();
+            jQuery(this).height(h_min + 5);
 
-    jQuery("fieldset").each(
-              function (i) {
-                id0 = jQuery(this).attr("id");
-                if (id0 == "") jQuery(this).attr("id", "fieldset_" + i);
-                if (!jQuery(this).hasClass("field_set"))
-                  jQuery(this).addClass("field_set");
-                if (i > 0)
-                  jQuery(this).height(0);
-                else
-                  jQuery(this).addClass("visible");
-                jQuery("#" + this.id + ' legend').css('cursor', 'pointer');
-                id0 = jQuery(this).attr("id");
+            jQuery("#" + this.id + ' legend').prepend(
+          '<img alt = "" title = ""' +
+          'src = "' + plus_path + '"' + '>&nbsp;'
+        );
+          } else {
+            liste[i] = "on";
+            jQuery(this).addClass("visible");
+            jQuery("#" + this.id + ' legend').prepend(
+          '<img alt = "" title = ""' +
+          'src = "' + minus_path + '"' + '>&nbsp;'
+        );
+          }
 
-                jQuery("#" + this.id + ' legend').click(function (event) {
-                  n = jQuery(this).parent().hasClass("visible");
-
-                  if (n) {
-                    jQuery(this).parent().height(0);
-                    jQuery(this).parent().removeClass("visible");
-                  }
-                  else {
-                    jQuery(this).parent().css("height", "auto");
-                    jQuery(this).parent().addClass("visible");
-                  }
-                });
-              })
-
-  }
+          jQuery("#" + this.id + ' legend').css('cursor', 'pointer');
 
 
+          id0 = jQuery(this).attr("id");
+          jQuery("#" + id0 + ' legend').click(function (event) {
 
-  jQuery(document).ready(function () {
-    if (jQuery(".field_set").length >= 1)
-      jQuery(".field_set").each(
-                function (i) {
+            n = jQuery(this).parent().hasClass("visible");
+            jQuery(this).css("color", "red");
 
-                  id0 = jQuery(this).attr("id");
+            i = jQuery(jQuery(this).parent()).attr("rel");
+            liste_visible = jQuery("input[name=list_visible]").val();
+            liste = liste_visible.split(",");
+            if (n) {
+              jQuery(this).parent().height(h_min + 5);
+              jQuery(this).parent().removeClass("visible");
+              liste[i] = "off";
+            }
+            else {
+              jQuery(this).parent().css("height", "auto");
+              jQuery(this).parent().addClass("visible");
+              liste[i] = "on";
+            }
 
 
+            val = liste.join(",");
+            jQuery("input[name=list_visible]").val(val);
 
-                });
+            jQuery.ajax({
+              type: "POST",
+              async: true,
+              data: "list_visible=" + val,
+              success: function (msg) {
+                jQuery("#form_set_plugins").submit();
+              }
+            });
 
-  });
+          }); // click
 
 
+        }); //each
+      var liste_action = { active: "", deactive: "" };
+
+      jQuery(".pluginBox a").each(
+        function (i) {
+          jQuery(this).click(function (event) {
+            jQuery(this).css("color", "red");
+            action = jQuery(this).attr('rel');
+            if (action == "Deactivate")
+              liste_plugins = jQuery(this).parent().parent().text();
+            else if (action == "Activate")
+              liste_plugins = jQuery(this).parent().parent().text();
+
+          }); // click
+
+        }); //each
+
+      jQuery("input[name=list_visible]").val(liste.join(","));
+      jQuery("fieldset").show();
+    } // fielset
+    //====================================================================
+    jQuery("td a").click(function (event) {
+      l1 = jQuery('#liste').text();
+      l = l1.split(new RegExp("\n", "g"));
+
+      list = jQuery('liste_plugins');
+
+      var reg = new RegExp("[?]", "g");
+      ret_args = new Array;
+      var args = event.target.href.split(reg)[1];
+      reg = new RegExp("[&]", "g");
+      var tableau = args.split(reg);
+      for (i = 0; i < tableau.length; i++) {
+        vals = tableau[i].split("=");
+        ret_args[vals[0]] = vals[1];
+      }
+      if (ret_args['action'] == "deactivate") {
+
+        list = jQuery('list');
+        n = 1;
+      } else if (ret_args['action'] == "activate") {
+
+        list = jQuery('liste_plugins');
+        n = 0;
+      }
 
 
+    })
 
-
-  jQuery("td a").click(function (event) {
-    l1 = jQuery('td[name="plugins_name"]');
-
-    var reg = new RegExp("[&]", "g");
-    var tableau = event.target.href.split(reg);
-
-
-    if (event.target.nameProp.match(RegExp("deactivate", "g"))) {
-      n = 1;
-    } else if (event.target.nameProp.match(RegExp("activate", "g"))) {
-      n = 0;
-    }
-
-
-
-  })
-})
-
-             
+  }); // load
+});                     //ready           
            
Index: /extensions/set_plugins/main.inc.php
===================================================================
--- /extensions/set_plugins/main.inc.php	(revision 11275)
+++ /extensions/set_plugins/main.inc.php	(revision 11276)
@@ -51,5 +51,4 @@
  if ($page['tab']!="installed") return ; 
   Affiche_set_plugins();
-
  	break;
 
@@ -70,24 +69,22 @@
   global $user, $template, $val,$page,$conf;
     include_once(SET_PLUGINS_PATH."include/constants.php"); 	   
-    include_once(SET_PLUGINS_PATH.'include/affiche.php');
-    $all_tpl_vars = $template->get_template_vars('plugins');
-  
-    if(!$all_tpl_vars)  return;     
- 
-$val_state="";
 
-if(  isset($_POST['unset_plugins']) || isset($_POST['set_plugins'])  ){
- if(isset($_POST['unset_plugins'])  ) 
+    $all_tpl_vars = $template->get_template_vars('plugins');  
+    if(!$all_tpl_vars)  return;    
+
+    include_once(SET_PLUGINS_PATH.'include/affiche.php');      
+    $val_state=""; 
+    if(  isset($_POST['unset_plugins']) || isset($_POST['set_plugins'])  ){
+     if(isset($_POST['unset_plugins'])  ) 
 		    $val_state='inactive';
       elseif(isset($_POST['set_plugins'])  ) 
         $val_state='active';
-      $nb=isset($_POST['nb'])?$_POST['nb']:$nb ;
-    
+   
+
     if($val_state!=""){  
-    if($val_state=="activate")
-        $sens ="DESC";
-    else
-        $sens="ASC";
-
+      if($val_state=="activate")
+          $sens ="DESC";
+      else
+          $sens="ASC";
     //==== pré-liste ===
       $query = 'SELECT *
@@ -97,8 +94,6 @@
            LIMIT '.$nb.'
       ';
-          $result = pwg_query($query);
-    
-
- 
+          $result = pwg_query($query); 
+       
       $query = '
       UPDATE '.PLUGINS_TABLE.'
@@ -106,33 +101,26 @@
       WHERE `state` NOT LIKE "'.$val_state. '" AND id!="' . "set_plugins" . '"
       ORDER BY `id`  '.$sens.'
-       LIMIT '.$nb.'
-      ;';
+      LIMIT '.$nb.';';
+      pwg_query($query); 
+ //=====================================
 
-       pwg_query($query);
- 
-    $data = array();
-    if($result)
-    while ($row = pwg_db_fetch_assoc($result))
-    {
- 
-     $url =  $row['id'] ;$vers= $row['version'];
-      array_push($data, array('plugin' => $url,'version'=>$vers) );
+      $liste_plugins = array();
+      if($result)
+        while ($row = pwg_db_fetch_assoc($result)) { 
+        
+         $url =  $row['id'] ;
+         $vers= $row['version'];
+         $state=$row['state'];
+         array_push($liste_plugins, array('plugin' => $url,'version'=>$vers,'state' =>$state ) );
+        }    
+  //=====================================       
+        
+       
+        $redirect_url = get_root_url().'admin.php?page='.$_GET['page'];
+        save_config();  
+        unset ($_POST); 
+        redirect($redirect_url);
+      }
     }
-     
-      unset ($_POST); 
-        $redirect_url = get_root_url().'admin.php?page='.$_GET['page'];
-         $config=array();
-             $config = array(
-                          'state' => $val_state,
-                          'list'=>$data,
-                          'nb' =>$nb
-                      );
-
-        conf_update_param('set_plugins', pwg_db_real_escape_string(serialize($config)));
-        redirect($redirect_url);
-    }
-}
- 
-
                $template->set_filenames(
                 array(
