Index: /extensions/GMaps/admin/gmaps_admin.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_admin.tpl	(revision 7131)
+++ /extensions/GMaps/admin/gmaps_admin.tpl	(revision 7132)
@@ -1,3 +1,10 @@
 <h2 style="float:right;top:-24px;position:relative;height:auto;font-size:12px;font-weight:normal;">{$plugin.GMAPS_VERSION}</h2>
 
+{if isset($errcode) and $errcode!=''}
+<div class='errors' id='iErrorMsg'>
+<p>{'gmaps_action_was_stopped'|@translate}</p>
+<p style='font-style:italic;margin:0 30px;'>{$errcode}</p>
+</div>
+{/if}
+
 {$GMAPS_BODY_PAGE}
Index: /extensions/GMaps/admin/gmaps_category_maps.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_category_maps.tpl	(revision 7131)
+++ /extensions/GMaps/admin/gmaps_category_maps.tpl	(revision 7132)
@@ -49,7 +49,32 @@
 
       $('#iBDAssocMapId').bind('change', changeMapDisplayType);
+      $('[name=fBDAssocKmlFile]').bind('change', changeKmlFileSource);
 
       loadList();
-
+    }
+
+    /**
+     * called when the source of kml file changed
+     */
+    var changeKmlFileSource = function ()
+    {
+      switch($('[name=fBDAssocKmlFile]:checked').val())
+      {
+        case 'N':
+          $('#iBDAssocKmlFileId').css('display', 'none');
+          $('#iBDAssocKmlFileUrl').css('display', 'none');
+          $('#iBDKmlWarning').css('display', 'none');
+          break;
+        case 'S':
+          $('#iBDAssocKmlFileId').css('display', 'block');
+          $('#iBDAssocKmlFileUrl').css('display', 'none');
+          $('#iBDKmlWarning').css('display', 'block');
+          break;
+        case 'U':
+          $('#iBDAssocKmlFileId').css('display', 'none');
+          $('#iBDAssocKmlFileUrl').css('display', 'block');
+          $('#iBDKmlWarning').css('display', 'block');
+          break;
+      }
     }
 
@@ -196,6 +221,8 @@
         $('#iBDAssocMapId').val($('#iBDAssocMapId option:first').val());
         $('#iBDAssocApplySubCat').val('y');
+        $('#iBDAssocKmlNone').attr('checked', true);
+        $('#iBDAssocKmlFileId').val($('#iBDAssocKmlFileId option:first').val());
         $('#iBDAssocKmlFileUrl').val('');
-        $('#iBDAssocIcon').val($('#iBDAssocIcon option:visible:first').val());
+        $('#iBDAssocIcon').val($('#iBDAssocIcon option:first').val());
         $('#iBDAssocTitle').val('');
       }
@@ -207,4 +234,17 @@
         $('#iBDAssocMapId').val(tmp.mapId);
         $('#iBDAssocApplySubCat').val(tmp.applySubCat);
+        if(tmp.kmlFileId>0)
+        {
+          $('#iBDAssocKmlSelect').attr('checked', true);
+        }
+        else if(tmp.kmlFileUrl!='')
+        {
+          $('#iBDAssocKmlUrl').attr('checked', true);
+        }
+        else
+        {
+          $('#iBDAssocKmlNone').attr('checked', true);
+        }
+        $('#iBDAssocKmlFileId').val(tmp.kmlFileId);
         $('#iBDAssocKmlFileUrl').val(tmp.kmlFileUrl);
         $('#iBDAssocIcon').val(tmp.icon);
@@ -213,4 +253,5 @@
 
       changeMapDisplayType();
+      changeKmlFileSource();
     }
 
@@ -269,5 +310,6 @@
         mapId:$('#iBDAssocMapId').val(),
         applySubCat:$('#iBDAssocApplySubCat').val(),
-        kmlFileUrl:$('#iBDAssocKmlFileUrl').val(),
+        kmlFileId:($('#iBDAssocKmlSelect').attr('checked'))?$('#iBDAssocKmlFileId').val():0,
+        kmlFileUrl:($('#iBDAssocKmlSelect').attr('checked'))?'':$('#iBDAssocKmlFileUrl').val(),
         icon:$('#iBDAssocIcon').val(),
         title:$('#iBDAssocTitle').val(),
@@ -339,7 +381,7 @@
     <th>{'gmaps_category'|@translate}</th>
     <th style="width:90px;">{'gmaps_apply_subcat'|@translate}</th>
-    <th style="width:90px;">{'gmaps_mapType'|@translate}</th>
-    <th style="width:356px;">{'gmaps_map'|@translate}</th>
-    <th style="width:90px;">{'gmaps_map_kmlfile'|@translate}</th>
+    <th style="width:150px;">{'gmaps_mapType'|@translate}</th>
+    <th style="width:350px;">{'gmaps_map'|@translate}</th>
+    <th style="width:220px;">{'gmaps_map_associate_kmlfile'|@translate}</th>
     <th width="40px">&nbsp;</th>
   </tr>
@@ -432,5 +474,16 @@
             <td>{'gmaps_map_associate_kmlfile'|@translate}</td>
             <td>
-              <input type="text" id="iBDAssocKmlFileUrl" maxlength='255' size='55' value="">
+              <label><input type="radio" id='iBDAssocKmlNone' name="fBDAssocKmlFile" value="N">&nbsp;{'gmaps_kml_file_none'|@translate}</label><br>
+              <label><input type="radio" id='iBDAssocKmlSelect' name="fBDAssocKmlFile" value="S">&nbsp;{'gmaps_kml_file_selected'|@translate}</label><br>
+              <select style="margin-left:20px;margin-bottom:10px;"  id="iBDAssocKmlFileId">
+                {foreach from=$datas.kmlFiles item=file}
+                  <option value='{$file.id}'>{$file.name}</option>
+                {/foreach}
+              </select>
+
+              <label><input type="radio" id='iBDAssocKmlUrl' name="fBDAssocKmlFile" value="U">&nbsp;{'gmaps_kml_file_url'|@translate}</label><br>
+              <input style="margin-left:20px;" type="text" id="iBDAssocKmlFileUrl" maxlength='255' size='55' value=""><br>
+              <p id='iBDKmlWarning' class='helps' style="width:520px;padding-right:20px;">{'gmaps_kml_file_access'|@translate}</p>
+
             </td>
           </tr>
Index: /extensions/GMaps/admin/gmaps_category_maps_iListMaps.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_category_maps_iListMaps.tpl	(revision 7131)
+++ /extensions/GMaps/admin/gmaps_category_maps_iListMaps.tpl	(revision 7132)
@@ -4,7 +4,13 @@
     <td>{$data.catName}</td>
     <td style="width:90px;">{$data.applySubCat}</td>
-    <th style="width:150px;">{$data.displayType}</th>
-    <td style="width:300px;">{$data.mapName}</td>
-    <td style="width:90px;">{$data.mapKmlFile}</td>
+    <td style="width:150px;">{$data.displayType}</td>
+    <td style="width:350px;">{$data.mapName}</td>
+    <td style="width:220px;">
+      {if $data.mapKmlFile==''}
+        {'gmaps_n'|@translate}
+      {else}
+        {'gmaps_y'|@translate}&nbsp;<span style='font-style:italic;'>({$data.mapKmlFile})</span>
+      {/if}
+    </td>
 
     <td width="40px">
Index: /extensions/GMaps/admin/gmaps_kmlfiles.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_kmlfiles.tpl	(revision 7132)
+++ /extensions/GMaps/admin/gmaps_kmlfiles.tpl	(revision 7132)
@@ -0,0 +1,359 @@
+{known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"}
+{known_script id="jquery.ui.sortable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.sortable.packed.js"}
+{known_script id="jquery.ui.dialog" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.dialog.packed.js"}
+
+{literal}
+
+<script type="text/javascript">
+
+
+  function kmlFileManager ()
+  {
+    var properties = {
+      id:'',
+    }
+
+
+    /**
+     * initialize the page
+     */
+    this.init = function ()
+    {
+
+      $('#iDialogEdit')
+        .dialog(
+          {
+            autoOpen:false,
+            width:800,
+            height:150,
+            modal: true,
+            dialogClass: 'gcBgTabSheet gcBorder',
+            title: '{/literal}{"gmaps_kml_file_management"|@translate}{literal}',
+            buttons:
+              {
+                '{/literal}{"gmaps_ok"|@translate}{literal}':
+                  function()
+                  {
+                    if(checkValidity()) doUpdate();
+                  },
+                '{/literal}{"gmaps_cancel"|@translate}{literal}':
+                  function()
+                  {
+                    $('#iDialogEdit').dialog("close");
+                  }
+              }
+          }
+        );
+
+      loadList();
+    }
+
+
+    /**
+     * open the dialog box to edit the kml file properties
+     *
+     * @param String id : if set to '' => open dialogbox in 'add' mode
+     *                    otherwise edit the given kml file
+     */
+    this.editKmlFile = function (id)
+    {
+      properties.id=id;
+      updateDialog('');
+
+      $('#iErrorMsg').css('display', 'none');
+
+      $('#iDialogEdit')
+        .bind('dialogopen', function ()
+          {
+            if(properties.id!='')
+            {
+              displayProcessing(true);
+
+              $.ajax(
+                {
+                  type: "POST",
+                  url: "{/literal}{$datas.urlRequest}{literal}",
+                  async: true,
+                  data: { ajaxfct:"admin.kmlFiles.getFile", id:properties.id },
+                  success:
+                    function(msg)
+                    {
+                      updateDialog(msg);
+                      displayProcessing(false);
+                    }
+                }
+              );
+            }
+          }
+        )
+        .dialog("open");
+    }
+
+    /**
+     * delete a kml file
+     *
+     * @param String id : id of the kml file to delete
+     */
+    this.deleteKmlFile = function (id)
+    {
+      $('#iErrorMsg').css('display', 'none');
+
+      $('#iDialogDelete')
+        .html('<br>{/literal}{"gmaps_pleaseConfirmKml_1"|@translate}<br><br>{"gmaps_pleaseConfirmKml_2"|@translate}{literal}')
+        .dialog(
+          {
+            autoOpen:true,
+            modal: true,
+            dialogClass: 'gcBgTabSheet gcBorder',
+            title: '{/literal}{"gmaps_deleteKml"|@translate}{literal}',
+            buttons:
+              {
+                '{/literal}{"gmaps_delete"|@translate}{literal}':
+                  function()
+                  {
+                    $(this).html("<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
+                    $.ajax(
+                      {
+                        type: "POST",
+                        url: "{/literal}{$datas.urlRequest}{literal}",
+                        async: true,
+                        data: { ajaxfct:"admin.kmlFiles.deleteFile", id:id },
+                        success:
+                          function(msg)
+                          {
+                            $('#iDialogDelete').dialog("destroy");
+                            loadList();
+                          }
+                      }
+                    );
+                  },
+                '{/literal}{"gmaps_cancel"|@translate}{literal}':
+                  function()
+                  {
+                    $('#iDialogDelete').dialog("destroy");
+                  }
+              }
+          }
+        );
+    }
+
+    /**
+     * update values of the dialog box
+     *
+     * @param String items : json string ; if empty assume to reset all fields
+     *                       with blank
+     */
+    var updateDialog = function (items)
+    {
+      if(items=='')
+      {
+        $('#iBDKmlId').val('');
+        $('#iBDKmlName').val('');
+        $('#iBDKmlCurrentFile').html('').css('display', 'none');
+      }
+      else
+      {
+        tmp=$.parseJSON(items);
+
+        $('#iBDKmlId').val(tmp.id);
+        $('#iBDKmlName').val(tmp.name);
+        $('#iBDKmlCurrentFile').html(tmp.file+' ('+tmp.fileSizeUnits+', '+tmp.fileDate+')').css('display', 'block');
+
+        properties.id=tmp.id;
+      }
+      $('#iBDKmlFile').val('');
+    }
+
+    /**
+     * reload the assocation list
+     */
+    var loadList = function ()
+    {
+      $('#iListKml').html("<br>{/literal}{'gmaps_loading'|@translate}{literal}<br><img src='./plugins/GrumPluginClasses/icons/processing.gif'>");
+
+      $.ajax(
+        {
+          type: "POST",
+          url: "{/literal}{$datas.urlRequest}{literal}",
+          async: true,
+          data: { ajaxfct:"admin.kmlFiles.getList" },
+          success:
+            function(msg)
+            {
+              $("#iListKml").html(msg);
+            }
+        }
+      );
+    }
+
+
+    /**
+     * check for the validity of the map settings
+     */
+    var checkValidity = function ()
+    {
+      $('.error').removeClass('error');
+      ok=true;
+
+      if($('#iBDKmlId').val()=='' && $('#iBDKmlFile').val()=='')
+      {
+        $('#iBDKmlFile').addClass('error');
+        alert('{/literal}{"gmaps_file_required"|@translate}{literal}');
+        ok=false;
+      }
+
+      re=/.*(\.kml|\.kmz)$/i;
+      if($('#iBDKmlFile').val()!='' && re.exec($('#iBDKmlFile').val())==null)
+      {
+        $('#iBDKmlFile').addClass('error');
+        alert('{/literal}{"gmaps_file_is_not_kml_kmz"|@translate}{literal}');
+        ok=false;
+      }
+
+      return(ok);
+    }
+
+    /**
+     * send assoc update to the server, and close the dialog box if everything
+     * is ok
+     */
+    var doUpdate = function ()
+    {
+      displayProcessing(true);
+
+      if($('#iBDKmlFile').val()!='')
+      {
+        /*
+         * because it's not possible to upload file through ajax, using the
+         * standard FORM method
+         */
+
+        $('#iBDKmlForm').get(0).submit();
+      }
+      else
+      {
+        // there is only the name to change, use an ajax call
+        $.ajax(
+          {
+            type: "POST",
+            url: "{/literal}{$datas.urlRequest}{literal}",
+            async: true,
+            data: { ajaxfct:"admin.kmlFiles.setFile", id:properties.id, name:$('#iBDKmlName').val() },
+            success:
+              function(msg)
+              {
+                displayProcessing(false);
+
+                if(msg.match(/^[0-9]+$/i)!=null)
+                {
+                  // result Ok ! => close the dialog box and reload the list
+                  $('#iDialogEdit').dialog("close");
+                  loadList();
+                }
+                else
+                {
+                  returned=msg.split('!');
+                  if(returned[0]!='') $('#'+returned[0]).addClass('error');
+                  alert(returned[1]);
+                }
+              }
+          }
+        );
+      }
+
+    }
+
+    /**
+     * display or hide the processing flower
+     */
+    var displayProcessing = function (visible)
+    {
+      if(visible)
+      {
+        $('#iBDProcessing').css("display", "block");
+      }
+      else
+      {
+        $('#iBDProcessing').css("display", "none");
+      }
+    }
+
+    this.init();
+  }
+
+
+</script>
+
+{/literal}
+
+
+
+<h2>{'gmaps_kml_files_management'|@translate}</h2>
+
+
+<div class='addMap'>
+  <a onclick="km.editKmlFile('');">{'gmaps_add_a_new_kmlFile'|@translate}</a>
+</div>
+
+
+<table id='iHeaderListMaps' class="littlefont">
+  <tr>
+    <th>{'gmaps_name'|@translate}</th>
+    <th style="width:300px;">{'gmaps_file'|@translate}</th>
+    <th style="width:180px;">{'gmaps_date'|@translate}</th>
+    <th style="width:90px;">{'gmaps_file_size'|@translate}</th>
+    <th style="width:90px;">{'gmaps_nb_assoc'|@translate}</th>
+    <th width="40px">&nbsp;</th>
+
+  </tr>
+</table>
+
+
+
+<div id='iListKml' class="{$themeconf.name}">
+</div>
+<div id="iListKmlNb"></div>
+
+<div id="iDialogDelete">
+</div>
+
+<div id="iDialogEdit">
+  <div id='iBDProcessing' style="display:none;position:absolute;width:100%;height:100%;background:#000000;opacity:0.75">
+      <img src="plugins/GrumPluginClasses/icons/processing.gif" style="margin-top:100px;">
+  </div>
+
+  <form id='iBDKmlForm' action="{$datas.urlRequest}" method="POST" enctype="multipart/form-data">
+
+    <table class="formtable">
+      <tr>
+        <td>{'gmaps_name'|@translate}</td>
+        <td>
+          <input type='hidden' id='iBDKmlId' name ="id" value=''>
+          <input type='hidden' id='iBDKmlAjaxFct' name="ajaxfct" value='admin.kmlFiles.setFile'>
+          <input type='text' id='iBDKmlName' name='name' value='' maxlength=255 size=60>
+        </td>
+      </tr>
+
+      <tr id='iBDKmlFileInputRow'>
+        <td>{'gmaps_file'|@translate}</td>
+        <td>
+          <div id='iBDKmlCurrentFile' name='iBDKmlCurrentFile' class='gcBorderInput gcBgInput gcTextInput' style='display:block;margin-bottom:2px;padding:2px;'></div>
+          <input type='file' size=60 id='iBDKmlFile' name="file" value='' accept='kml'>
+        </td>
+      </tr>
+
+    </table>
+
+  </form>
+</div>
+
+
+
+
+
+{literal}
+<script type="text/javascript">
+  var km=new kmlFileManager();
+</script>
+{/literal}
+
Index: /extensions/GMaps/admin/gmaps_kmlfiles_iListFiles.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_kmlfiles_iListFiles.tpl	(revision 7132)
+++ /extensions/GMaps/admin/gmaps_kmlfiles_iListFiles.tpl	(revision 7132)
@@ -0,0 +1,24 @@
+<table class="littlefont">
+  {foreach from=$datas item=data}
+  <tr>
+    <td>{$data.name}</td>
+    <td style="width:300px;">{$data.file}</td>
+    <th style="width:180px;">{$data.fileDate}</th>
+    <td style="width:90px;">{$data.fileSize}</td>
+    <td style="width:90px;">{$data.nbAssoc}</td>
+
+    <td width="40px">
+      <img src="{$themeconf.admin_icon_dir}/edit_s.png"
+           class="button" alt="{'gmaps_edit'|@translate}"
+           title="{'gmaps_edit'|@translate}"
+           onclick='km.editKmlFile({$data.id});'/>
+      <img src="{$themeconf.admin_icon_dir}/delete.png"
+           class="button"
+           alt="{'gmaps_delete'|@translate}"
+           title="{'gmaps_delete'|@translate}"
+           onclick='km.deleteKmlFile({$data.id});'/>
+    </td>
+  </tr>
+  {/foreach}
+</table>
+
Index: /extensions/GMaps/admin/gmaps_search.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_search.tpl	(revision 7132)
+++ /extensions/GMaps/admin/gmaps_search.tpl	(revision 7132)
@@ -0,0 +1,4 @@
+
+<h2>{'gmaps_search_by_geographic_area'|@translate}</h2>
+
+{$gmaps_search_page}
Index: /extensions/GMaps/gmaps.css
===================================================================
--- /extensions/GMaps/gmaps.css	(revision 7131)
+++ /extensions/GMaps/gmaps.css	(revision 7132)
@@ -1,8 +1,18 @@
 #iHeaderListMaps { width:100%; border:1px solid; border-collapse: collapse; margin-top:3px; }
-#iListMaps, #iListAssoc { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto; position:relative; left:-1px;}
-#iListMapsNb, #iListAssocNb { width:99%; text-align:right; margin-bottom:8px; padding:2px; font-size:80%; }
-#iListMaps table, table.listMaps, #iListAssoc table { width:100%; text-align:left; border-collapse: collapse; }
-#iListMaps.roma table tr:hover, #iListAssoc.roma table tr:hover  { cursor:pointer; background:#303030; }
-#iListMaps.clear table tr:hover, #iListAssoc.clear table tr:hover { cursor:pointer; color: #D54E21; background:#dbe8f3; }
+#iListMaps, #iListAssoc, #iListKml { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto; position:relative; left:-1px;}
+#iListMapsNb, #iListAssocNb, #iListKmlNb { width:99%; text-align:right; margin-bottom:8px; padding:2px; font-size:80%; }
+
+#iListMaps table, table.listMaps,
+#iListAssoc table,
+#iListKml table  { width:100%; text-align:left; border-collapse: collapse; }
+
+#iListMaps.roma table tr:hover,
+#iListAssoc.roma table tr:hover,
+#iListKml.roma table tr:hover  { cursor:pointer; background:#303030; }
+
+#iListMaps.clear table tr:hover,
+#iListAssoc.clear table tr:hover,
+#iListKml.clear table tr:hover { cursor:pointer; color: #D54E21; background:#dbe8f3; }
+
 div.addMap { text-align:left; }
 
Index: /extensions/GMaps/gmaps2.css
===================================================================
--- /extensions/GMaps/gmaps2.css	(revision 7131)
+++ /extensions/GMaps/gmaps2.css	(revision 7132)
@@ -140,5 +140,5 @@
   position:absolute;
   z-index:1500;
-  background:#000000;
+  background:#ffffff;
   opacity:0.55;
   filter:alpha(opacity:55);
Index: /extensions/GMaps/gmaps_aip.class.inc.php
===================================================================
--- /extensions/GMaps/gmaps_aip.class.inc.php	(revision 7131)
+++ /extensions/GMaps/gmaps_aip.class.inc.php	(revision 7132)
@@ -50,8 +50,7 @@
                           l10n('gmaps_associate_category_maps'),
                           $this->getAdminLink()."&amp;fGMaps_tabsheet=category_maps");
-/*
     $this->tabsheet->add('kml_files',
                           l10n('gmaps_kml_files_management'),
-                          $this->getAdminLink()."&amp;fGMaps_tabsheet=kml_files"); */
+                          $this->getAdminLink()."&amp;fGMaps_tabsheet=kml_files");
     $this->tabsheet->add('search',
                           l10n('gmaps_search'),
@@ -128,4 +127,10 @@
 
     $template->assign('plugin', $template_plugin);
+
+    if($_REQUEST['errcode']!='')
+    {
+      $template->assign('errcode', l10n('gmaps_error_code_'.$_REQUEST['errcode']));
+    }
+
     $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
 
@@ -144,4 +149,6 @@
   {
     //initialise $REQUEST values if not defined
+
+    if(!isset($_REQUEST['errcode'])) $_REQUEST['errcode']='';
 
     if(!isset($_REQUEST['fGMaps_tabsheet']))
@@ -227,4 +234,5 @@
       'maps' => $this->makeMapsList(),
       'icons' => $this->makeIconsList(),
+      'kmlFiles'  => $this->makeKmlFilesList()
     );
     $template->assign('datas', $datas);
@@ -242,9 +250,13 @@
     global $template;
 
-    /*$template->set_filename('body_page',
-                dirname($this->getFileLocation()).'/admin/plugin_admin_maps.tpl');
-
-
-    $template->assign_var_from_handle('GMAPS_BODY_PAGE', 'body_page');*/
+    $template->set_filename('body_page',
+                dirname($this->getFileLocation()).'/admin/gmaps_kmlfiles.tpl');
+
+    $datas=Array(
+      'urlRequest' => $this->getAdminLink('ajax'),
+    );
+    $template->assign('datas', $datas);
+
+    $template->assign_var_from_handle('GMAPS_BODY_PAGE', 'body_page');
   }
 
@@ -370,5 +382,5 @@
 
     return($returned);
-  } //makeCategoriesTree
+  } //makeMapsList
 
 
@@ -395,7 +407,30 @@
 
     return($returned);
+  } //makeIconsList
+
+
+  /**
+   * build the kml files list
+   * @return Array : an array, ready to use in the template
+   */
+  private function makeKmlFilesList()
+  {
+    $returned=array();
+
+    $sql="SELECT id, name
+          FROM ".$this->tables['kmlfiles']."
+          ORDER BY name, id";
+    $result = pwg_query($sql);
+    if($result)
+    {
+      while($row = pwg_db_fetch_assoc($result))
+      {
+        $returned[]=$row;
+      }
+    }
+
+    return($returned);
   } //makeCategoriesTree
 
-
 } //class
 
Index: /extensions/GMaps/gmaps_ajax.php
===================================================================
--- /extensions/GMaps/gmaps_ajax.php	(revision 7131)
+++ /extensions/GMaps/gmaps_ajax.php	(revision 7132)
@@ -60,4 +60,5 @@
 
       if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
+      if(!isset($_REQUEST['errcode'])) $_REQUEST['errcode']='';
 
       // check if asked function is valid
@@ -70,4 +71,8 @@
            $_REQUEST['ajaxfct']=='admin.assoc.getAssoc' or
            $_REQUEST['ajaxfct']=='admin.assoc.deleteAssoc' or
+           $_REQUEST['ajaxfct']=='admin.kmlFiles.getList' or
+           $_REQUEST['ajaxfct']=='admin.kmlFiles.setFile' or
+           $_REQUEST['ajaxfct']=='admin.kmlFiles.getFile' or
+           $_REQUEST['ajaxfct']=='admin.kmlFiles.deleteFile' or
 
            $_REQUEST['ajaxfct']=='public.maps.init' or
@@ -87,8 +92,12 @@
 
         /*
-         * check admin.maps.getMap & admin.assoc.getAssoc values
+         * check values for
+         *  admin.maps.getMap
+         *  admin.assoc.getAssoc
+         *  admin.kmlFiles.getFile
          */
         if($_REQUEST['ajaxfct']=="admin.maps.getMap" or
-           $_REQUEST['ajaxfct']=="admin.assoc.getAssoc")
+           $_REQUEST['ajaxfct']=="admin.assoc.getAssoc" or
+           $_REQUEST['ajaxfct']=="admin.kmlFiles.getFile")
         {
           if(!isset($_REQUEST['id']) or
@@ -98,8 +107,12 @@
 
         /*
-         * check admin.maps.deleteMap values
+         * check values for
+         *  admin.maps.deleteMap
+         *  admin.assoc.deleteAssoc
+         *  admin.kmlFiles.deleteFile
          */
         if($_REQUEST['ajaxfct']=="admin.maps.deleteMap" or
-           $_REQUEST['ajaxfct']=="admin.maps.deleteAssoc")
+           $_REQUEST['ajaxfct']=="admin.assoc.deleteAssoc" or
+           $_REQUEST['ajaxfct']=="admin.kmlFiles.deleteFile")
         {
           if(!isset($_REQUEST['id']) or
@@ -190,4 +203,5 @@
                  isset($_REQUEST['datas']['mapId']) &&
                  isset($_REQUEST['datas']['applySubCat']) &&
+                 isset($_REQUEST['datas']['kmlFileId']) &&
                  isset($_REQUEST['datas']['kmlFileUrl']) &&
                  isset($_REQUEST['datas']['icon']) &&
@@ -208,4 +222,25 @@
           }
         }
+
+
+        /*
+         * check admin.kmlFiles.setFile values
+         */
+        if($_REQUEST['ajaxfct']=="admin.kmlFiles.setFile")
+        {
+          if(!isset($_REQUEST['id']) )
+          {
+            $_REQUEST['ajaxfct']='';
+          }
+          else
+          {
+            if($_REQUEST['id']=='')
+            {
+              if(!(isset($_FILES['file']['name']) and
+                   isset($_FILES['file']['tmp_name']))) $_REQUEST['ajaxfct']='';
+            }
+          }
+        }
+
 
 
@@ -293,4 +328,17 @@
           $result=$this->ajax_gmaps_admin_assocDeleteAssoc($_REQUEST['id']);
           break;
+        case 'admin.kmlFiles.getList':
+          $result=$this->ajax_gmaps_admin_kmlFilesGetList();
+          break;
+        case 'admin.kmlFiles.getFile':
+          $result=$this->ajax_gmaps_admin_kmlFilesGetFile($_REQUEST['id']);
+          break;
+        case 'admin.kmlFiles.setFile':
+          $result=$this->ajax_gmaps_admin_kmlFilesSetFile($_REQUEST['id'], $_REQUEST['name']);
+          break;
+        case 'admin.kmlFiles.deleteFile':
+          $result=$this->ajax_gmaps_admin_kmlFilesDeleteFile($_REQUEST['id']);
+          break;
+
 
         case 'public.maps.init':
@@ -496,9 +544,10 @@
       $sql="SELECT pgcm.id, pgcm.categoryId, pct.name AS catName,
                    pgmm.name AS mapName, pgmm.displayType,
-                   pgcm.kmlFileUrl, pgcm.imgSort, pgcm.applySubCat, pgcm.icon,
-                   pgcm.title
-            FROM (".$this->tables['category_maps']." pgcm
+                   pgcm.kmlFileId, pgcm.kmlFileUrl, pgcm.imgSort, pgcm.applySubCat, pgcm.icon,
+                   pgcm.title, pgkf.name AS kmlName
+            FROM ((".$this->tables['category_maps']." pgcm
                   LEFT JOIN ".CATEGORIES_TABLE." pct ON pct.id=pgcm.categoryId)
-                  LEFT JOIN ".$this->tables['maps']." pgmm ON pgcm.mapId = pgmm.id
+                  LEFT JOIN ".$this->tables['maps']." pgmm ON pgcm.mapId = pgmm.id)
+                  LEFT JOIN ".$this->tables['kmlfiles']." pgkf ON pgkf.id = pgcm.kmlFileId
             ORDER BY pct.name, pgmm.displayType, pgcm.imgSort";
       $result=pwg_query($sql);
@@ -513,4 +562,18 @@
           $keys['prev']=$keys['curr'];
 
+          if($row['kmlFileId']>0)
+          {
+            $mapKmlFile=$row['kmlName'];
+          }
+          elseif($row['kmlFileUrl']!='')
+          {
+            $mapKmlFile='URL';
+          }
+          else
+          {
+            $mapKmlFile='';
+          }
+
+
           $tmp=array(
             'id' => $row['id'],
@@ -518,5 +581,5 @@
             'applySubCat' => l10n('gmaps_'.$row['applySubCat']),
             'mapName' => $row['mapName'],
-            'mapKmlFile' => l10n('gmaps_'.(($row['kmlFileUrl']=='')?'n':'y')),
+            'mapKmlFile' => $mapKmlFile,
             'icon' => $row['icon'],
             'displayType' => l10n('gmaps_displayTypeShort'.$row['displayType']),
@@ -598,4 +661,5 @@
                 ($db['maxImgSort']+1)."', '".
                 $properties['applySubCat']."', '".
+                $properties['kmlFileId']."', '".
                 $properties['kmlFileUrl']."', '".
                 $properties['icon']."', '".
@@ -611,5 +675,6 @@
                 $properties['mapId']."', applySubCat='".
                 $properties['applySubCat']."', kmlFileUrl='".
-                $properties['kmlFileUrl']."', icon='".
+                $properties['kmlFileUrl']."', kmlFileId='".
+                $properties['kmlFileId']."', icon='".
                 $properties['icon']."', title='".
                 mysql_escape_string($properties['title'])."'
@@ -637,4 +702,5 @@
         'mapId' => '',
         'applySubCat'=> 'y',
+        'kmlFileId' => 0,
         'kmlFileUrl' => '',
         'icon' => '',
@@ -642,5 +708,5 @@
       );
 
-      $sql="SELECT id, categoryId, mapId, applySubCat, kmlFileUrl,
+      $sql="SELECT id, categoryId, mapId, applySubCat, kmlFileId, kmlFileUrl,
                    icon, title
             FROM ".$this->tables['category_maps']."
@@ -676,4 +742,250 @@
       return('ko!unknown error');
     } //ajax_gmaps_admin_assocDeleteAssoc
+
+
+
+    /**
+     * return a HTML list of referenced kml files
+     *
+     * @return String
+     */
+    private function ajax_gmaps_admin_kmlFilesGetList()
+    {
+      global $template;
+
+      $template->set_filename('list_page',
+                    dirname($this->getFileLocation()).'/admin/gmaps_kmlfiles_iListFiles.tpl');
+
+      $datas=Array();
+
+      $sql="SELECT pgkf.id, pgkf.file, pgkf.name, pgkf.fileDate, pgkf.fileSize, COUNT(pgcm.id) AS nbAssoc
+            FROM ".$this->tables['kmlfiles']." pgkf
+                  LEFT JOIN ".$this->tables['category_maps']." pgcm ON pgcm.kmlFileId = pgkf.id
+            GROUP BY pgkf.id
+            ORDER BY pgkf.name";
+
+      $result=pwg_query($sql);
+      if($result)
+      {
+        while($row=pwg_db_fetch_assoc($result))
+        {
+          $row['fileSize']=$this->formatOctet($row['fileSize']);
+          $datas[]=$row;
+        }
+      }
+
+      $template->assign('datas', $datas);
+      return($template->parse('list_page', true));
+    } //ajax_gmaps_admin_kmlFilesGetList
+
+
+
+
+    /**
+     * set properties for a given file id ; if no file id is given create a new
+     * file
+     *
+     * @param String $id : the file Id
+     * @param String $name : the name
+     * @param String $file : the file name
+     * @return String : the num id, or an error message
+     */
+    private function ajax_gmaps_admin_kmlFilesSetFile($id, $name)
+    {
+      global $template;
+
+      if(isset($_FILES['file']['name']))
+      {
+        $file=$_FILES['file']['name'];
+      }
+      else
+      {
+        $file='';
+      }
+
+      if($file=='' and $id!='')
+      {
+        // update name for an existing file
+        $sql="UPDATE ".$this->tables['kmlfiles']."
+              SET name='".mysql_escape_string($name)."'
+              WHERE id='$id';";
+        $result=pwg_query($sql);
+      }
+      elseif($file!='')
+      {
+        // check if this file is not already used by an another file id
+        $sql="SELECT file
+              FROM ".$this->tables['kmlfiles']."
+              WHERE file='".mysql_escape_string($_FILES['file']['name'])."'";
+        if($id!='') $sql.=" AND id!='$id'";
+        $result=pwg_query($sql);
+        if($result)
+        {
+          $ok='';
+          while($row=pwg_db_fetch_assoc($result))
+          {
+            $ok=$row['file'];
+          }
+          if($ok!='')
+          {
+            //file already used by another file id
+            header("Location: ".$_SERVER['HTTP_REFERER']."&errcode=aksf10");
+            exit();
+          }
+        }
+        else
+        {
+          //unknown error
+          header("Location: ".$_SERVER['HTTP_REFERER']."&errcode=aksf01");
+          exit();
+        }
+
+        $file=dirname(__FILE__).'/kml/'.$file;
+
+        if(file_exists($file)) unlink($file);
+        if($id!='')
+        {
+          $currentInfo=$this->ajax_gmaps_admin_kmlFilesGetFile($id, false);
+          if(file_exists(dirname(__FILE__).'/kml/'.$currentInfo['file'])) unlink(dirname(__FILE__).'/kml/'.$currentInfo['file']);
+        }
+
+
+        if(!move_uploaded_file($_FILES['file']['tmp_name'], $file))
+        {
+          /*
+           * something was wrong, previous file was deleted, so delete the file
+           * from the database
+           */
+          if($id!='') $this->ajax_gmaps_admin_kmlFilesDeleteFile($id);
+          // error when trying to copy the uploaded file
+          header("Location: ".$_SERVER['HTTP_REFERER']."&errcode=aksf02");
+          exit();
+        }
+
+        if($id!='')
+        {
+          // update file & name for an existing file
+          $sql="UPDATE ".$this->tables['kmlfiles']."
+                SET name='".mysql_escape_string($name)."',
+                    file='".mysql_escape_string($_FILES['file']['name'])."',
+                    fileSize=".filesize($file).",
+                    fileDate='".date('Y-m-d H:i:s', filemtime($file))."'
+                WHERE id='$id';";
+          $result=pwg_query($sql);
+        }
+        else
+        {
+          $sql="INSERT INTO ".$this->tables['kmlfiles']."
+                VALUES ('', '".mysql_escape_string($_FILES['file']['name'])."',
+                '".mysql_escape_string($name)."',
+                '".date('Y-m-d H:i:s', filemtime($file))."',
+                '".filesize($file)."')";
+          $result=pwg_query($sql);
+          $id=pwg_db_insert_id();
+        }
+
+        header("Location: ".$_SERVER['HTTP_REFERER']);
+        exit();
+      }
+
+
+
+      return($id);
+    } //ajax_gmaps_admin_kmlFilesSetFile
+
+
+
+    /**
+     * get properties for a given file id
+     *
+     * @param String id : the file Id
+     * @param Bool $json : if true, return a json string, otherwise an array
+     * @return String : data formatted in a JSON string
+     */
+    private function ajax_gmaps_admin_kmlFilesGetFile($id, $json=true)
+    {
+      $returned=array(
+        'id' => '',
+        'file' => '',
+        'name' => '',
+        'fileDate'=> '',
+        'fileSize' => 0,
+        'fileSizeUnits' => 0,
+      );
+
+      $sql="SELECT id, file, name, fileDate, fileSize
+            FROM ".$this->tables['kmlfiles']."
+            WHERE id='$id';";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        while($row=pwg_db_fetch_assoc($result))
+        {
+          $row['fileSizeUnits']=$this->formatOctet($row['fileSize']);
+          $returned=$row;
+        }
+      }
+
+      if($json)
+      {
+        return(json_encode($returned));
+      }
+      else
+      {
+        return($returned);
+      }
+    } //ajax_gmaps_admin_kmlFilesGetFile
+
+
+
+
+    /**
+     * delete a file
+     *
+     * @param String id : if of the file to delete
+     * @return String : ok or ko
+     */
+    private function ajax_gmaps_admin_kmlFilesDeleteFile($id)
+    {
+      $file='';
+
+      /*
+       * before deleting record in the table, get the associated file name stored
+       * on the server
+       */
+      $sql="SELECT file
+            FROM ".$this->tables['kmlfiles']."
+            WHERE id='$id';";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        while($row=pwg_db_fetch_assoc($result))
+        {
+          $file=$row['file'];
+        }
+      }
+
+      // reset kmlFileId for assocation
+      $sql="UPDATE ".$this->tables['category_maps']."
+            SET kmlFileId='0'
+            WHERE kmlFileId='$id'";
+      pwg_query($sql);
+
+      // delete the file
+      $sql="DELETE FROM ".$this->tables['kmlfiles']."
+            WHERE id='$id';";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        if($file!='' and file_exists(dirname(__FILE__).'/kml/'.$file))
+        {
+          unlink(dirname(__FILE__).'/kml/'.$file);
+        }
+        return('ok');
+      }
+      return('ko!unknown error');
+    } //ajax_gmaps_admin_kmlFilesDeleteFile
+
+
 
 
@@ -982,6 +1294,4 @@
           }
 
-
-
           $returned['markers'][]=$coords;
           $returned['datas']['nbPhotos']+=$coords['nbImages'];
@@ -993,7 +1303,11 @@
         $returned['datas']['nbPhotos']=sprintf(l10n('gmaps_nb_pictures'), $returned['datas']['nbPhotos']);
       }
+      elseif($returned['datas']['nbPhotos']==1)
+      {
+        $returned['datas']['nbPhotos']=l10n('gmaps_1_picture');
+      }
       else
       {
-        $returned['datas']['nbPhotos']=l10n('gmaps_1_picture');
+        $returned['datas']['nbPhotos']=l10n('gmaps_0_picture');
       }
 
@@ -1002,4 +1316,80 @@
 
 
+
+
+     /**
+      * formats a file size into a human readable size
+      *
+      * @param String $format : "A"  : auto
+      *                         "Ai" : auto (io)
+      *                         "O"  : o
+      *                         "K"  : Ko
+      *                         "M"  : Mo
+      *                         "G"  : Go
+      *                         "Ki" : Kio
+      *                         "Mi" : Mio
+      *                         "Gi" : Gio
+      * @param String $thsep : thousand separator
+      * @param Integer $prec : number of decimals
+      * @param Bool $visible : display or not the unit
+      * @return String : a formatted file size
+      */
+     private function formatOctet($octets, $format="Ai", $thsep="", $prec=2, $visible=true)
+     {
+      if($format=="Ai")
+      {
+       if($octets<1024)
+       { $format="O"; }
+       elseif($octets<1024000)
+       { $format="Ki"; }
+       elseif($octets<1024000000)
+       { $format="Mi"; }
+       else
+       { $format="Gi"; }
+      }
+      elseif($format=="A")
+      {
+       if($octets<1000)
+       { $format="O"; }
+       elseif($octets<1000000)
+       { $format="Ki"; }
+       elseif($octets<1000000000)
+       { $format="Mi"; }
+       else
+       { $format="Gi"; }
+      }
+
+      switch($format)
+      {
+       case "O":
+        $unit="o"; $div=1;
+        break;
+       case "K":
+        $unit="Ko"; $div=1000;
+        break;
+       case "M":
+        $unit="Mo"; $div=1000000;
+        break;
+       case "G":
+        $unit="Go"; $div=1000000000;
+        break;
+       case "Ki":
+        $unit="Kio"; $div=1024;
+        break;
+       case "Mi":
+        $unit="Mio"; $div=1024000;
+        break;
+       case "Gi":
+        $unit="Gio"; $div=1024000000;
+        break;
+      }
+
+      $returned=number_format($octets/$div, $prec, '.', $thsep);
+      if($visible) $returned.=' '.$unit;
+      return($returned);
+     } //function formatOctet
+
+
+
   } //class
 
Index: /extensions/GMaps/gmaps_install.class.inc.php
===================================================================
--- /extensions/GMaps/gmaps_install.class.inc.php	(revision 7131)
+++ /extensions/GMaps/gmaps_install.class.inc.php	(revision 7132)
@@ -69,4 +69,5 @@
   `imgSort` smallint(5) unsigned NOT NULL default '0',
   `applySubCat` char(1) NOT NULL default 'y',
+  `kmlFileId` int(10) unsigned NOT NULL default '0',
   `kmlFileUrl` varchar(255) NOT NULL,
   `icon` varchar(255) NOT NULL,
@@ -87,4 +88,12 @@
   `imageCatsPLink` varchar(255) NOT NULL,
   PRIMARY KEY  USING BTREE (`userId`,`requestId`,`imageId`)
+)",
+"CREATE TABLE `".$this->tables['kmlfiles']."` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `file` varchar(255) NOT NULL,
+  `name` varchar(255) NOT NULL,
+  `fileDate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+  `fileSize` mediumint(8) unsigned NOT NULL,
+  PRIMARY KEY  (`id`)
 )"
       );
Index: /extensions/GMaps/gmaps_root.class.inc.php
===================================================================
--- /extensions/GMaps/gmaps_root.class.inc.php	(revision 7131)
+++ /extensions/GMaps/gmaps_root.class.inc.php	(revision 7132)
@@ -76,5 +76,5 @@
       $this->section_name=$this->getPluginNameFiles();
 
-      $this->setTablesList(array('maps', 'category_maps', 'cache'));
+      $this->setTablesList(array('maps', 'category_maps', 'cache', 'kmlfiles'));
       $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
     }
@@ -203,5 +203,5 @@
        */
       $sql="SELECT DISTINCT pgcm.id, pgcm.categoryId,
-              pgcm.imgSort, pgcm.applySubCat, pgcm.kmlFileUrl,
+              pgcm.imgSort, pgcm.applySubCat, pgcm.kmlFileUrl, pgcm.kmlFileId, pgkf.file AS kmlFileUrlId,
               pgcm.icon, pgcm.title,
               pgmm.displayType, pgmm.sizeMode,
@@ -210,7 +210,8 @@
               pgmm.navigationControl, pgmm.style,
               IF(pgcm.categoryId=0, 0, pct.global_rank) AS priorityRank
-            FROM (".$this->tables['category_maps']." pgcm
-              LEFT JOIN ".$this->tables['maps']." pgmm ON pgcm.mapId = pgmm.id)
-              LEFT JOIN ".CATEGORIES_TABLE." pct ON (FIND_IN_SET(pgcm.categoryId, pct.uppercats)!=0 OR pgcm.categoryId=0)
+            FROM ((".$this->tables['category_maps']." pgcm
+                  LEFT JOIN ".$this->tables['maps']." pgmm ON pgcm.mapId = pgmm.id)
+                  LEFT JOIN ".CATEGORIES_TABLE." pct ON (FIND_IN_SET(pgcm.categoryId, pct.uppercats)!=0 OR pgcm.categoryId=0))
+                  LEFT JOIN ".$this->tables['kmlfiles']." pgkf ON  pgkf.id = pgcm.kmlFileId
             WHERE $where ";
       if($category!=0)
@@ -237,4 +238,7 @@
         while($row=pwg_db_fetch_assoc($result))
         {
+          // if an kml file id is given, apply the url of the file (needs to give the complete URI for google)
+          if($row['kmlFileId']>0 and $row['kmlFileUrlId']!='') $row['kmlFileUrl']=dirname($_SERVER['SCRIPT_URI']).'/plugins/GMaps/kml/'.$row['kmlFileUrlId'];
+
           if($row['displayType']!='MP')
           {
Index: /extensions/GMaps/kml/index.php
===================================================================
--- /extensions/GMaps/kml/index.php	(revision 7132)
+++ /extensions/GMaps/kml/index.php	(revision 7132)
@@ -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/GMaps/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/GMaps/language/fr_FR/plugin.lang.php	(revision 7131)
+++ /extensions/GMaps/language/fr_FR/plugin.lang.php	(revision 7132)
@@ -14,5 +14,5 @@
 $lang['gmaps_associate_category_maps'] = 'Association des cartes';
 $lang['gmaps_search'] = 'Rechercher';
-$lang['gmaps_kml_files_management'] = 'Gestion des fichiers KML';
+$lang['gmaps_kml_files_management'] = 'Gestion des fichiers KML/KMZ';
 $lang['gmaps_help'] = 'Aide';
 
@@ -30,7 +30,11 @@
 $lang['gmaps_pleaseConfirmMetadataDelete_1']="La carte ainsi que toutes les associations qui en dépendent seront supprimées.";
 $lang['gmaps_pleaseConfirmMetadataDelete_2']="Merci de confirmer la suppression.";
-$lang['gmaps_pleaseConfirmAssoc']="Merci de confirmer la suppression.";
+$lang['gmaps_pleaseConfirmKml_1']="Le fichier KML/KMZ sera supprimé et toutes les références à celui seront réinitialisées.";
+$lang['gmaps_pleaseConfirmKml_2']="Merci de confirmer la suppression.";
+$lang['gmaps_pleaseConfirmKml']="Merci de confirmer la suppression.";
 $lang['gmaps_deleteMap']="Suppression de la carte";
 $lang['gmaps_add_a_new_map']="Ajouter une carte";
+$lang['gmaps_deleteKml']="Suppression du fichier KML/KMZ";
+$lang['gmaps_add_a_new_kmlFile']="Ajouter un fichier KML/KMZ";
 
 $lang['gmaps_name']="Nom";
@@ -95,10 +99,10 @@
 $lang['gmaps_nb_pictures']="%s photos";
 $lang['gmaps_1_picture']="1 photo";
+$lang['gmaps_0_picture']="Il n'y a aucune photo sur cette zone géographique";
 $lang['gmaps_apply_subcat']="Appliquer aux sous-catégories";
 $lang['gmaps_map_id']="Carte";
-$lang['gmaps_map_kmlfile']="Présence fichier KML";
+$lang['gmaps_map_kmlfile']="Présence fichier KML/KMZ";
 $lang['gmaps_map_icon']="Icone";
-$lang['gmaps_map_kmlfile']="Associer un fichier KML";
-$lang['gmaps_map_associate_kmlfile']="Associer un fichier KML (saisir l'URL)";
+$lang['gmaps_map_associate_kmlfile']="Associer un fichier KML/KMZ";
 
 $lang['gmaps_map_integration']="Intégration dans la galerie";
@@ -134,3 +138,24 @@
 
 
+$lang['gmaps_kml_file_management']="Gestion d\\'un fichier KML/KMZ";
+$lang['gmaps_kml_files_management']="Gestion des fichiers KML/KMZ";
+$lang['gmaps_file']="Fichier";
+$lang['gmaps_date']="Date";
+$lang['gmaps_file_size']="Taille du fichier";
+$lang['gmaps_nb_assoc']="Affectations";
+$lang['gmaps_file_required']="La sélection d\\'un fichier est requise !";
+$lang['gmaps_file_is_not_kml_kmz']="L\\'extension du fichier est invalide ! Seuls les fichiers KML et KMZ sont acceptés.";
+
+$lang['gmaps_error_code_aksf01']="Une erreur d'origine inconnue est survenue... :-/";
+$lang['gmaps_error_code_aksf02']="Une erreur est survenu lors de l'enregistrement du fichier";
+$lang['gmaps_error_code_aksf10']="Un fichier portant le même nom est déjà utilisé";
+$lang['gmaps_action_was_stopped']="L'action a été interrompue pour le motif suivant :";
+
+$lang['gmaps_kml_file_selected']="Sélection parmi les fichiers gérés";
+$lang['gmaps_kml_file_url']="Saisie d'une URL";
+$lang['gmaps_kml_file_none']="Aucun";
+
+$lang['gmaps_kml_file_access']="Les fichiers KML/KMZ doivent, pour pouvoir être affichés sur une carte, être accessibles par les serveurs de Google";
+
+
 ?>
