Index: /extensions/edit_gmaps/admin/admin_edit.php
===================================================================
--- /extensions/edit_gmaps/admin/admin_edit.php	(revision 20033)
+++ /extensions/edit_gmaps/admin/admin_edit.php	(revision 20034)
@@ -53,18 +53,16 @@
 //========== Mode GLOBAL ================================
 
+
 check_input_parameter('selection', $_POST, true, PATTERN_ID);
 include (PHPWG_ROOT_PATH.'admin/batch_manager.php'); 
     $tabsheet = new tabsheet();
-    $tabsheet->assign(); 
-  
-
+    $tabsheet->assign();  
 
 if(isset($page['cat_elements_id'])) 
     $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d image', '%d images', count($page['cat_elements_id'])).' - '.$page['title']);  
 
- 
+
  if(isset($_POST)){
-// $info_message .= cl_edit_functions::Memo_Vars($_POST);
-
+// $info_message .= cl_print_var($_POST);
 //===============================================================
 $collection = array(); 
@@ -103,5 +101,19 @@
 $adresse =  $lang_info['country'];   ;
 $adresse=str_replace("/",", ",$adresse);
- 
+global $EDIT_CL_parametres ;
+ 
+$EDIT_CL_parametres = cl_edit_controler::cl_edit_Get_Options(); 
+
+
+$template->assign( 'coordinates',
+                    array(  'FILE' => '',
+                            'LAT' =>  ($EDIT_CL_parametres->lat =='')?'100': $EDIT_CL_parametres->lat,
+                            'LON' => ($EDIT_CL_parametres->lon =='')?'100':  $EDIT_CL_parametres->lon ,
+                            'ADRESSE' => ($EDIT_CL_parametres->adress =='')?$adresse:  $EDIT_CL_parametres->adress ,
+                            'ZOOM' => 18,
+                            'ALT' => $EDIT_CL_parametres->alt =='' ?0: $EDIT_CL_parametres->alt
+                        )
+                    );
+                  
 if (count($collection)>0 )
   if ( isset($_POST['update']) && ( $_POST['update']==l10n('update_exif') || $_POST['update'] == l10n('update_all')  )){
@@ -299,5 +311,5 @@
                 $j++ ;
             } else{
-            //   $info_message .= cl_edit_functions::Memo_Vars($current[$j]); 
+            //   $info_message .= cl_print_var($current[$j]); 
                 break ;
             }
@@ -342,8 +354,12 @@
 $match="";
 if ( isset($_POST['submit'])   ) {
-
+if ( isset($_POST['match']) && $_POST['match']!='' ){   
+      cl_edit_controler::cl_edit_Set_Options();
+      cl_edit_controler::cl_edit_sauve_options_inf();
+  }
  if ($_POST['submit']==l10n('selection') ) {
     $collection =$_POST['selection'];
   }
+
   if ($_POST['submit']==l10n('add') ) {
     $_POST['selection']=array();
@@ -359,13 +375,5 @@
 //=================================================================================
 $src=""; 
-$template->assign( 'coordinates',
-                    array(  'FILE' => '',
-                            'LAT' => '100',
-                            'LON' => '100',
-                            'ADRESSE' => $adresse,
-                            'ZOOM' => 18,
-                            'ALT' => 0
-                        )
-                    );
+
 //====================================================================== 
 if (isset($_POST['submit']) and $_POST['submit']==l10n('selection' )){
@@ -387,21 +395,22 @@
               $infos_gps  =  cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ;            
                
-              if(isset($infos_gps['lat']) && $infos_gps['is_exif']){     
-              //======= test affichage BD ================
-                if($image['lat']=='' || $image['lon']==''){  
+              
+              
+
+               if( ($image['lat']=='' || $image['lon']=='')|| $EDIT_CL_parametres->check_exif=='on' ) {                          
+                  if(isset($infos_gps['lat']) && $infos_gps['is_exif']){     
                         $image['lat']=$infos_gps['lat'];
                         $image['lon']=$infos_gps['lon'];
-                        $image['alt']=$infos_gps['alt'];             
-                }
-              }       
+                        $image['alt']=$infos_gps['alt']; 
+                  }  
+              }                      
+              if($image['lat'] <> ''){               
+                  $lon=$image['lon'];
+                  $lat=$image['lat'];   
+                  $alt=$image['alt'];   
+              }
               //==========================================
-                        
-              if ( $init_info && $image['lat'] <> '' ) {               
-
-                $init_info = false ;
-                $lat = ($image['lat'] <> '') ? $image['lat'] : '100'  ;
-                $lon = ($image['lon']  <> '') ? $image['lon'] : '3.0'  ;
-                $alt = ($image['alt']  <> '') ? $image['alt'] : '0'  ;
-                     
+              if ( $init_info && $image['lat'] <> '' ) {     
+                $init_info = false ;                     
                 //=====================================================
                 $template->assign( 'coordinates',
@@ -417,6 +426,9 @@
               }
               //===================================================== 
-                    $lon=$image['lon'];
-                    $lat=$image['lat'];
+                            
+
+
+
+
                     $lonDMS= dec2dms($lon) ;
                     $latDMS= dec2dms($lat) ;
@@ -456,5 +468,5 @@
 //============================================================
  if ( !empty($first_image)) { 
-   $erreur_message .= cl_edit_functions::Memo_Vars($first_image);
+   $erreur_message .= cl_print_var($first_image);
    
    if (isset($_POST['update'])) {
Index: /extensions/edit_gmaps/edit_gmaps.inc.php
===================================================================
--- /extensions/edit_gmaps/edit_gmaps.inc.php	(revision 20033)
+++ /extensions/edit_gmaps/edit_gmaps.inc.php	(revision 20034)
@@ -35,17 +35,8 @@
 
 class cl_edit_functions {
-        static public   function Memo_vars($variables) {
-   		    ob_start();
-		    echo '<pre>';
-		    print_r($variables);
-		    echo '</pre>';
- 	  	    $m= ob_get_contents();
-    	    ob_end_clean();
-		    return $m;		
-    }
-
-/**
+     
+/**************************************
 * list all columns of each given table
-*
+***************************************
 * @return array of array
 */
@@ -260,5 +251,5 @@
   }
 //======================================================
-     static public function cl_edit_admin_menu($menu)
+static public function cl_edit_admin_menu($menu)
     {
  	    include_once( dirname(__FILE__) .'/include/functions.php');
@@ -271,64 +262,120 @@
 	    return $menu;
     }
+	/****************************
+	*
+	*****************************/
+  static public function cl_edit_Get_Options(){
+		global $conf,$EDIT_CL_parametres,$infos_message ; 
+  if (!isset($conf['edit_gmaps'])){    
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+    VALUES ("edit_gmaps","","Parametres du plugin edit_gmaps")
+  ;';
+  pwg_query($q);	 
+
+  }
+   	$EDIT_CL_parametres =  unserialize($conf['edit_gmaps']);  
+    if (!isset($EDIT_CL_parametres->lat )){
+      $EDIT_CL_parametres= cl_edit_controler::cl_edit_Set_Options(); 
+    }
+    
+		return $EDIT_CL_parametres;
+  }
 	/*
 	*
 	*/
- function cl_edit_Get_Options()
-  {
-		global $conf,$EDIT_CL_parametres; 
-  		$EDIT_CL_parametres =  unserialize($conf['cl_edit']);
-		$EDIT_CL_parametres =  cl_edit_Set_Options();
-		return $EDIT_CL_parametres;
-  }
-	/*
-	*
-	*/
-function cl_edit_Set_Options()
-  {
-
+ static public function cl_edit_Set_Options(){
   global $EDIT_CL_parametres;
 //=============================================================================
-$my_para=$EDIT_CL_parametres;
-    $my_para->type=(isset($_POST['type']))? $_POST['type']: ((isset($my_para->type)) ? $my_para->type:  'Ty') ;
-
+$my_para=$EDIT_CL_parametres; 
+$lon= isset($my_para->lon)? $my_para->lon:'' ;
+$lat= isset($my_para->lat)? $my_para->lat:'' ;
+$alt= isset($my_para->alt)? $my_para->alt:'0' ; 
+    $my_para->lon    = (isset($_POST['lon']))? $_POST['lon']: $lon ;
+    $my_para->lat    = (isset($_POST['lat']))? $_POST['lat']: $lat ;
+    $my_para->alt    = (isset($_POST['alt']))? $_POST['alt']: $alt ;
+    $my_para->adress    = (isset($_POST['match']))? $_POST['match']: '' ;
 //===============================================================================	
-
 if ( isset($_POST['selectAction'] ) && $_POST['selectAction'] == l10n('cl_edit_save') )  {  
-		$my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : "off" ;
+		$my_para->check_exif = isset($_POST['check_exif']) ? $_POST['check_exif'] : "off" ;
 
 	 }else{
-		$my_para->check_desc_v = isset($_POST['check_desc_v']) ? $_POST['check_desc_v'] : ( ( isset($my_para->check_desc_v) ) ? $my_para->check_desc_v :   'off') ;  
-
-
+		$my_para->check_exif = isset($_POST['check_exif']) ? $_POST['check_exif'] : ( ( isset($my_para->check_exif) ) ? $my_para->check_exif :   'off') ;  
    }
-
+   $EDIT_CL_parametres=$my_para;
 return $my_para;
-}
-	/*
+
+}
+	/**********************
 	*
-	*/
-    function cl_edit_sauve_options_inf()
-    {
-    global $options,$infos_message,$conf,$EDIT_CL_parametres  ;
-    $infos_message .=l10n("cl_edit_save_config")."<br>";
-     $EDIT_CL_parametres=cl_edit_Set_Options();
-
-     if ( isset($EDIT_CL_parametres) )
- 	    {
- 
+	**********************/
+  static public function cl_edit_sauve_options_inf()    {
+    global $options,$infos_message,$conf,$EDIT_CL_parametres  ;    
+   // $infos_message .=l10n("cl_edit_save_config")."<br>". cl_print_var($EDIT_CL_parametres);
+   // cl_aff_infos_plus();
+     if ( isset($EDIT_CL_parametres) ){ 
 		    $query = '
     		    UPDATE '.CONFIG_TABLE.'
     		    SET value="'.addslashes(serialize($EDIT_CL_parametres)).'"
-    		    WHERE param = "cl_EDIT_CL"
+    		    WHERE param = "edit_gmaps"
     		    LIMIT 1';
  			    pwg_query($query);
-	      }
-	 
+	      }	 
      }
-
 
 
 } // class   
  
-
+/*************************
+ *
+ *************************/
+ if(!function_exists("cl_print_var")){
+   function cl_print_var($variables){
+    ob_start();
+    echo '<pre>';
+    print_r($variables);
+    echo '</pre>';
+    $m= ob_get_contents();
+    ob_end_clean();
+    return $m;		
+  }
+}
+/******************
+*
+******************/
+if(!function_exists("cl_aff_infos_plus")){
+	function cl_aff_infos_plus()
+		{
+		 global $template,$infos_message,$error_message,$warnings_message, $user ;
+		 global  $conf,$lang,$page  ;
+   		 //==============================================================
+		  if (isset($error_message))	{	
+				if ($error_message <> ""){
+						$error_message=str_replace("\n",'<br />',$error_message) ;
+   						$template->assign('errors',$error_message);
+						$error_message="";
+					}
+  			}
+     //==============================================================
+		  if (isset($warnings_message))	{	
+				if ($warnings_message <> ""){
+						$warnings_message=str_replace("\n",'<br />',$warnings_message) ;
+   						$template->assign('warnings',$warnings_message);
+						$warnings_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_aff_infos_plus
+	//===============================================================
+}
 ?>
Index: /extensions/edit_gmaps/main.inc.php
===================================================================
--- /extensions/edit_gmaps/main.inc.php	(revision 20033)
+++ /extensions/edit_gmaps/main.inc.php	(revision 20034)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: Edit Maps&Earth
-Version: 2.2.6
+Version: 2.2.7
 Description:  Editor for rv gmaps 
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=330
Index: /extensions/edit_gmaps/maintain.inc.php
===================================================================
--- /extensions/edit_gmaps/maintain.inc.php	(revision 20033)
+++ /extensions/edit_gmaps/maintain.inc.php	(revision 20034)
@@ -32,15 +32,26 @@
 {
   $dir_name = basename( dirname(__FILE__) );
-
+  if (!isset($conf['edit_gmaps'])){    
+  $q = '
+    INSERT INTO '.CONFIG_TABLE.' (param, value, comment)
+    VALUES ("edit_gmaps","","Parametres du plugin edit_gmaps")
+  ;';
+  pwg_query($q);
+  }
 }
 
-function plugin_deactivate()
-{
- 
+function plugin_deactivate(){ 
   cl_meta_invalidate_cache();
+  global $conf;  
+  if (isset($conf['edit_gmaps']))  {
+    $q = '
+      DELETE FROM '.CONFIG_TABLE.'
+      WHERE param="edit_gmaps"
+    ;';
+    pwg_query($q);
+    }
 }
 
-function plugin_uninstall()
-{
+function plugin_uninstall(){
   global $conf ;
      $q = 'ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `alt`';
@@ -54,4 +65,5 @@
   pwg_query( $q );
   }
+
 }
 ?>
