Index: extensions/GMaps/gmaps_aip.class.inc.php
===================================================================
--- extensions/GMaps/gmaps_aip.class.inc.php	(revision 7177)
+++ extensions/GMaps/gmaps_aip.class.inc.php	(revision 7308)
@@ -57,4 +57,8 @@
                           l10n('gmaps_search'),
                           $this->getAdminLink()."&amp;fGMaps_tabsheet=search");
+    $this->tabsheet->add('config',
+                          l10n('gmaps_config'),
+                          $this->getAdminLink()."&amp;fGMaps_tabsheet=config");
+
 /*    $this->tabsheet->add('help',
                           l10n('gmaps_help'),
@@ -112,4 +116,7 @@
       case 'search':
         $this->displaySearch();
+        break;
+      case 'config':
+        $this->displayConfig();
         break;
       case 'help':
@@ -335,4 +342,56 @@
 
 
+
+
+  /**
+   * display the config page
+   *
+   */
+  protected function displayConfig()
+  {
+    global $template;
+
+    $this->updateConfig();
+    $this->configForTemplate();
+
+    $template->set_filename('body_page',
+                dirname($this->getFileLocation()).'/admin/gmaps_config.tpl');
+
+    $template->assign_var_from_handle('GMAPS_BODY_PAGE', 'body_page');
+  }
+
+  /**
+   * update config values
+   */
+  protected function updateConfig()
+  {
+    global $infos;
+
+    if(!isset($_POST) or count($_POST)==0) return(false);
+
+
+    if(isset($_POST['fBDPopupAutomaticSize']) and $_POST['fBDPopupAutomaticSize']>=0.5 and $_POST['fBDPopupAutomaticSize']<=0.95)
+    {
+      $this->config['popupAutomaticSize']=$_POST['fBDPopupAutomaticSize'];
+    }
+    else
+    {
+      return(false);
+    }
+
+    if($this->saveConfig())
+    {
+      $this->displayResult(l10n('gmaps_config_saved'), true);
+      return(true);
+    }
+    return(false);
+  }
+
+
+
+
+
+
+
   /**
    * build an ordered category list
@@ -373,28 +432,4 @@
       {
         $row['level']=1+substr_count($row['rank'], '.');
-
-        /* rank is in formated without leading zero, giving bad order
-         *  1
-         *  1.10
-         *  1.11
-         *  1.2
-         *  1.3
-         *  ....
-         *
-         *  this loop cp,vert all sub rank in four 0 format, allowing to order
-         *  categories easily
-         *  0001
-         *  0001.0010
-         *  0001.0011
-         *  0001.0002
-         *  0001.0003
-         */
-        $row['rank']=explode('.', $row['rank']);
-        foreach($row['rank'] as $key=>$rank)
-        {
-          $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);
-        }
-        $row['rank']=implode('.', $row['rank']);
-
         $returned[]=$row;
       }
@@ -414,9 +449,5 @@
   public function compareCat($catA, $catB)
   {
-    if($catA['rank'] == $catB['rank'])
-    {
-      return(0);
-    }
-    return( ($catA['rank'] < $catB['rank'])?-1:1 );
+    return(strnatcmp($catA['rank'], $catB['rank']));
   }
 
