Index: /extensions/edit_gmaps/admin/admin.php
===================================================================
--- /extensions/edit_gmaps/admin/admin.php	(revision 9444)
+++ /extensions/edit_gmaps/admin/admin.php	(revision 9445)
@@ -2,42 +2,4 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
-
-$colonnes = cl_get_columns_of(IMAGES_TABLE);
-
-$key = array_search('lon', $colonnes[IMAGES_TABLE]); 
-if (!$key){
-    $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lon` DOUBLE(9,6)';
-    pwg_query($q);	
-}	
-$key = array_search('lat', $colonnes[IMAGES_TABLE]); 
-if (!$key){
-    $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lat` DOUBLE(9,6)';
-    pwg_query($q);	
-}	
-$key = array_search('alt', $colonnes[IMAGES_TABLE]); 
-if (!$key){
-    $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `alt` DOUBLE(9,6)';
-    pwg_query($q);	
-}	
-
-	
-/**
-* list all columns of each given table
-*
-* @return array of array
-*/
-function cl_get_columns_of($table)
-{
-    $columns_of = array();
-    $query = 'DESC '.$table.';';
-    $result = mysql_query($query);	
-    $columns_of[$table] = array();   
-
-    if ($result)   
-        while ($row = mysql_fetch_row($result))
-           array_push($columns_of[$table], $row[0]);
-        
-    return $columns_of;
-}
 
 
Index: /extensions/edit_gmaps/admin/header_2_2.tpl
===================================================================
--- /extensions/edit_gmaps/admin/header_2_2.tpl	(revision 9444)
+++ /extensions/edit_gmaps/admin/header_2_2.tpl	(revision 9445)
@@ -1,8 +1,8 @@
-{combine_script id="jquery" load="header" path = $ROOT_URL|@cat:"themes/default/js/jquery.js"} 
+{combine_script id="jquery" load="header" path = $ROOT_URL|@cat:"themes/default/js/jquery.min.js "} 
 {combine_script id="jquery.cluetip" path = $ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.js" require="jquery" }
-{combine_script id="jquery.ui" path=$ROOT_URL|@cat:"themes/default/js/ui/jquery.ui.core.js" require="jquery"}
-{combine_script id="jquery.ui.resizable" path=$ROOT_URL|@cat:"themes/default/js/ui/jquery.ui.resizable.js" require="jquery,jquery.ui"}
-{combine_script id="jquery.ui.slider" path=$ROOT_URL|@cat:"themes/default/js/ui/jquery.ui.slider.js" require="jquery,jquery.ui"}
-{combine_script id="jquery.ui.draggable" path=$ROOT_URL|@cat:"themes/default/js/ui/jquery.ui.draggable.js" require="jquery,jquery.ui"}
+{combine_script id="jquery.ui" path=$ROOT_URL|@cat:"themes/default/js/ui/minified/jquery.ui.core.min.js " require="jquery"}
+{combine_script id="jquery.ui.resizable" path=$ROOT_URL|@cat:"themes/default/js/ui/minified/jquery.ui.resizable.min.js " require="jquery,jquery.ui"}
+{combine_script id="jquery.ui.slider" path=$ROOT_URL|@cat:"themes/default/js/ui/minified/jquery.ui.slider.min.js " require="jquery,jquery.ui"}
+{combine_script id="jquery.ui.draggable" path=$ROOT_URL|@cat:"themes/default/js/ui/minified/jquery.ui.draggable.min.js " require="jquery,jquery.ui"}
 
 
Index: /extensions/edit_gmaps/edit_gmaps.inc.php
===================================================================
--- /extensions/edit_gmaps/edit_gmaps.inc.php	(revision 9444)
+++ /extensions/edit_gmaps/edit_gmaps.inc.php	(revision 9445)
@@ -34,6 +34,33 @@
 );
 
+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
+*/
+  static public function Get_columns_of($table){
+    $columns_of = array();
+    $query = 'DESC '.$table.';';
+    $result = mysql_query($query);	
+    $columns_of[$table] = array();   
 
+    if ($result)   
+        while ($row = mysql_fetch_row($result))
+            array_push($columns_of[$table], $row[0]);
+        
+    return $columns_of;
+  }
+}
 
 class cl_edit_controler {
@@ -112,19 +139,29 @@
      }
 
-     function Memo_vars($variables)
-{
-   		ob_start();
-		echo '<pre>';
-		print_r($variables);
-		echo '</pre>';
- 	  	$m= ob_get_contents();
 
-    	ob_end_clean();
-		return $m;
-		
-}
-} // class    
 
+} // class   
  
+global $conf ;
+  $colonnes = cl_edit_functions::Get_columns_of(IMAGES_TABLE);  
+$key = array_search('lon', $colonnes[IMAGES_TABLE]); 
+if (!$key){
+    $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lon` DOUBLE(8,6)';
+    pwg_query($q);	
+}	
+$key = array_search('lat', $colonnes[IMAGES_TABLE]); 
+if (!$key){
+    $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lat` DOUBLE(9,6)';
+    pwg_query($q);	
+}	
+ 
+$key = array_search('alt', $colonnes[IMAGES_TABLE]); 
+if (!$key){
+    $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `alt` DOUBLE(9,6)';
+    pwg_query($q);	
+}	
+
+	
+
 
 ?>
Index: /extensions/edit_gmaps/main.inc.php
===================================================================
--- /extensions/edit_gmaps/main.inc.php	(revision 9444)
+++ /extensions/edit_gmaps/main.inc.php	(revision 9445)
@@ -14,4 +14,5 @@
 	include_once(EDIT_CL_PATH.'edit_gmaps.inc.php');
 
+$cl_edit_functions = new cl_edit_functions();
 $cl_edit_controler = new cl_edit_controler();
 add_event_handler('get_admin_plugin_menu_links', array(&$cl_edit_controler,'cl_edit_admin_menu')  );
Index: /extensions/edit_gmaps/maintain.inc.php
===================================================================
--- /extensions/edit_gmaps/maintain.inc.php	(revision 9444)
+++ /extensions/edit_gmaps/maintain.inc.php	(revision 9445)
@@ -1,8 +1,30 @@
 <?php
-function plugin_install()
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+if (!defined('EDIT_CL_PATH')) 
+define(  'EDIT_CL_PATH',   PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
+	include_once(EDIT_CL_PATH.'edit_gmaps.inc.php');
+
+$cl_edit_functions = new cl_edit_functions();
+
+function plugin_install($plugin_id,$plugin_version,&$errors)
 {
-  $q = '
-ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `alt` DOUBLE(9,6)';
-  pwg_query($q);
+global $conf,$lang ;
+
+   if (!isset($conf['gmaps_api_key'])) 
+{  
+$msg = sprintf(l10n('To install this plugin, you need to install %s before'),"RV Maps&Earth" );
+  if(is_array($errors))
+  {    array_push($errors,  "CANNOT INSTALL - $plugin_id <BR />".$msg);  }
+  else  {    $errors=Array( "CANNOT INSTALL - $plugin_id <BR />".$msg);  } 
+   return  ;
+}
+ $colonnes=cl_edit_functions::Get_columns_of(IMAGES_TABLE);
+
+ $colonnes=cl_edit_functions::Get_columns_of(IMAGES_TABLE);
+ $key = array_search('alt', $colonnes[IMAGES_TABLE]); 
+if (!$key){
+ $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `alt` DOUBLE(9,6)';
+    pwg_query($q);	
+    }
 }
 
@@ -21,7 +43,15 @@
 function plugin_uninstall()
 {
-  $q = '
-ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `alt`';
+  global $conf ;
+     $q = 'ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `alt`';
+    pwg_query( $q );  
+
+  if (!isset($conf['gmaps_api_key'])) 
+{  
+    $q = 'ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `lon`';
   pwg_query( $q );
+    $q = 'ALTER TABLE '.IMAGES_TABLE.' DROP COLUMN `lat`';
+  pwg_query( $q );
+  }
 }
 ?>
