Index: /extensions/Autosize/admin/admin_autosize.php
===================================================================
--- /extensions/Autosize/admin/admin_autosize.php	(revision 6912)
+++ /extensions/Autosize/admin/admin_autosize.php	(revision 6912)
@@ -0,0 +1,187 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!defined('AUTOSIZE_DIR')) define('AUTOSIZE_DIR' , basename(dirname(__FILE__)));
+if (!defined('AUTOSIZE_PATH')) 
+define(
+  'AUTOSIZE_PATH',
+   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
+);
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+//check_status(ACCESS_ADMINISTRATOR);
+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( 'autosize_admin',
+                l10n('admin'),
+                $my_base_url.'&amp;tab=autosize_admin'
+			   );
+		   
+$tabsheet->add( 'autosize_content',
+                l10n('content'),
+                $my_base_url.'&amp;tab=autosize_content'
+			   );
+			   
+			   
+			   
+	if (!isset($_GET['tab']))
+	   $page['tab'] = 'autosize_admin';
+else
+       $page['tab'] = $_GET['tab'];	
+	   
+	   		   
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+$page['global'] = array();
+$error = array();
+
+global $user, $conf, $errors ;
+global $args, $autosizes_message,$erreur_message ;
+
+include_once (AUTOSIZE_PATH.'include/constants.php'); 
+
+$aff_nb=true;
+
+ ; 
+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__);
+load_language('lang', AUTOSIZE_PATH ); 
+// *************************************************************************
+// |                          Sélection de l'onglet                        |
+// *************************************************************************
+$autosizes_message ="";  
+$erreur_message="";
+global $conf;
+global $autosize_parametres;
+global $template,$page,$conf ; 
+    global $picture;
+ 
+  $visible=true;	
+
+        $path = AUTOSIZE_PATH;
+          $plg_data = implode( '', file($path.'main.inc.php') );
+          if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
+          {
+            $plugin['name'] = trim( $val[1] );
+          }
+          if (preg_match("|Version: (.*)|", $plg_data, $val))
+          {
+            $plugin['version'] = trim($val[1]);
+          }
+          if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) )
+          {
+            $plugin['uri'] = trim($val[1]);
+          }
+          if ($desc = load_language('description.txt', $path.'/', array('return' => true)))
+          {
+            $plugin['description'] = trim($desc);
+          }
+          elseif ( preg_match("|Description: (.*)|", $plg_data, $val) )
+          {
+            $plugin['description'] = trim($val[1]);
+          }
+          if ( preg_match("|Author: (.*)|", $plg_data, $val) )
+          {
+            $plugin['author'] = trim($val[1]);
+          }
+          if ( preg_match("|Author URI: (.*)|", $plg_data, $val) )
+          {
+            $plugin['author uri'] = trim($val[1]);
+          }
+          if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid='))
+          {
+            list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']);
+            if (is_numeric($extension)) $plugin['extension'] = $extension;
+          }
+          // IMPORTANT SECURITY !
+          $plugin = array_map('htmlspecialchars', $plugin);
+
+$version = $plugin['version'] ;
+	 $autosize_parametres = cl_autosize_Get_Options();
+
+
+	 
+   if (isset($_POST['submit']))  {  
+	  if ($_POST['submit'] == l10n('Save'))  {  
+	         cl_autosize_sauve_options_inf() ;
+		     unset($_POST); 
+		 }
+	}	
+	//=========================================
+	if (isset($_POST['img_start']))  {
+		 unset($_POST);
+		 }
+ include (AUTOSIZE_PATH."include/affiche.php"); 	 	 
+//================================================================================
+
+switch ($page['tab'])
+ {
+  case 'autosize_admin':
+
+    $template->set_filenames(array('plugin_admin_content' => realpath(AUTOSIZE_PATH . 'admin/template/admin.tpl')));
+    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+    break; 
+ 
+case 'autosize_content':
+
+  
+ $template->set_filenames(array( 'plugin_admin_content' => realpath(AUTOSIZE_PATH . 'template/picture.tpl' )));
+ $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+ break; 
+  }
+if (!isset($autosizes_message)){
+		  $autosizes_message = "";
+		} 
+ 
+ 
+		  
+		if  ($autosizes_message != "")  {
+		   array_push($page['autosizes'],  $autosizes_message);
+		 $autosizes_message="";
+		 }
+		if (!isset($erreur_message)){
+		  $erreur_message = "";
+		} 		 
+		if  ($erreur_message != "")  {
+	
+		  array_push($page['errors'], $erreur_message);
+		  $erreur_message="";
+	
+		 
+		 }		 
+		 
+//================================================================
+ 
+
+?>
Index: /extensions/Autosize/admin/template/admin.tpl
===================================================================
--- /extensions/Autosize/admin/template/admin.tpl	(revision 6912)
+++ /extensions/Autosize/admin/template/admin.tpl	(revision 6912)
@@ -0,0 +1,139 @@
+{html_head} 
+    <script type="text/javascript">
+        var img_width={$IMG_WIDTH       }
+        var img_height={ $IMG_HEIGHT     }
+        var marge_basse={ $MARGE_BASSE    }
+        var echelle_max={ $ECHELLE_MAX   }
+        var mini_width={ $MINI_WIDTH   }
+        var mini_height={ $MINI_HEIGHT   }
+        var webmaster_width={$webmaster_width   }
+        var webmaster_height={ $webmaster_height   }
+        var admin_width={ $admin_width   }
+        var admin_height={ $admin_height   }
+        var generic_width={ $generic_width   }
+        var generic_height={ $generic_height   }
+        var guest_width={ $guest_width   }
+        var guest_height={ $guest_height   }
+        var normal_width={ $normal_width   }
+        var normal_height={ $normal_height   }
+        var user_status={ $user_status   }
+
+     </script>
+    {known_script id="jquery" src="themes/default/js/jquery.packed.js"}
+    {known_script id="Affiche_script" src="plugins/autosize/js/Affiche_script.js"}
+{/html_head}
+
+{* $Id: autosize admin.tpl  *}
+ <!--- HEAD autosize TPL --->
+{known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"}
+{known_script id="jquery.ui"      src=$ROOT_URL|@cat:"themes/default/js/ui/ui.core.js"}
+{known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/ui.resizable.js"}
+{known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"themes/default/js/ui/ui.slider.js"}
+{known_script id="jquery.ui.draggable" src=$ROOT_URL|@cat:"themes/default/js/ui/ui.draggable.js"}
+
+<script type="text/javascript">
+jQuery().ready(function(){ldelim}
+  jQuery('.cluetip').cluetip({ldelim}
+    width: 300,
+    splitTitle: '|'
+  });
+});
+</script>
+
+<!--============== assign visible =======================-->	
+{assign var="affiche_cde" value="true"}
+{if $affiche_cde == "true"}
+  {assign var="visible" value="block"}
+{else}
+  {assign var="visible" value="none"}
+{/if}
+<div class="titrePage">
+		<h2>{'Autosize'|translate} {'version'|translate}{$version}</h2>
+</div>
+  <span>{'cl_autosize_Howto'|translate}</span>
+
+
+
+<!--============== !DIV ==={$IMG_WIDTH  }=={$IMG_HEIGHT  }======-->	
+<table >
+  <form action="" method="post" name="form_autosize" id="form_autosize"    >
+
+  <table id="table0" style=" background:none;border:outset;width:90%; z-index:-500 " >
+    <fieldset>
+  	<legend>{'cl_config_title'|@translate}</legend>
+        <td>{'User status'|@translate}</td><td>{'height'|@translate}</td><td>{'width'|@translate}</td>
+        <tr>
+        <td>{'user_status_webmaster'|@translate}</td>
+        <td><input name="webmaster_height" id="Text7" type="text"  value ="{$webmaster_height}" /></td>
+        <td><input name="webmaster_width" id="Text8" type="text"  value ="{$webmaster_width}" /></td>
+        </tr>
+        <tr>
+        <td>{'user_status_admin'|@translate}</td>
+        <td><input name="admin_height" id="admin_height" type="text"  value ="{$admin_height}" /></td>
+        <td><input name="admin_width" id="admin_width" type="text"  value ="{$admin_width}" /></td>
+        </tr>
+        <tr>
+        <td>{'user_status_generic'|@translate}</td>
+        <td><input name="generic_height" id="Text1" type="text"  value ="{$generic_height}" /></td>
+        <td><input name="generic_width" id="Text2" type="text"  value ="{$generic_width}" /></td>
+        </tr>
+        <tr>
+        <td>{'user_status_guest'|@translate}</td>
+        <td><input name="guest_height" id="Text3" type="text"  value ="{$guest_height}" /></td>
+        <td><input name="guest_width" id="Text4" type="text"  value ="{$guest_width}" /></td>
+        </tr>
+        <tr>
+        <td>{'user_status_normal'|@translate}</td>
+        <td><input name="normal_height" id="Text5" type="text"  value ="{$normal_height}" /></td>
+        <td><input name="normal_width" id="Text6" type="text"  value ="{$normal_width}" /></td>
+        </tr>
+
+  </fieldset>
+  </table>
+
+ <table id="table_d" style=" background:none;border:outset;width:90%; z-index:-500 " >
+   <fieldset>
+  	<legend>{'cl_config_title'|@translate}</legend>
+ 
+    <!--======== Dimensions HL ===================-->	
+    <tr> 
+      <td class="cluetip" title="{'miniheight'|@translate}" >{'minimum height'|translate}</td>
+      <td ><input name="mini_height" id="mini_height" type="text"  value ="{$MINI_HEIGHT}" /> {$unit_h} 
+           <input type="checkbox" name="check_auto_h" value="on"  {$check_auto_h}  /> {'automatique'|translate}</td> 
+	 
+     <td class="cluetip" title="{'miniwidth'|translate}"  > {'minimum width'|translate}</td>
+   <td  >
+    <input name="mini_width"  id="mini_width" type="text" value =  "{$MINI_WIDTH}" /> {$unit_w}
+    <input type="checkbox" name="check_auto_w" value="on"  {$check_auto_w}  /> {'automatique'|translate}</td>
+   </tr>
+   <!--======== Positions  ===================-->	
+<tr >
+ <td class="cluetip" title="{'echelle_max'|translate}" > {'echelle_max'|translate}</td>
+ <td  >
+ <input name="echelle_max" id="echelle_max"  type="text" value ="{$ECHELLE_MAX}" /> {$unit_t}
+ <input type="checkbox" name="check_auto_t" value="on"  {$check_auto_t}  /> {'automatique'|translate}</td>
+ 
+</tr>
+<!--=================== Bloc Alignement =============================-->	 
+<tr >  
+<td class="cluetip" title="{'marge_basse'|translate}" > {'marge_basse'|translate}</td>
+<td><input name="marge_basse" id="marge_basse"  type="text" value =  "{$MARGE_BASSE}" /></td>
+
+</tr>		  
+
+  <!--======================================================================================-->	
+     <tr >
+	 
+	 </tr>
+
+
+  </fieldset>
+  </table>
+  <table>
+  <td><input name="submit" type="submit" value="{'Save'|@translate}" /></td>
+</table> 
+</form>
+ 
+ </table >
+
+ 
Index: /extensions/Autosize/include/affiche.php
===================================================================
--- /extensions/Autosize/include/affiche.php	(revision 6912)
+++ /extensions/Autosize/include/affiche.php	(revision 6912)
@@ -0,0 +1,39 @@
+<?php  
+
+$visible=(isset($visible))?$visible:true;
+$img_width=isset($picture['current']['width'])?$picture['current']['width']:200;
+$img_height=isset($picture['current']['height'])?$picture['current']['height']:200;
+$version=isset($version)?$version:"";
+
+
+ $user_status = $user['status'] ;
+ 
+
+  	$template->assign(
+  					array(
+                    'visible' => $visible,
+                    'version' => $version,
+                    'AUTOSIZE_PATH' => AUTOSIZE_PATH,
+                    'IMG_WIDTH' 	=> $img_width,
+                    'IMG_HEIGHT'	=> $img_height,
+                    'MINI_HEIGHT' => $autosize_parametres->mini_height,
+                    'MINI_WIDTH' 	=> $autosize_parametres->mini_width,
+                    'MARGE_BASSE' => $autosize_parametres->marge_basse,
+                    'ECHELLE_MAX' => $autosize_parametres->echelle_max,
+                    'webmaster_width' => $autosize_parametres->webmaster_width,
+                    'webmaster_height' => $autosize_parametres->webmaster_height,
+                    'admin_width' => $autosize_parametres->admin_width,
+                    'admin_height' => $autosize_parametres->admin_height,
+                    'generic_width' => $autosize_parametres->generic_width,
+                    'generic_height' => $autosize_parametres->generic_height,
+                    'guest_width' => $autosize_parametres->guest_width,
+                    'guest_height' => $autosize_parametres->guest_height,
+                    'normal_width' => $autosize_parametres->normal_width,
+                    'normal_height' => $autosize_parametres->normal_height,
+					'user_status'   => get_user_status($user_status) 
+				 )
+				);	
+
+			    
+ //unset($_POST);
+?>
Index: /extensions/Autosize/include/constants.php
===================================================================
--- /extensions/Autosize/include/constants.php	(revision 6912)
+++ /extensions/Autosize/include/constants.php	(revision 6912)
@@ -0,0 +1,4 @@
+<?php
+global $prefixeTable;
+if (!defined('CL_AUTOSIZE_TABLE')) define('CL_AUTOSIZE_TABLE', $prefixeTable.'cl_autosize');
+?>
Index: /extensions/Autosize/index.php
===================================================================
--- /extensions/Autosize/index.php	(revision 6912)
+++ /extensions/Autosize/index.php	(revision 6912)
@@ -0,0 +1,32 @@
+<?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/Autosize/js/Affiche_script.js
===================================================================
--- /extensions/Autosize/js/Affiche_script.js	(revision 6912)
+++ /extensions/Autosize/js/Affiche_script.js	(revision 6912)
@@ -0,0 +1,85 @@
+﻿jQuery(document).ready(
+function (jQuery) {
+    //===================================================================	
+
+
+    jQuery(window).resize(function (event, ui) {
+        if (typeof (event) == 'undefined') return;
+        var Image = jQuery("#theImage").find("img");
+        if (Image.length == 0) return;
+        var TheImg = jQuery(Image).get(0);
+
+        var sel0 = jQuery(TheImg).position();
+        if (!sel0) return;
+        W0 = parseInt(img_width);
+        if (W0 < mini_width) return;
+
+        H0 = parseInt(img_height);
+        if (H0 < mini_height) return;
+
+        var rapport = (W0 / H0);
+
+
+
+
+
+
+
+        H00 = jQuery(TheImg).height();
+        W00 = jQuery(TheImg).width();
+
+        var Licence = jQuery("#theImage").find(".licencetag");
+        if (Licence.length > 0) {
+            var lmt = jQuery(Licence.get(0)).height();
+            jQuery(Licence.get(0)).css("top", "0px");
+
+        } else { var lmt = 0; }
+
+
+        var winheight = jQuery(window).height();
+        var Image_height = (winheight - sel0.top) - marge_basse - lmt;
+        var height_user = eval(user_status + "_height");
+        var width_user = eval(user_status + "_width");
+
+        var reg1 = new RegExp("%", "g");
+        if (height_user.match(reg1))
+            Image_height = Image_height * parseInt(height_user) / 100;
+        else
+            Image_height = parseInt(height_user);
+
+
+        var echelle = Image_height / H0;
+
+        if (echelle > parseInt(echelle_max)) {
+            echelle = echelle_max;
+            Image_height = parseInt(img_height * echelle);
+        }
+
+        var Imgage_Width = parseInt(Image_height * rapport);
+
+        jQuery(TheImg).height(Image_height + "px");
+        jQuery(TheImg).width(Imgage_Width + "px");
+
+        jQuery("img.logo88x31").css("position", "relative");
+        jQuery("#theImage").css("paddingBottom", "0px");
+        lmt = jQuery("#theImage span").height();
+        var top = jQuery("#theImage").position().top;
+        jQuery("#theImage").height(Image_height + "px");
+
+        jQuery("#theImage").width("100%");
+        try {
+            // pour les themes Gally
+            initializeImageMode('resize');
+        } catch (e) { }
+        return;
+    });
+
+    //===================================================================	  
+    jQuery(window).resize();
+
+    jQuery(window).resize();
+
+});    
+
+//=========================================================
+ 
Index: /extensions/Autosize/language/fr_FR/description.txt
===================================================================
--- /extensions/Autosize/language/fr_FR/description.txt	(revision 6912)
+++ /extensions/Autosize/language/fr_FR/description.txt	(revision 6912)
@@ -0,0 +1,1 @@
+Permet d'ajuster automatiquement l'affichage en fonction de la fenêtre de l'explorateur.
Index: /extensions/Autosize/language/fr_FR/lang.php
===================================================================
--- /extensions/Autosize/language/fr_FR/lang.php	(revision 6912)
+++ /extensions/Autosize/language/fr_FR/lang.php	(revision 6912)
@@ -0,0 +1,37 @@
+<?php
+global $lang;
+$lang['cl_autosize_Howto']="Gestion affichage";
+$lang['cl_config_title'] ="parametres"  ;
+$lang['hlp_line1'] .= "Sélection de la categorie." ;
+$lang['hlp_line2'] .= "Sélectionnez dans cette catégorie, une ou plusieurs photos d'un même lieu." ;
+$lang['hlp_line3'] .= "Affiche les coordonnées de la première photo si elle est connue. "  ;
+$lang['hlp_line4'] .= "Annule la sélection.";  
+$lang['hlp_line5'] .= "Entrez le lieu à rechercher (ville,pays)"  ; 
+
+$lang['hlp_line6'] .= "Recherche sur Google map"; 
+
+$lang['height']='Hauteur';
+$lang['width']='Largeur';
+
+$lang['displays %s on a map']='afficher %s sur la carte';
+$lang['opens %s in Google Earth']='Ouvre %s avec Google Earth (doit être installé sur votre PC)';
+
+$lang['Go to']='Aller à';
+
+$lang['go to %s']='aller à %s';
+$lang['displays all images on a map']='affiche toutes les images sur la carte';
+$lang['Viewing']='Aperçu';
+$lang['Link to this page']='Lien vers cette page';
+$lang['Show all']='Présente tout';
+$lang['show all pictures around this location']='Présente toutes les images à proximité de ces coordonnées';
+$lang['Search a location...']='Rechercher un lieu...';
+
+$lang['Loading']='Chargement';
+$lang['Failed']='Echec';
+
+$lang['Prev']='Préc';
+$lang['Next']='Suiv';
+$lang['out of %d']='sur %d';
+
+$lang['More pictures near this location']='Plus d\'images près de ce lieu';
+?>
Index: /extensions/Autosize/main.inc.php
===================================================================
--- /extensions/Autosize/main.inc.php	(revision 6912)
+++ /extensions/Autosize/main.inc.php	(revision 6912)
@@ -0,0 +1,148 @@
+<?php
+/*
+Plugin Name: AutoSize
+Version: 1.0
+Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation
+Plugin URI:http://fr.piwigo.org/ext/extension_view.php?eid=448
+Author: cljosse
+Author URI:http://cljosse.free.fr
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!defined('AUTOSIZE_PATH')) 
+define(
+  'AUTOSIZE_PATH',
+   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
+);
+
+  add_event_handler('loc_end_picture', 'cl_autosize_affiche',EVENT_HANDLER_PRIORITY_NEUTRAL);
+function cl_autosize_affiche()
+{
+    global $user, $picture, $template;
+    global $content, $element_info;
+    $my_path = dirname(__FILE__).'/';
+  
+   
+    global $infos_message,$erreur_message;
+    global  $conf,$lang ;
+    $autosize_parametres = cl_autosize_Get_Options();
+ include (AUTOSIZE_PATH."include/affiche.php"); 	 	
+ 
+  $template->set_filenames(
+    array('default_content'=> $my_path.'template/picture.tpl')
+    );
+       return $template->parse( 'default_content', true);
+}
+
+	
+	
+
+//=====================================================================
+add_event_handler('get_admin_plugin_menu_links', 'cl_autosize_admin_menu_test');
+function cl_autosize_admin_menu_test($menu)
+{
+global  $lang ;
+    array_push($menu, array('NAME' => 'Autosize',
+      'URL' => get_admin_plugin_menu_link(AUTOSIZE_PATH . 'admin/admin_autosize.php')));
+    return $menu;
+}
+
+
+
+function cl_autosize_aff_infos_plus()
+{
+ global $template,$infos_message,$erreur_message, $user ;;
+global  $conf,$lang ;
+ //==============================================================
+  if (isset($erreur_message))
+		{	
+		if ($erreur_message <> "")
+			{
+			    $erreur_message=str_replace("\n",'<br />',$erreur_message) ;
+   				$template->assign('errors',$erreur_message);
+				$erreur_message="";
+			}
+  		}
+  if (isset($infos_message))
+		{	
+		
+		if ($infos_message <> "")
+			{
+				$infos_message=str_replace("\n",'<br />',$infos_message) ;
+   				$template->assign('infos',$infos_message);
+				$infos_message="";
+			}
+  		}
+		//=============================================================
+return;		 
+		
+}
+
+//===================================================================================
+function cl_autosize_Get_Options()
+  {
+  global $conf,$autosize_parametres; 
+  
+       $autosize_parametres =  unserialize($conf['cl_autosize']);
+      $autosize_parametres =  cl_autosize_Set_Options();
+      return $autosize_parametres;
+  }
+  //===============================================================================
+function cl_autosize_Set_Options()
+  {
+  global $autosize_parametres;
+//=============================================================================
+$autosize_parametres->webmaster_height =(isset($_POST['webmaster_height'])) ? $_POST['webmaster_height'] : ((isset($autosize_parametres->webmaster_height )) ? $autosize_parametres->webmaster_height : '100%' ) ;
+$autosize_parametres->webmaster_width=(isset($_POST['webmaster_width']))? $_POST['webmaster_width']: ((isset($autosize_parametres->webmaster_width)) ? $autosize_parametres->webmaster_width:  '100%') ;
+
+$autosize_parametres->admin_height =(isset($_POST['admin_height'])) ? $_POST['admin_height'] : ((isset($autosize_parametres->admin_height )) ? $autosize_parametres->admin_height : '100%' ) ;
+$autosize_parametres->admin_width=(isset($_POST['admin_width']))? $_POST['admin_width']: ((isset($autosize_parametres->admin_width)) ? $autosize_parametres->admin_width:  '100%') ;
+
+$autosize_parametres->generic_height =(isset($_POST['generic_height'])) ? $_POST['generic_height'] : ((isset($autosize_parametres->generic_height )) ? $autosize_parametres->generic_height : '200px' ) ;
+$autosize_parametres->generic_width=(isset($_POST['generic_width']))? $_POST['generic_width']: ((isset($autosize_parametres->generic_width)) ? $autosize_parametres->generic_width:  '300px') ;
+
+$autosize_parametres->guest_height =(isset($_POST['guest_height'])) ? $_POST['guest_height'] : ((isset($autosize_parametres->guest_height )) ? $autosize_parametres->guest_height : '150px' ) ;
+$autosize_parametres->guest_width=(isset($_POST['guest_width']))? $_POST['guest_width']: ((isset($autosize_parametres->guest_width)) ? $autosize_parametres->guest_width:  '200px') ;
+
+$autosize_parametres->normal_height =(isset($_POST['normal_height'])) ? $_POST['normal_height'] : ((isset($autosize_parametres->normal_height )) ? $autosize_parametres->normal_height : '150px' ) ;
+$autosize_parametres->normal_width=(isset($_POST['normal_width']))? $_POST['normal_width']: ((isset($autosize_parametres->normal_width)) ? $autosize_parametres->normal_width:  '100px') ;
+
+
+$autosize_parametres->mini_height =(isset($_POST['mini_height'])) ? $_POST['mini_height'] : ((isset($autosize_parametres->mini_height )) ? $autosize_parametres->mini_height : '150' ) ;
+$autosize_parametres->mini_width=(isset($_POST['mini_width']))? $_POST['mini_width']: ((isset($autosize_parametres->mini_width)) ? $autosize_parametres->mini_width:  '300') ;
+
+$autosize_parametres->echelle_max=(isset($_POST['echelle_max']))? $_POST['echelle_max'] : ((isset($autosize_parametres->echelle_max)) ? $autosize_parametres->echelle_max :  '1.2'); 
+$autosize_parametres->marge_basse=(isset($_POST['marge_basse']))? $_POST['marge_basse']: ((isset($autosize_parametres->marge_basse)) ? $autosize_parametres->marge_basse :  '50');
+//==================================================================================
+
+return $autosize_parametres;
+
+
+}
+//========================================================================	
+function cl_autosize_sauve_options_inf()
+{
+global $options,$infos_message,$conf,$autosize_parametres  ;
+$infos_message .=l10n("Save_config")."<br>";
+ $autosize_parametres=cl_autosize_Set_Options();
+ 
+ if ( isset($autosize_parametres) )
+ 	{
+ 
+		$query = '
+    		UPDATE '.CONFIG_TABLE.'
+    		SET value="'.addslashes(serialize($autosize_parametres)).'"
+    		WHERE param = "cl_autosize"
+    		LIMIT 1';
+ 			pwg_query($query);
+	  }
+	 
+ }
+ //=======================================================================
+add_event_handler('loc_end_page_tail','cl_autosize_attente',100 );	
+function cl_autosize_attente()
+{
+ 
+}
+
+?>
Index: /extensions/Autosize/maintain.inc.php
===================================================================
--- /extensions/Autosize/maintain.inc.php	(revision 6912)
+++ /extensions/Autosize/maintain.inc.php	(revision 6912)
@@ -0,0 +1,64 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+ if (!defined('AUTOSIZE_PATH')) 
+define(
+  'AUTOSIZE_PATH',
+   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'
+);
+ 
+function plugin_install()
+{
+ global $conf;
+
+  if (!isset($conf['cl_autosize']))
+  {
+    
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+    VALUES ("cl_autosize","","Parametres du plugin Autosize")
+  ;';
+  pwg_query($q);
+  }
+ 
+ 
+}
+
+
+
+function plugin_uninstall()
+{
+  global $conf;
+  if (isset($conf['cl_autosize']))
+  {
+    $q = '
+      DELETE FROM '.CONFIG_TABLE.'
+      WHERE param="cl_autosize"
+    ;';
+    pwg_query($q);
+    }
+	 $query = 'DROP TABLE IF EXISTS  '.CL_AUTOSIZE_TABLE.';';
+    pwg_query( $query);
+ }
+
+?>
Index: /extensions/Autosize/template/picture.tpl
===================================================================
--- /extensions/Autosize/template/picture.tpl	(revision 6912)
+++ /extensions/Autosize/template/picture.tpl	(revision 6912)
@@ -0,0 +1,26 @@
+ 
+{html_head} 
+    <script type="text/javascript">
+        var img_width='{$IMG_WIDTH }';
+        var img_height='{ $IMG_HEIGHT }';
+        var marge_basse='{ $MARGE_BASSE }';
+        var echelle_max='{ $ECHELLE_MAX }';
+        var mini_width='{ $MINI_WIDTH   }';
+        var mini_height='{ $MINI_HEIGHT   }';
+        var webmaster_width='{$webmaster_width   }';
+        var webmaster_height='{ $webmaster_height   }';
+        var admin_width='{ $admin_width   }';
+        var admin_height='{ $admin_height   }';
+        var generic_width='{ $generic_width   }';
+        var generic_height='{ $generic_height   }';
+        var guest_width='{ $guest_width   }';
+        var guest_height='{ $guest_height   }';
+        var normal_width='{ $normal_width   }';
+        var normal_height='{ $normal_height   }';
+        var user_status='{ $user_status   }'
+
+     </script>
+    {known_script id="jquery" src="themes/default/js/jquery.packed.js"}
+    {known_script id="Affiche_script" src="plugins/autosize/js/Affiche_script.js"}
+{/html_head}
+
