Index: /extensions/set_plugins/admin.php
===================================================================
--- /extensions/set_plugins/admin.php	(revision 11072)
+++ /extensions/set_plugins/admin.php	(revision 11072)
@@ -0,0 +1,62 @@
+<?php
+// Chech whether we are indeed included by Piwigo.
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Fetch the template.
+global $template;
+           $redirect_url = get_root_url().'admin.php?page='.'plugins_list';
+             redirect($redirect_url);
+include_once(SET_PLUGINS_PATH."include/constants.php"); 	   
+include_once(SET_PLUGINS_PATH.'include/affiche.php');
+
+
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+$tabsheet = new tabsheet();
+$tabsheet->add( 'set_plugins_admin',
+                l10n('admin'),
+                $my_base_url.'&amp;tab=set_plugins_admin'
+			   );
+ /*	
+$tabsheet->add( 'set_plugins_help',
+                l10n('help'),
+                $my_base_url.'&amp;tab=set_plugins_help'
+			   );
+			   
+	*/	   
+			   
+	if (!isset($_GET['tab']))
+	   $page['tab'] = 'set_plugins_admin';
+else
+       $page['tab'] = $_GET['tab'];	
+	   
+	   		   
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+//======================================================================
+// Add our template to the global template
+$template->set_filenames(
+  array(
+    'plugin' => dirname(__FILE__).'/admin.tpl'
+  )         
+);
+
+//===============================================================================
+ if(isset($activate)){
+                    $template->assign( array(  
+                        'U_ACTION' => $activate
+											)
+									);	
+
+                  }
+
+                    $page['tab'] = 'plugins_list';
+
+           //       "admin.php?page=plugins_list"
+
+
+// Assign the template contents to ADMIN_CONTENT
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin');
+?>
Index: /extensions/set_plugins/admin.tpl
===================================================================
--- /extensions/set_plugins/admin.tpl	(revision 11072)
+++ /extensions/set_plugins/admin.tpl	(revision 11072)
@@ -0,0 +1,13 @@
+<!-- Show the title of the plugin -->
+<div class="titlePage">
+  <h2>{'set_plugins'|@translate} {'Version'|@translate} {$cl_version}</h2>
+</div>
+<fieldset>
+  <legend>{'command'|@translate}</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}" /> 
+  </form>
+</fieldset>
+
Index: /extensions/set_plugins/include/affiche.php
===================================================================
--- /extensions/set_plugins/include/affiche.php	(revision 11072)
+++ /extensions/set_plugins/include/affiche.php	(revision 11072)
@@ -0,0 +1,23 @@
+<?php  
+//=================================================================================================
+global $conf ;
+$nb="10";
+if (isset($conf['set_plugins']))
+$set_plugins_parametres =  unserialize($conf['set_plugins']);
+if(isset($set_plugins_parametres) && $set_plugins_parametres['nb'])
+$nb=$set_plugins_parametres['nb'];
+
+$set=isset($_POST['set'])?$_POST['set']:"true";
+$nb=isset($_POST['nb'])?$_POST['nb']:$nb ;
+
+
+                   $template->assign( array( 
+                   'nb' => isset($_POST['nb'])?$_POST['nb']:$nb,
+                        '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
+											)
+									);	        
+?>
Index: /extensions/set_plugins/include/constants.php
===================================================================
--- /extensions/set_plugins/include/constants.php	(revision 11072)
+++ /extensions/set_plugins/include/constants.php	(revision 11072)
@@ -0,0 +1,46 @@
+<?php
+global $prefixeTable;
+if (!defined('CL_SET_PLUGINS_TABLE')) define('CL_SET_PLUGINS_TABLE', $prefixeTable.'cl_set_plugins');
+		$path = SET_PLUGINS_PATH;
+          $plg_data = implode( '', file($path.'main.inc.php') );
+          if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
+          {
+            $set_plugins_plugin['name'] = trim( $val[1] );
+          }
+          if (preg_match("|Version: (.*)|", $plg_data, $val))
+          {
+            $set_plugins_plugin['version'] = trim($val[1]);
+          }
+          if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
+          {
+            $set_plugins_plugin['uri'] = trim($val[1]);
+          }
+          if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
+          {
+            $set_plugins_plugin['description'] = trim($desc);
+          }
+          elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
+          {
+            $set_plugins_plugin['description'] = trim($val[1]);
+          }
+          if ( preg_match("|Author: (.*)|", $plg_data, $val) )
+          {
+            $set_plugins_plugin['author'] = trim($val[1]);
+          }
+          if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
+          {
+            $set_plugins_plugin['author uri'] = trim($val[1]);
+          }
+          if (!empty($set_plugins_plugin['uri']) and strpos($set_plugins_plugin['uri'] , 'extension_view.php?eid='))
+          {
+            list( , $extension) = explode('extension_view.php?eid=', $set_plugins_plugin['uri']);
+            if (is_numeric($extension)) $set_plugins_plugin['extension'] = $extension;
+          }
+          // IMPORTANT SECURITY !
+          $set_plugins_plugin = array_map('htmlspecialchars', $set_plugins_plugin);
+
+global $cl_set_plugins_plugin, $cl_set_plugins_version;
+ $cl_set_plugins_version = $set_plugins_plugin['version'] ;
+ $cl_set_plugins_plugin  = $set_plugins_plugin;
+ 
+?>
Index: /extensions/set_plugins/include/index.php
===================================================================
--- /extensions/set_plugins/include/index.php	(revision 11072)
+++ /extensions/set_plugins/include/index.php	(revision 11072)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/set_plugins/index.php
===================================================================
--- /extensions/set_plugins/index.php	(revision 11072)
+++ /extensions/set_plugins/index.php	(revision 11072)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/set_plugins/language/en_UK/description.txt
===================================================================
--- /extensions/set_plugins/language/en_UK/description.txt	(revision 11072)
+++ /extensions/set_plugins/language/en_UK/description.txt	(revision 11072)
@@ -0,0 +1,1 @@
+set or unset all plugins
Index: /extensions/set_plugins/language/en_UK/index.php
===================================================================
--- /extensions/set_plugins/language/en_UK/index.php	(revision 11072)
+++ /extensions/set_plugins/language/en_UK/index.php	(revision 11072)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/set_plugins/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/set_plugins/language/en_UK/plugin.lang.php	(revision 11072)
+++ /extensions/set_plugins/language/en_UK/plugin.lang.php	(revision 11072)
@@ -0,0 +1,4 @@
+<?php
+$lang['set_plugins']="set / unset plugins";
+$lang['command']="command";
+?>
Index: /extensions/set_plugins/language/fr_FR/description.txt
===================================================================
--- /extensions/set_plugins/language/fr_FR/description.txt	(revision 11072)
+++ /extensions/set_plugins/language/fr_FR/description.txt	(revision 11072)
@@ -0,0 +1,1 @@
+ Active/déactive tous les plugins installés.
Index: /extensions/set_plugins/language/fr_FR/index.php
===================================================================
--- /extensions/set_plugins/language/fr_FR/index.php	(revision 11072)
+++ /extensions/set_plugins/language/fr_FR/index.php	(revision 11072)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/set_plugins/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/set_plugins/language/fr_FR/plugin.lang.php	(revision 11072)
+++ /extensions/set_plugins/language/fr_FR/plugin.lang.php	(revision 11072)
@@ -0,0 +1,4 @@
+<?php
+$lang['set_plugins']="active / déactive les plugins";
+$lang['command']="commande";
+?>
Index: /extensions/set_plugins/language/index.php
===================================================================
--- /extensions/set_plugins/language/index.php	(revision 11072)
+++ /extensions/set_plugins/language/index.php	(revision 11072)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/set_plugins/main.inc.php
===================================================================
--- /extensions/set_plugins/main.inc.php	(revision 11072)
+++ /extensions/set_plugins/main.inc.php	(revision 11072)
@@ -0,0 +1,108 @@
+<?php 
+/*
+Version: 1.0
+Plugin Name: set_plugin
+Plugin URI: 
+Author: cljosse
+Description: Active/déactive tous les plugins installés.
+*/
+
+// Chech whether we are indeed included by Piwigo.
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+// Define the path to our plugin.
+define('SET_PLUGINS_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
+load_language('plugin.lang', SET_PLUGINS_PATH);
+// Hook on to an event to show the administration page.
+add_event_handler('get_admin_plugin_menu_links', 'set_plugins_admin_menu');
+
+// Add an entry to the 'Plugins' menu.
+function set_plugins_admin_menu($menu) {
+  array_push(
+    $menu,
+    array(
+      'NAME'  => 'Set_plugins',
+      'URL'   => get_admin_plugin_menu_link(dirname(__FILE__)).'/admin.php'
+    )
+  );
+  return $menu;
+}
+
+add_event_handler('loc_after_page_header','set_plugins_add'); 
+function set_plugins_add() {
+  global $user, $template, $val,$page;
+  if (!isset($page['body_id'])) return;
+
+  switch($page['body_id']){
+	  case  'theAdminPage': 
+    
+      switch($page['page']){
+	 	    case 'plugins_list':	 	
+
+include_once(SET_PLUGINS_PATH."include/constants.php"); 	   
+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!=""){     
+      $query = '
+      UPDATE '.PLUGINS_TABLE.'
+      SET state="'.$val_state.'" 
+      WHERE `state` NOT LIKE "'.$val_state. '" AND id!="' . "set_plugins" . '"
+      LIMIT '.$nb.'
+      ;';
+      pwg_query($query);
+      unset ($_POST); 
+        $redirect_url = get_root_url().'admin.php?page='.$_GET['page'];
+         $config=array();
+             $config = array(
+                          'nb' =>$nb
+                      );
+
+conf_update_param('set_plugins', pwg_db_real_escape_string(serialize($config)));
+
+        redirect($redirect_url);
+    }
+}
+               $template->set_filenames(
+                array(
+                  'plugin' => dirname(__FILE__).'/admin.tpl'
+                )         
+              );
+              $template->set_filenames(
+              array(    'cl_plugin' => dirname(__FILE__).'/admin.tpl'  )         
+              );
+
+ 
+              $bpplus=$template->parse('cl_plugin', true);
+              $template-> assign('ADMIN_CONTENT',$bpplus); 
+              $bpplus=$template->parse('plugins', true);
+              $template-> concat('ADMIN_CONTENT',$bpplus); 
+          	break;
+
+ case 'plugin':	
+
+
+ 	break;
+
+				//==============================================================================
+ 				} 
+  		 
+		break;
+
+
+}
+
+	
+return;
+ }
+
+
+?>
Index: /extensions/set_plugins/maintain.inc.php
===================================================================
--- /extensions/set_plugins/maintain.inc.php	(revision 11072)
+++ /extensions/set_plugins/maintain.inc.php	(revision 11072)
@@ -0,0 +1,39 @@
+function plugin_install()
+{
+ global $conf;
+
+  if (!isset($conf['set_plugins']))
+  {
+    
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+    VALUES ("set_plugins","","set_plugins")
+  ;';
+  pwg_query($q);
+  }
+ 
+ 
+}
+
+
+
+function plugin_uninstall()
+{
+  global $conf;
+  if (isset($conf['set_plugins']))
+  {
+    $q = '
+      DELETE FROM '.CONFIG_TABLE.'
+      WHERE param="set_plugins"
+    ;';
+    pwg_query($q);
+    }
+	// $query = 'DROP TABLE IF EXISTS  '.set_plugins_TABLE.';';
+  //  pwg_query( $query);
+ }
+
+
+function plugin_activate() {
+// Put anything here that should be executed during activation.
+}
+
