Index: /extensions/GMaps/admin/gmaps_admin.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_admin.tpl	(revision 7054)
+++ /extensions/GMaps/admin/gmaps_admin.tpl	(revision 7054)
@@ -0,0 +1,3 @@
+<h2 style="float:right;top:-24px;position:relative;height:auto;font-size:12px;font-weight:normal;">{$plugin.GMAPS_VERSION}</h2>
+
+{$GMAPS_BODY_PAGE}
Index: /extensions/GMaps/admin/gmaps_maps.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_maps.tpl	(revision 7054)
+++ /extensions/GMaps/admin/gmaps_maps.tpl	(revision 7054)
@@ -0,0 +1,850 @@
+{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"}
+{known_script id="jquery.ui.slider" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.slider.packed.js"}
+{known_script id="maps.google.com/api" src="http://maps.google.com/maps/api/js?sensor=false"}
+
+<!--
+ Note : the position of control (navigation, mapType) were implemented, but the
+ result after trying positionning is strange...
+ so, these functionnalities are deactivated
+-->
+
+
+{literal}
+<script type="text/javascript">
+
+
+
+
+  function userDefManage ()
+  {
+    var properties = {
+      id:'',
+      gMap:null,
+    }
+
+    /**
+     * initialize the page
+     */
+    this.init = function ()
+    {
+      computedHeight=$(window).height()-100;
+      computedWidth=$(window).width()-100;
+      $('#iDialogEdit')
+        .dialog(
+          {
+            autoOpen:false,
+            width:computedWidth,
+            height:computedHeight,
+            modal: true,
+            dialogClass: 'gcBgTabSheet gcBorder',
+            title: '{/literal}{"gmaps_config_map"|@translate}{literal}',
+            buttons:
+              {
+                '{/literal}{"gmaps_ok"|@translate}{literal}':
+                  function()
+                  {
+                    if(checkValidity()) doUpdate();
+                  },
+                '{/literal}{"gmaps_cancel"|@translate}{literal}':
+                  function()
+                  {
+                    $('#iDialogEdit').dialog("close");
+                  }
+              }
+          }
+        );
+
+      $('#iBDMapId').bind('keyup focusout', function (event)
+        {
+          if(!checkIdValidity($(this).val()))
+          {
+            $(this).addClass('error');
+          }
+          else
+          {
+            $(this).removeClass('error');
+          }
+        }
+      );
+
+
+      $("#iBDMapWidthSlider").slider(
+        {
+          min:100,
+          max:1280,
+          step:5,
+          value:100,
+          slide: function(event, ui) { changeSize(ui.value, 'iBDMapWidthSlider'); }
+        });
+      $("#iBDMapHeightSlider").slider(
+        {
+          min:100,
+          max:1280,
+          step:5,
+          value:100,
+          slide: function(event, ui) { changeSize(ui.value, 'iBDMapHeightSlider'); }
+        });
+      $("#iBDMapZoomLevelSlider").slider(
+        {
+          min:1,
+          max:20,
+          step:1,
+          value:8,
+          slide: function(event, ui) { changeZoom(ui.value, 'plugin'); }
+        });
+      $("#iBDMapWidthSlider a, #iBDMapHeightSlider a, #iBDMapZoomLevelSlider").addClass('gcBgInput');
+
+      $('#iBDMapMapType').bind('change', function () { changeMapType('plugin'); } );
+      $('#iBDMapMapTypeControlType').bind('change', changeTypeControlType);
+      //$('#iBDMapTypeControlPos').bind('change', changeTypeControlPosition);
+      $('#iBDMapNavigationControlType').bind('change', changeNavigationControlType);
+      //$('#iBDMapNavigationControlPos').bind('change', changeNavigationControlPosition);
+      $('#iBDMapScaleControl').bind('change', changeScaleControl);
+
+
+      loadList();
+    }
+
+
+
+    /**
+     * change the display control display mode
+     */
+    var changeScaleControl = function ()
+    {
+      if(properties.gMap!=null)
+      {
+        properties.gMap.setOptions(
+          {
+            scaleControl: ($('#iBDMapScaleControl').val()=='n')?false:true,
+          }
+        );
+      }
+    }
+
+    /**
+     * change the display control type
+     */
+    var changeTypeControlType = function ()
+    {
+      if(properties.gMap!=null)
+      {
+        cType=parseInt($('#iBDMapMapTypeControlType').val());
+
+        properties.gMap.setOptions(
+          {
+            mapTypeControl: (cType==-1)?false:true,
+            mapTypeControlOptions:
+              {
+                style:cType
+              }
+          }
+        );
+      }
+    }
+
+    /**
+     * change the display control position
+     */
+    /*
+    var changeTypeControlPosition = function ()
+    {
+      if(properties.gMap!=null)
+      {
+        properties.gMap.setOptions(
+          {
+            mapTypeControlOptions:
+              {
+                position:parseInt($('#iBDMapTypeControlPos').val())
+              }
+          }
+        );
+      }
+    }
+    */
+
+
+    /**
+     * change the zoom control type
+     */
+    var changeNavigationControlType = function ()
+    {
+      if(properties.gMap!=null)
+      {
+        cType=parseInt($('#iBDMapNavigationControlType').val());
+
+        properties.gMap.setOptions(
+          {
+            navigationControl: (cType==-1)?false:true,
+            navigationControlOptions:
+              {
+                style:cType
+              }
+          }
+        );
+      }
+    }
+
+    /**
+     * change the zoom control position
+     */
+    /*
+    var changeNavigationControlPosition = function ()
+    {
+      if(properties.gMap!=null)
+      {
+        properties.gMap.setOptions(
+          {
+            navigationControlOptions:
+              {
+                position:parseInt($('#iBDMapTypeControlPos').val())
+              }
+          }
+        );
+      }
+    }
+    */
+
+    /**
+     * change the width/height
+     * @param value : the width or height
+     * @param id : define if the width is changed or the height
+     */
+    var changeSize = function (value, id)
+    {
+      $('#'+id+'Display').html(value+'px');
+      $('#'+id+'Value').val(value);
+
+      $('#iBDExampleMap').css(
+        {
+          width:$('#iBDMapWidthSliderValue').val()+'px',
+          height:$('#iBDMapHeightSliderValue').val()+'px'
+        }
+      );
+
+      if(properties.gMap!=null) google.maps.event.trigger(properties.gMap, 'resize');
+    }
+
+    /**
+     * change the zoom value
+     * @param value : the zoom value (1 - 20)
+     * @param caller : designed to determine who's calling the function and avoid
+     *                 recursivity in events call ; values = 'plugin' or 'map'
+     */
+    var changeZoom = function (value, caller)
+    {
+      $('#iBDMapZoomLevelSliderDisplay').html(value);
+      $('#iBDMapZoomLevelSliderValue').val(value);
+
+      if(properties.gMap!=null && caller=='plugin')
+      {
+        properties.gMap.setZoom(parseInt(value));
+      }
+      else if(caller=='map')
+      {
+        $('#iBDMapZoomLevelSlider').slider('option', 'value', value);
+      }
+    }
+
+    /**
+     * change the display mode (map type)
+     * @param caller : designed to determine who's calling the function and avoid
+     *                 recursivity in events call ; values = 'plugin' or 'map'
+     */
+    var changeMapType = function (caller)
+    {
+      if(properties.gMap!=null && caller=='plugin')
+      {
+        properties.gMap.setOptions(
+          {
+            mapTypeId: $('#iBDMapMapType').val()
+          }
+        );
+      }
+      else if(caller=='map')
+      {
+        $('#iBDMapMapType').val(properties.gMap.getMapTypeId());
+      }
+    }
+
+
+    /**
+     * initialize the map
+     */
+    var initializeMap = function ()
+    {
+      var latlng=new google.maps.LatLng(0, 0);
+
+      mapTypeControlOptions={ };
+
+      var map = new google.maps.Map($("#iBDExampleMap").get(0),
+        {
+          mapTypeId: $('#iBDMapMapType').val(),
+          zoom: parseInt($('#iBDMapZoomLevelSliderValue').val()),
+          center:latlng,
+          navigationControl: ($('#iBDMapNavigationControlType').val()!='-1')?true:false,
+          navigationControlOptions:
+            {
+              style:($('#iBDMapNavigationControlType').val()!='-1')?parseInt($('#iBDMapNavigationControlType').val()):0,
+            },
+          scaleControl: ($('#iBDMapScaleControl').val()=='n')?false:true,
+          mapTypeControl:($('#iBDMapMapTypeControlType').val()!='-1')?true:false,
+          mapTypeControlOptions:
+            {
+              style:($('#iBDMapMapTypeControlType').val()!='-1')?parseInt($('#iBDMapMapTypeControlType').val()):0,
+            },
+          markerTitle:'',
+        }
+      );
+
+      properties.gMap=map;
+
+      google.maps.event.addListener(
+        properties.gMap,
+        'zoom_changed',
+        function()
+        {
+          changeZoom(properties.gMap.getZoom(), 'map');
+        }
+      );
+
+      google.maps.event.addListener(
+        properties.gMap,
+        'maptypeid_changed',
+        function()
+        {
+          changeMapType('map');
+        }
+      );
+    }
+
+    /**
+     * manage the tabsheet
+     *
+     * @param String tabsheet : id of the tabsheet to display
+     */
+    this.displayProp = function (tabsheet)
+    {
+      switch(tabsheet)
+      {
+        case 'general':
+          $('#iTabGeneral').css('display', 'block');
+          $('#iTabDimensions').css('display', 'none');
+          $('#iTabMapType').css('display', 'none');
+          $('#iTabZoomLevel').css('display', 'none');
+          break;
+        case 'dimensions':
+          $('#iTabGeneral').css('display', 'none');
+          $('#iTabDimensions').css('display', 'block');
+          $('#iTabMapType').css('display', 'none');
+          $('#iTabZoomLevel').css('display', 'none');
+          break;
+        case 'mapType':
+          $('#iTabGeneral').css('display', 'none');
+          $('#iTabDimensions').css('display', 'none');
+          $('#iTabMapType').css('display', 'block');
+          $('#iTabZoomLevel').css('display', 'none');
+          break;
+        case 'zoomLevel':
+          $('#iTabGeneral').css('display', 'none');
+          $('#iTabDimensions').css('display', 'none');
+          $('#iTabMapType').css('display', 'none');
+          $('#iTabZoomLevel').css('display', 'block');
+          break;
+      }
+    }
+
+
+    /**
+     * open the dialog box to edit the map properties
+     *
+     * @param String id : if set to '' => open dialogbox in 'add' mode
+     *                    otherwise edit the given map
+     */
+    this.editMap = function (id)
+    {
+      properties.id=id;
+      updateDialog('');
+      this.displayProp('general');
+
+      $('#iDialogEdit')
+        .bind('dialogopen', function ()
+          {
+            if(properties.id!='')
+            {
+              displayProcessing(true);
+
+              $.ajax(
+                {
+                  type: "POST",
+                  url: "{/literal}{$datas.urlRequest}{literal}",
+                  async: true,
+                  data: { ajaxfct:"admin.maps.getMap", id:properties.id },
+                  success:
+                    function(msg)
+                    {
+                      updateDialog(msg);
+                      initializeMap();
+                      displayProcessing(false);
+                    }
+                }
+              );
+            }
+            else
+            {
+              initializeMap();
+            }
+          }
+        )
+        .dialog("open");
+    }
+
+    /**
+     * delete a map
+     *
+     * @param String id : id of the map to delete
+     */
+    this.deleteMap = function (id)
+    {
+      $('#iDialogDelete')
+        .html('<br>{/literal}{"gmaps_pleaseConfirmMetadataDelete_1"|@translate}<br><br>{"gmaps_pleaseConfirmMetadataDelete_2"|@translate}{literal}')
+        .dialog(
+          {
+            autoOpen:true,
+            modal: true,
+            dialogClass: 'gcBgTabSheet gcBorder',
+            title: '{/literal}{"gmaps_deleteMap"|@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.maps.deleteMap", 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=='')
+      {
+        $('#iBDMapId').val('');
+        $('#iBDName').val('');
+        $('#iBDMapWidthSliderValue').val('470');
+        $('#iBDMapHeightSliderValue').val('210');
+        $('#iBDMapWidthSlider').slider('option', 'value', 470);
+        $('#iBDMapHeightSlider').slider('option', 'value', 210);
+        $('#iBDMapZoomLevelSliderValue').val(4);
+        $('#iBDMapZoomLevelSlider').slider('option', 'value', 4);
+        $('#iBDMapMapType').val('hybrid');
+        $('#iBDMapMapTypeControlType').val('0'); // default - auto
+        //$('#iBDMapTypeControlPos').val('3'); // top right
+        $('#iBDMapNavigationControlType').val('0'); // default - auto
+        //$('#iBDMapNavigationControlPos').val('1'); // top left
+        $('#iBDMapScaleControl').val('y'); // default - visible
+        $('#iBDExampleMap').html('').css(
+          {
+            width:$('#iBDMapWidthSliderValue').val()+'px',
+            height:$('#iBDMapHeightSliderValue').val()+'px'
+          }
+        );
+
+        properties.gMap=null;
+      }
+      else
+      {
+        tmp=$.parseJSON(items);
+
+        $('#iBDNumId').val(tmp.id);
+        $('#iBDMapId').val(tmp.mapId);
+        $('#iBDName').val(tmp.name);
+        $('#iBDMapWidthSliderValue').val(tmp.width);
+        $('#iBDMapHeightSliderValue').val(tmp.height);
+        $('#iBDMapWidthSlider').slider('option', 'value', tmp.width);
+        $('#iBDMapHeightSlider').slider('option', 'value', tmp.height);
+        $('#iBDMapZoomLevelSliderValue').val(tmp.zoomLevel);
+        $('#iBDMapZoomLevelSlider').slider('option', 'value', tmp.zoomLevel);
+        $('#iBDMapMapType').val(tmp.mapType);
+        $('#iBDMapMapTypeControlType').val(tmp.mapTypeControl);
+        $('#iBDMapNavigationControlType').val(tmp.navigationControl);
+        $('#iBDMapScaleControl').val(tmp.scaleControl);
+
+        $('#iBDExampleMap').html('').css(
+          {
+            width:tmp.width+'px',
+            height:tmp.height+'px'
+          }
+        );
+      }
+
+      changeSize($('#iBDMapWidthSliderValue').val(), 'iBDMapWidthSlider');
+      changeSize($('#iBDMapHeightSliderValue').val(), 'iBDMapHeightSlider');
+      changeZoom($('#iBDMapZoomLevelSliderValue').val(), '');
+    }
+
+    /**
+     * reload the user defined map list
+     */
+    var loadList = function ()
+    {
+      $('#iListMaps').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.maps.getList" },
+          success:
+            function(msg)
+            {
+              $("#iListMaps").html(msg);
+            }
+        }
+      );
+    }
+
+    /**
+     * check the validity of a given map id
+     *  a valid id only contains chars : A-Z0-9_
+     *
+     * @param String tagId : the tagId
+     * @return Boolean : true if ok, otherwise false
+     */
+    var checkIdValidity = function (tagId)
+    {
+      re=/^[a-z0-9_]+$/i;
+      if(re.exec(tagId)==null) return(false);
+      return(true);
+    }
+
+
+    /**
+     * check for the validity of the map settings
+     */
+    var checkValidity = function ()
+    {
+      $('.error').removeClass('error');
+
+      ok=true;
+
+      if(checkIdValidity($('#iBDMapId').val())==false)
+      {
+        $('#iBDMapId').addClass('error');
+        alert('{/literal}{"gmaps_invalidId"|@translate}{literal}');
+        ok=false;
+      }
+
+      return(ok);
+    }
+
+    /**
+     * send map update to the server, and close the dialog box if everything
+     * is ok
+     */
+    var doUpdate = function ()
+    {
+      displayProcessing(true);
+
+      // build datas
+      datas = {
+        mapId:$('#iBDMapId').val(),
+        name:$('#iBDName').val(),
+        width:$('#iBDMapWidthSliderValue').val(),
+        height:$('#iBDMapHeightSliderValue').val(),
+        zoomLevel:$('#iBDMapZoomLevelSliderValue').val(),
+        mapType:$('#iBDMapMapType').val(),
+        mapTypeControl:$('#iBDMapMapTypeControlType').val(),
+        navigationControl:$('#iBDMapNavigationControlType').val(),
+        scaleControl:$('#iBDMapScaleControl').val(),
+        style:'',
+      }
+
+      $.ajax(
+        {
+          type: "POST",
+          url: "{/literal}{$datas.urlRequest}{literal}",
+          async: true,
+          data: { ajaxfct:"admin.maps.setMap", id:properties.id, datas:datas },
+          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('!');
+                $('#'+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_maps_management'|@translate}</h2>
+
+
+<div class='addMap'>
+  <a onclick="udm.editMap('');">{'gmaps_add_a_new_map'|@translate}</a>
+</div>
+
+
+<table id='iHeaderListMaps' class="littlefont">
+  <tr>
+    <th style="width:150px;">{'gmaps_id'|@translate}</th>
+    <th>{'gmaps_name'|@translate}</th>
+    <th style="width:90px;">{'gmaps_dimensions'|@translate}</th>
+    <th style="width:90px;">{'gmaps_zoomLevel'|@translate}</th>
+    <th style="width:90px;">{'gmaps_mapType'|@translate}</th>
+    <th style="width:90px;">{'gmaps_googleMapTypeControl'|@translate}</th>
+    <th style="width:90px;">{'gmaps_googleMapNavigationControl'|@translate}</th>
+    <th style="width:90px;">{'gmaps_googleMapScaleControl'|@translate}</th>
+    <th width="40px">&nbsp;</th>
+  </tr>
+</table>
+
+<div id='iListMaps' class="{$themeconf.name}">
+</div>
+<div id="iListMapsNb"></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>
+
+  {$mapTabsheet}
+
+  <form>
+    <div id='iTabsContainer' style='height:100px;'>
+      <div id='iTabGeneral' style='display:none;'>
+        <table class='formtable'>
+          <tr>
+            <td>{'gmaps_id'|@translate}</td>
+            <td>
+              <input type='text' id='iBDMapId' maxlength=12 size=12 value=''>
+            </td>
+          </tr>
+
+          <tr>
+            <td>{'gmaps_name'|@translate}</td>
+            <td>
+              <input type='text' id='iBDName' maxlength=80 size=60 value=''>
+            </td>
+          </tr>
+        </table>
+      </div>
+
+      <div id='iTabDimensions' style='display:none;'>
+        <table class="formtable">
+          <tr>
+            <td>{'gmaps_width'|@translate}</td>
+            <td>
+              <input type="hidden" id="iBDMapWidthSliderValue" value="">
+              <div id="iBDMapWidthSlider" class="gcBgInput gcBorderInput"></div>
+            </td>
+            <td width="70px">
+              <div id="iBDMapWidthSliderDisplay"></div>
+            </td>
+          </tr>
+          <tr>
+            <td>{'gmaps_height'|@translate}</td>
+            <td>
+              <input type="hidden" id="iBDMapHeightSliderValue" value="">
+              <div id="iBDMapHeightSlider" class="gcBgInput gcBorderInput"></div>
+            </td>
+            <td width="70px">
+              <div id="iBDMapHeightSliderDisplay"></div>
+            </td>
+          </tr>
+        </table>
+      </div>
+
+      <div id='iTabMapType' style='display:none;'>
+        <table class='formtable'>
+          <tr>
+            <td>{'gmaps_mapType'|@translate}</td>
+            <td>
+              <select id='iBDMapMapType'>
+                <option value='hybrid'>{'gmaps_googleMapType_hybrid'|@translate}</option>
+                <option value='satellite'>{'gmaps_googleMapType_satellite'|@translate}</option>
+                <option value='roadmap'>{'gmaps_googleMapType_roadmap'|@translate}</option>
+                <option value='terrain'>{'gmaps_googleMapType_terrain'|@translate}</option>
+              </select>
+            </td>
+          </tr>
+
+          <tr>
+            <td>{'gmaps_googleMapControlType'|@translate}</td>
+            <td>
+              <select id='iBDMapMapTypeControlType'>
+                <option value='-1'>{'gmaps_googleMapTypeControl_-1'|@translate}</option>
+                <option value='0'>{'gmaps_googleMapTypeControl_0'|@translate}</option>
+                <option value='1'>{'gmaps_googleMapTypeControl_1'|@translate}</option>
+                <option value='2'>{'gmaps_googleMapTypeControl_2'|@translate}</option>
+              </select>
+            </td>
+          </tr>
+
+          <!--
+          <tr>
+            <td>{'gmaps_googleMapControlPos'|@translate}</td>
+            <td>
+              <select id='iBDMapTypeControlPos'>
+                <option value='2'>{'gmaps_googleMapControlPos_T'|@translate}</option>
+                <option value='7'>{'gmaps_googleMapControlPos_B'|@translate}</option>
+                <option value='4'>{'gmaps_googleMapControlPos_L'|@translate}</option>
+                <option value='5'>{'gmaps_googleMapControlPos_R'|@translate}</option>
+                <option value='1'>{'gmaps_googleMapControlPos_TL'|@translate}</option>
+                <option value='3'>{'gmaps_googleMapControlPos_TR'|@translate}</option>
+                <option value='6'>{'gmaps_googleMapControlPos_BL'|@translate}</option>
+                <option value='8'>{'gmaps_googleMapControlPos_BR'|@translate}</option>
+              </select>
+            </td>
+          </tr>
+          -->
+
+        </table>
+      </div>
+
+
+      <div id='iTabZoomLevel' style='display:none;'>
+        <table class='formtable'>
+          <tr>
+            <td>{'gmaps_zoomLevel'|@translate}</td>
+            <td>
+              <table class="formclass">
+                <tr>
+                  <td>
+                    <input type="hidden" id="iBDMapZoomLevelSliderValue" value="">
+                    <div id="iBDMapZoomLevelSlider" class="gcBgInput gcBorderInput"></div>
+                  </td>
+                  <td width="70px">
+                    <div id="iBDMapZoomLevelSliderDisplay"></div>
+                  </td>
+                </tr>
+              </table>
+            </td>
+          </tr>
+
+          <tr>
+            <td>{'gmaps_googleMapControlType'|@translate}</td>
+            <td>
+              <select id='iBDMapNavigationControlType'>
+                <option value='-1'>{'gmaps_googleMapNavigationControl_-1'|@translate}</option>
+                <option value='0'>{'gmaps_googleMapNavigationControl_0'|@translate}</option>
+                <option value='1'>{'gmaps_googleMapNavigationControl_1'|@translate}</option>
+                <option value='2'>{'gmaps_googleMapNavigationControl_2'|@translate}</option>
+                <option value='3'>{'gmaps_googleMapNavigationControl_3'|@translate}</option>
+              </select>
+            </td>
+          </tr>
+
+          <!--
+          <tr>
+            <td>{'gmaps_googleMapControlPos'|@translate}</td>
+            <td>
+              <select id='iBDMapNavigationControlPos'>
+                <option value='2'>{'gmaps_googleMapControlPos_T'|@translate}</option>
+                <option value='7'>{'gmaps_googleMapControlPos_B'|@translate}</option>
+                <option value='4'>{'gmaps_googleMapControlPos_L'|@translate}</option>
+                <option value='5'>{'gmaps_googleMapControlPos_R'|@translate}</option>
+                <option value='1'>{'gmaps_googleMapControlPos_TL'|@translate}</option>
+                <option value='3'>{'gmaps_googleMapControlPos_TR'|@translate}</option>
+                <option value='6'>{'gmaps_googleMapControlPos_BL'|@translate}</option>
+                <option value='8'>{'gmaps_googleMapControlPos_BR'|@translate}</option>
+              </select>
+            </td>
+          </tr>
+          -->
+
+          <tr>
+            <td>{'gmaps_googleMapScaleControl'|@translate}</td>
+            <td>
+              <select id='iBDMapScaleControl'>
+                <option value='y'>{'gmaps_display_visible'|@translate}</option>
+                <option value='n'>{'gmaps_display_hidden'|@translate}</option>
+              </select>
+            </td>
+          </tr>
+
+        </table>
+      </div>
+    </div>
+
+    <div id='iBDExampleMap' style='margin-left:auto;margin-right:auto;margin-top:20px;border:1px solid;'></div>
+
+  </form>
+</div>
+
+
+{literal}
+<script type="text/javascript">
+  var udm=new userDefManage();
+</script>
+{/literal}
+
Index: /extensions/GMaps/admin/gmaps_maps_iListMaps.tpl
===================================================================
--- /extensions/GMaps/admin/gmaps_maps_iListMaps.tpl	(revision 7054)
+++ /extensions/GMaps/admin/gmaps_maps_iListMaps.tpl	(revision 7054)
@@ -0,0 +1,26 @@
+<table class="littlefont">
+  {foreach from=$datas item=data}
+  <tr>
+    <td style="width:150px;">{$data.mapId}</td>
+    <td>{$data.name}</td>
+    <th style="width:90px;">{$data.dimensions}</th>
+    <th style="width:90px;">{$data.zoomLevel}</th>
+    <th style="width:90px;">{$data.mapType}</th>
+    <th style="width:90px;">{$data.mapTypeControl}</th>
+    <th style="width:90px;">{$data.navigationControl}</th>
+    <th style="width:90px;">{$data.scaleControl}</th>
+
+    <td width="40px">
+      <img src="{$themeconf.admin_icon_dir}/edit_s.png"
+           class="button" alt="{'gmaps_edit'|@translate}"
+           title="{'gmaps_edit'|@translate}"
+           onclick='udm.editMap({$data.id});'/>
+      <img src="{$themeconf.admin_icon_dir}/delete.png"
+           class="button"
+           alt="{'gmaps_delete'|@translate}"
+           title="{'gmaps_delete'|@translate}"
+           onclick='udm.deleteMap({$data.id});'/>
+    </td>
+  </tr>
+  {/foreach}
+</table>
Index: /extensions/GMaps/admin/index.php
===================================================================
--- /extensions/GMaps/admin/index.php	(revision 7054)
+++ /extensions/GMaps/admin/index.php	(revision 7054)
@@ -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/admin/plugin_admin.php
===================================================================
--- /extensions/GMaps/admin/plugin_admin.php	(revision 7054)
+++ /extensions/GMaps/admin/plugin_admin.php	(revision 7054)
@@ -0,0 +1,28 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : GMaps
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+include(GMAPS_PATH."gmaps_aip.class.inc.php");
+
+global $prefixeTable, $template;
+
+load_language('plugin.lang', GMAPS_PATH);
+
+$main_plugin_object = get_plugin_data($plugin_id);
+
+
+$plugin_aip = new GMaps_AIP($prefixeTable, $main_plugin_object->getFileLocation());
+$plugin_aip->manage();
+
+?>
Index: /extensions/GMaps/gmaps.css
===================================================================
--- /extensions/GMaps/gmaps.css	(revision 7054)
+++ /extensions/GMaps/gmaps.css	(revision 7054)
@@ -0,0 +1,44 @@
+#iHeaderListMaps { width:100%; border:1px solid; border-collapse: collapse; margin-top:3px; }
+#iListMaps { width:100%; border:1px solid; height:280px; border-top:0px; overflow:auto; position:relative; left:-1px;}
+#iListMapsNb { width:99%; text-align:right; margin-bottom:8px; padding:2px; font-size:80%; }
+#iListMaps table, table.listMaps { width:100%; text-align:left; border-collapse: collapse; }
+#iListMaps.roma table tr:hover { cursor:pointer; background:#303030; }
+#iListMaps.clear table tr:hover { cursor:pointer; color: #D54E21; background:#dbe8f3; }
+div.addMap { text-align:left; }
+
+img.pointer, span.pointer, div.pointer { cursor:pointer; }
+
+.error, input.error {
+  background:#FFAAAA;
+  border:1px solid #800000;
+  color:#800000;
+}
+ul.error {
+  min-height:30px;
+  -moz-border-radius:8px;
+  -webkit-border-radius:8px;
+  -khtml-border-radius:8px;
+  border-radius:8px;
+}
+
+.ui-slider {
+  width:708px;
+  height:10px;
+  border-width:1px;
+  border-style:solid;
+  margin-right:5px;
+  padding-right:14px;
+}
+.ui-slider-handle {
+  width:12px;
+  height:12px;
+  position:relative;
+  top:-2px;
+  border-width:1px;
+  border-style:solid;
+  display:block;
+}
+
+#itab2 {
+  margin:20px -6px 0 -10px;
+}
Index: /extensions/GMaps/gmaps_aim.class.inc.php
===================================================================
--- /extensions/GMaps/gmaps_aim.class.inc.php	(revision 7054)
+++ /extensions/GMaps/gmaps_aim.class.inc.php	(revision 7054)
@@ -0,0 +1,43 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : GMaps
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.dnsalias.com
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  GMaps_AIM : classe to manage plugin integration into plugin menu
+
+  --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+include_once('gmaps_root.class.inc.php');
+
+class GMaps_AIM extends GMaps_root
+{
+  public function __construct($prefixeTable, $filelocation)
+  {
+    parent::__construct($prefixeTable, $filelocation);
+  }
+
+  /*
+    initialize events call for the plugin
+  */
+  public function initEvents()
+  {
+    parent::initEvents();
+    add_event_handler('get_admin_plugin_menu_links', array(&$this, 'pluginAdminMenu') );
+  }
+
+  /* ---------------------------------------------------------------------------
+  Function needed for plugin activation
+  --------------------------------------------------------------------------- */
+
+} // GMaps_AIM class
+
+
+?>
Index: /extensions/GMaps/gmaps_aip.class.inc.php
===================================================================
--- /extensions/GMaps/gmaps_aip.class.inc.php	(revision 7054)
+++ /extensions/GMaps/gmaps_aip.class.inc.php	(revision 7054)
@@ -0,0 +1,194 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : GMaps
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  GMaps_AIP : classe to manage plugin admin pages
+
+  --------------------------------------------------------------------------- */
+
+include_once('gmaps_root.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php');
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTabSheet.class.inc.php');
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+
+class GMaps_AIP extends GMaps_root
+{
+  protected $tabsheet;
+
+  public function __construct($prefixeTable, $filelocation)
+  {
+    parent::__construct($prefixeTable, $filelocation);
+    $this->loadConfig();
+    $this->configForTemplate();
+    $this->initEvents();
+
+    $this->tabsheet = new tabsheet();
+    $this->tabsheet->add('maps',
+                          l10n('gmaps_maps'),
+                          $this->getAdminLink()."&amp;fGMaps_tabsheet=maps");
+    $this->tabsheet->add('category_maps',
+                          l10n('gmaps_associate_category_maps'),
+                          $this->getAdminLink()."&amp;fGMaps_tabsheet=category_maps");
+    $this->tabsheet->add('help',
+                          l10n('gmaps_help'),
+                          $this->getAdminLink()."&amp;fGMaps_tabsheet=help");
+  }
+
+  public function __destruct()
+  {
+    unset($this->tabsheet);
+    parent::__destruct();
+  }
+
+  /**
+   * initialize events call for the plugin
+   */
+  public function initEvents()
+  {
+    add_event_handler('loc_end_page_header', array(&$this->css, 'applyCSS'));
+    GPCCss::applyGpcCss();
+
+    parent::initEvents();
+  }
+
+  /**
+   * display the administration page
+   */
+  public function manage()
+  {
+    global $template;
+
+    $this->initRequest();
+
+    $template->set_filename('plugin_admin_content', dirname(__FILE__)."/admin/gmaps_admin.tpl");
+
+    switch($_REQUEST['fGMaps_tabsheet'])
+    {
+      case 'maps':
+        $this->displayMaps();
+        break;
+      case 'category_maps':
+        $this->displayCategoryMaps();
+        break;
+      case 'help':
+        $this->displayHelp();
+        break;
+    }
+
+    $this->tabsheet->select($_REQUEST['fGMaps_tabsheet']);
+    $this->tabsheet->assign();
+    $selected_tab=$this->tabsheet->get_selected();
+    $template->assign($this->tabsheet->get_titlename(), "[".$selected_tab['caption']."]");
+
+    $template_plugin["GMAPS_VERSION"] = "<i>".$this->getPluginName()."</i> ".l10n('gmaps_release').GMAPS_VERSION;
+    $template_plugin["GMAPS_PAGE"] = $_REQUEST['fGMaps_tabsheet'];
+    $template_plugin["GMAPS_TITLE"] = "";
+
+    $template->assign('plugin', $template_plugin);
+    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+
+  }
+
+
+
+
+  /**
+   * if empty, initialize the $_REQUEST var
+   *
+   * if not empty, check validity for the request values
+   *
+   */
+  private function initRequest()
+  {
+    //initialise $REQUEST values if not defined
+
+    if(!isset($_REQUEST['fGMaps_tabsheet']))
+    {
+      $_REQUEST['fGMaps_tabsheet']="maps";
+    }
+
+    if(!($_REQUEST['fGMaps_tabsheet']!="maps" or
+         $_REQUEST['fGMaps_tabsheet']!="category_maps")) $_REQUEST['fGMaps_tabsheet']="maps";
+  }
+
+
+
+
+
+  /**
+   * display de maps page
+   *
+   */
+  protected function displayMaps()
+  {
+    global $template;
+
+    $template->set_filename('body_page',
+                dirname($this->getFileLocation()).'/admin/gmaps_maps.tpl');
+
+    $mapTabsheet = new GPCTabSheet('mapTabsheet', $this->tabsheet->get_titlename(), 'tabsheet2 gcBorder', 'itab2');
+    $mapTabsheet->add('general',
+                          l10n('gmaps_properties_general'),
+                          '', true, "udm.displayProp('general');");
+    $mapTabsheet->add('dimensions',
+                          l10n('gmaps_dimensions'),
+                          '', false, "udm.displayProp('dimensions');");
+    $mapTabsheet->add('mapType',
+                          l10n('gmaps_properties_mapType'),
+                          '', false, "udm.displayProp('mapType');");
+    $mapTabsheet->add('zoomLevel',
+                          l10n('gmaps_properties_zoomLevel'),
+                          '', false, "udm.displayProp('zoomLevel');");
+    $mapTabsheet->assign();
+
+
+    $datas=Array(
+      'urlRequest' => $this->getAdminLink('ajax')
+    );
+    $template->assign('datas', $datas);
+
+    $template->assign_var_from_handle('GMAPS_BODY_PAGE', 'body_page');
+  }
+
+
+  /**
+   * display the category_maps page
+   *
+   */
+  protected function displayCategoryMaps()
+  {
+    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');*/
+  }
+
+  /**
+   * display the help page
+   *
+   */
+  protected function displayHelp()
+  {
+    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');*/
+  }
+
+} //class
+
+
+?>
Index: /extensions/GMaps/gmaps_ajax.php
===================================================================
--- /extensions/GMaps/gmaps_ajax.php	(revision 7054)
+++ /extensions/GMaps/gmaps_ajax.php	(revision 7054)
@@ -0,0 +1,364 @@
+<?php
+/*
+ * -----------------------------------------------------------------------------
+ * Plugin Name: GMaps
+ * -----------------------------------------------------------------------------
+ * Author     : Grum
+ *   email    : grum@piwigo.org
+ *   website  : http://photos.grum.fr
+ *   PWG user : http://forum.piwigo.org/profile.php?id=3706
+ *
+ *   << May the Little SpaceFrog be with you ! >>
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * See main.inc.php for release information
+ *
+ * manage all the ajax requests
+ * -----------------------------------------------------------------------------
+ */
+
+  define('PHPWG_ROOT_PATH',dirname(dirname(dirname(__FILE__))).'/');
+
+  /*
+   * set ajax module in admin mode if request is used for admin interface
+   */
+  if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
+  if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']))
+  {
+    define('IN_ADMIN', true);
+  }
+
+  // the common.inc.php file loads all the main.inc.php plugins files
+  include_once(PHPWG_ROOT_PATH.'include/common.inc.php' );
+  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCAjax.class.inc.php');
+  include_once('gmaps_root.class.inc.php');
+
+  load_language('plugin.lang', GMAPS_PATH);
+
+
+  class GMaps_Ajax extends GMaps_root
+  {
+    /**
+     * constructor
+     */
+    public function __construct($prefixeTable, $filelocation)
+    {
+      parent::__construct($prefixeTable, $filelocation);
+      $this->loadConfig();
+      $this->checkRequest();
+      $this->returnAjaxContent();
+    }
+
+    /**
+     * check the $_REQUEST values and set default values
+     *
+     */
+    protected function checkRequest()
+    {
+      global $user;
+
+      if(!isset($_REQUEST['ajaxfct'])) $_REQUEST['ajaxfct']='';
+
+      // check if asked function is valid
+      if(!($_REQUEST['ajaxfct']=='admin.maps.getList' or
+           $_REQUEST['ajaxfct']=='admin.maps.setMap' or
+           $_REQUEST['ajaxfct']=='admin.maps.getMap' or
+           $_REQUEST['ajaxfct']=='admin.maps.deleteMap'
+           )) $_REQUEST['ajaxfct']='';
+
+      if(preg_match('/^admin\./i', $_REQUEST['ajaxfct']) and !is_admin()) $_REQUEST['ajaxfct']='';
+
+
+      if($_REQUEST['ajaxfct']!='')
+      {
+        /*
+         * check admin.maps.getList values
+         */
+        if($_REQUEST['ajaxfct']=="admin.maps.getList")
+        {
+        }
+
+        /*
+         * check admin.maps.getMap values
+         */
+        if($_REQUEST['ajaxfct']=="admin.maps.getMap")
+        {
+          if(!isset($_REQUEST['id']) or
+             !is_numeric($_REQUEST['id']) or
+             $_REQUEST['id']=='') $_REQUEST['ajaxfct']='';
+        }
+
+        /*
+         * check admin.maps.deleteMap values
+         */
+        if($_REQUEST['ajaxfct']=="admin.maps.deleteMap")
+        {
+          if(!isset($_REQUEST['id']) or
+             !is_numeric($_REQUEST['id']) or
+             $_REQUEST['id']=='') $_REQUEST['ajaxfct']='';
+        }
+
+        /*
+         * check admin.maps.gsetMap values
+         */
+        if($_REQUEST['ajaxfct']=="admin.maps.setMap")
+        {
+          if(!isset($_REQUEST['id']) or
+             !isset($_REQUEST['datas']) or !is_array($_REQUEST['datas']))
+          {
+            $_REQUEST['ajaxfct']='';
+          }
+          else
+          {
+            if(!(isset($_REQUEST['datas']['mapId']) &&
+                 isset($_REQUEST['datas']['name']) &&
+                 isset($_REQUEST['datas']['width']) &&
+                 isset($_REQUEST['datas']['height']) &&
+                 isset($_REQUEST['datas']['zoomLevel']) &&
+                 isset($_REQUEST['datas']['mapType']) &&
+                 isset($_REQUEST['datas']['mapTypeControl']) &&
+                 isset($_REQUEST['datas']['navigationControl']) &&
+                 isset($_REQUEST['datas']['scaleControl']) &&
+                 isset($_REQUEST['datas']['style'])))
+            {
+              $_REQUEST['ajaxfct']='';
+            }
+            else
+            {
+              if(!is_numeric($_REQUEST['datas']['width']) or
+                  $_REQUEST['datas']['width']<100 or
+                  $_REQUEST['datas']['width']>1280) $_REQUEST['datas']['width']=470;
+
+              if(!is_numeric($_REQUEST['datas']['height']) or
+                  $_REQUEST['datas']['height']<100 or
+                  $_REQUEST['datas']['height']>1280) $_REQUEST['datas']['height']=210;
+
+              if(!is_numeric($_REQUEST['datas']['zoomLevel']) or
+                  $_REQUEST['datas']['zoomLevel']<1 or
+                  $_REQUEST['datas']['zoomLevel']>20) $_REQUEST['datas']['zoomLevel']=4;
+
+              if(!($_REQUEST['datas']['mapType']=='hybrid' or
+                  $_REQUEST['datas']['mapType']=='terrain' or
+                  $_REQUEST['datas']['mapType']=='roadmap' or
+                  $_REQUEST['datas']['mapType']=='satellite')) $_REQUEST['datas']['mapType']='hybrid';
+
+              if(!is_numeric($_REQUEST['datas']['mapTypeControl']) or
+                  $_REQUEST['datas']['mapTypeControl']<-1 or
+                  $_REQUEST['datas']['mapTypeControl']>2) $_REQUEST['datas']['mapTypeControl']=0;
+
+              if(!is_numeric($_REQUEST['datas']['navigationControl']) or
+                  $_REQUEST['datas']['navigationControl']<-1 or
+                  $_REQUEST['datas']['navigationControl']>3) $_REQUEST['datas']['navigationControl']=0;
+
+              if(!($_REQUEST['datas']['scaleControl']=='y' or
+                   $_REQUEST['datas']['scaleControl']=='n')) $_REQUEST['datas']['scaleControl']='y';
+            }
+          }
+        }
+
+
+      }
+    } //checkRequest
+
+
+    /**
+     * return ajax content
+     */
+    protected function returnAjaxContent()
+    {
+      $result="<p class='errors'>An error has occured</p>";
+      switch($_REQUEST['ajaxfct'])
+      {
+        case 'admin.maps.getList':
+          $result=$this->ajax_gmaps_admin_mapsGetList();
+          break;
+        case 'admin.maps.getMap':
+          $result=$this->ajax_gmaps_admin_mapsGetMap($_REQUEST['id']);
+          break;
+        case 'admin.maps.setMap':
+          $result=$this->ajax_gmaps_admin_mapsSetMap($_REQUEST['id'], $_REQUEST['datas']);
+          break;
+        case 'admin.maps.deleteMap':
+          $result=$this->ajax_gmaps_admin_mapsDeleteMap($_REQUEST['id']);
+          break;
+      }
+      GPCAjax::returnResult($result);
+    }
+
+
+    /*------------------------------------------------------------------------*
+     *
+     * ADMIN FUNCTIONS
+     *
+     *----------------------------------------------------------------------- */
+
+    /**
+     * return a HTML list of defined maps
+     *
+     * @return String
+     */
+    private function ajax_gmaps_admin_mapsGetList()
+    {
+      global $template;
+
+      $template->set_filename('list_page',
+                    dirname($this->getFileLocation()).'/admin/gmaps_maps_iListMaps.tpl');
+
+      $datas=Array();
+
+      $sql="SELECT id, mapId, name, width, height, zoomLevel, mapType, mapTypeControl, navigationControl, scaleControl
+            FROM ".$this->tables['maps']."
+            ORDER BY id";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        while($row=pwg_db_fetch_assoc($result))
+        {
+          $row['dimensions']=$row['width'].'x'.$row['height'];
+
+          $row['mapType']=l10n('gmaps_googleMapType_'.$row['mapType']);
+          $row['mapTypeControl']=l10n('gmaps_googleMapTypeControl_'.$row['mapTypeControl']);
+          $row['navigationControl']=l10n('gmaps_googleMapNavigationControl_'.$row['navigationControl']);
+          $row['scaleControl']=($row['scaleControl']=='y')?l10n('gmaps_display_visible'):l10n('gmaps_display_hidden');
+          $datas[]=$row;
+        }
+      }
+
+      $template->assign('datas', $datas);
+      return($template->parse('list_page', true));
+    } //ajax_gmaps_admin_mapsGetList
+
+
+    /**
+     * set properties for a given map id ; if no map id is given, create a new
+     * map
+     *
+     * @param String id : the map Id
+     * @param Array datas : properties of the map (assuming array index were
+     *                      checked by the checkRequest function)
+     * @return String : the num id, or an error message
+     */
+    private function ajax_gmaps_admin_mapsSetMap($id, $properties)
+    {
+      global $template;
+
+      // if create a new map, check if map id is unique
+      $sql="SELECT id, mapId FROM ".$this->tables['maps']."
+            WHERE mapId='".$properties['mapId']."';";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        while($row=pwg_db_fetch_assoc($result))
+        {
+          if($row['id']!=$id)
+          {
+            return('iBDMapId!'.l10n('gmaps_mapIdAlreadyExist'));
+          }
+        }
+      }
+
+      if($id=='')
+      {
+        $sql="INSERT INTO ".$this->tables['maps']."
+              VALUES ('', '".mysql_escape_string($properties['mapId'])."', '".
+                mysql_escape_string($properties['name'])."', '".
+                $properties['width']."', '".
+                $properties['height']."', '".
+                $properties['zoomLevel']."', '".
+                $properties['mapType']."', '".
+                $properties['mapTypeControl']."', '".
+                $properties['navigationControl']."', '".
+                $properties['scaleControl']."', '".
+                mysql_escape_string($properties['style'])."');";
+        $result=pwg_query($sql);
+        $id=pwg_db_insert_id();
+      }
+      else
+      {
+        $sql="UPDATE ".$this->tables['maps']."
+              SET name='".mysql_escape_string($properties['name'])."', mapId='".
+                $properties['mapId']."', width='".
+                $properties['width']."', height='".
+                $properties['height']."', zoomLevel='".
+                $properties['zoomLevel']."', mapType='".
+                $properties['mapType']."', mapTypeControl='".
+                $properties['mapTypeControl']."', navigationControl='".
+                $properties['navigationControl']."', scaleControl='".
+                $properties['scaleControl']."', style='".
+                mysql_escape_string($properties['style'])."'
+              WHERE id='$id';";
+        $result=pwg_query($sql);
+      }
+
+      return($id);
+    } //ajax_gmaps_admin_mapsSetMap
+
+
+    /**
+     * get properties for a given map id
+     *
+     * @param String id : the map Id
+     * @return String : data formatted in a JSON string
+     */
+    private function ajax_gmaps_admin_mapsGetMap($id)
+    {
+      $returned=array(
+        'id' => '',
+        'name' => '',
+        'mapId' => '',
+        'width' => 470,
+        'height' => 210,
+        'zoomLevel' => 4,
+        'mapType' => 'hybrid',
+        'mapTypeControl' => 0,
+        'navigationControl' => 0,
+        'scaleControl' => 'y'
+      );
+
+      $sql="SELECT id, mapId, name, width, height, zoomLevel, mapType, mapTypeControl, navigationControl, scaleControl
+            FROM ".$this->tables['maps']."
+            WHERE id='$id';";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        while($row=pwg_db_fetch_assoc($result))
+        {
+          $returned=$row;
+        }
+      }
+
+      return(json_encode($returned));
+    }
+
+
+
+    /**
+     * delete a map
+     *
+     * @param String id : if of the map to delete
+     * @return String : ok or ko
+     */
+    private function ajax_gmaps_admin_mapsDeleteMap($id)
+    {
+      $sql="DELETE FROM ".$this->tables['maps']."
+            WHERE id='$id';";
+      $result=pwg_query($sql);
+      if($result)
+      {
+        $sql="DELETE FROM ".$this->tables['category_maps']."
+              WHERE map_id='$id';";
+        $result=pwg_query($sql);
+        if($result) return('ok');
+      }
+
+      return('ko!unknown error');
+    }
+
+
+
+  } //class
+
+
+  $returned=new GMaps_Ajax($prefixeTable, __FILE__);
+?>
Index: /extensions/GMaps/gmaps_install.class.inc.php
===================================================================
--- /extensions/GMaps/gmaps_install.class.inc.php	(revision 7054)
+++ /extensions/GMaps/gmaps_install.class.inc.php	(revision 7054)
@@ -0,0 +1,130 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : GMaps
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  GMaps_Install : classe to manage plugin install
+
+  --------------------------------------------------------------------------- */
+
+   include_once('gmaps_version.inc.php'); // => Don't forget to update this file !!
+   include_once('gmaps_root.class.inc.php');
+   include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/GPCTables.class.inc.php');
+
+  /* GMaps class for install process */
+  class GMaps_Install extends GMaps_root
+  {
+    private $tablef;
+
+    public function __construct($prefixeTable, $filelocation)
+    {
+      parent::__construct($prefixeTable, $filelocation);
+      $this->tablef= new GPCTables($this->tables);
+    }
+
+    public function __destruct()
+    {
+      unset($this->tablef);
+      parent::__destruct();
+    }
+
+    /*
+        function for installation process
+        return true if install process is ok, otherwise false
+    */
+    public function install()
+    {
+      $this->initConfig();
+      $this->loadConfig();
+      $this->config['installed']=GMAPS_VERSION2;
+      $this->config['newInstall']='y';
+      $this->saveConfig();
+
+      $tables_def=array(
+"CREATE TABLE   `".$this->tables['maps']."` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `mapId` char(12) NOT NULL,
+  `name` varchar(80) NOT NULL,
+  `width` int(10) unsigned NOT NULL default '470',
+  `height` int(10) unsigned NOT NULL default '210',
+  `zoomLevel` smallint(6) NOT NULL default '4',
+  `mapType` varchar(9) NOT NULL default 'hybrid',
+  `mapTypeControl` smallint(6) NOT NULL default '0',
+  `navigationControl` smallint(6) NOT NULL default '0',
+  `scaleControl` char(1) NOT NULL default 'y',
+  `style` varchar(512) NOT NULL,
+  PRIMARY KEY  (`id`),
+  KEY `byMapId` (`mapId`)
+)",
+"CREATE TABLE   `".$this->tables['category_maps']."` (
+  `id` int(10) unsigned NOT NULL auto_increment,
+  `target` char(1) NOT NULL default 'P',
+  `category_id` smallint(5) unsigned NOT NULL,
+  `map_id` int(11) NOT NULL,
+  `sort` smallint(5) unsigned NOT NULL default '0',
+  `applySubCat` char(1) NOT NULL default 'y',
+  `kmlFileUrl` varchar(255) NOT NULL,
+  `marker` varchar(1) NOT NULL,
+  PRIMARY KEY  (`id`),
+  KEY `byTarget` USING BTREE (`target`,`category_id`,`sort`),
+  KEY `byCategorie` (`category_id`,`target`)
+)"
+      );
+
+      $tables_def = create_table_add_character_set($tables_def);
+      $result=$this->tablef->create($tables_def);
+      unset($tables_def);
+
+      GPCCore::register($this->getPluginName(), GMAPS_VERSION, GMAPS_GPC_NEEDED);
+      return($result);
+    }
+
+
+    /*
+        function for uninstall process
+    */
+    public function uninstall()
+    {
+      $this->deleteConfig();
+      $this->tablef->drop();
+      GPCCore::unregister($this->getPluginName());
+      return('');
+    }
+
+    public function activate()
+    {
+      $this->initConfig();
+      $this->loadConfig();
+
+      /*
+       * migration code
+       */
+      switch($this->config['installed'])
+      {
+        // actually, there no migration possible from previous release
+        default:
+          // nothing to do...
+          break;
+      }
+
+      $this->config['installed']=GMAPS_VERSION2;
+      $this->saveConfig();
+
+      GPCCore::register($this->getPluginName(), GMAPS_VERSION, GMAPS_GPC_NEEDED);
+      return('');
+    }
+
+    public function deactivate()
+    {
+      GPCRequestBuilder::unregister($this->getPluginName());
+    }
+
+  } //class
+
+?>
Index: /extensions/GMaps/gmaps_pip.class.inc.php
===================================================================
--- /extensions/GMaps/gmaps_pip.class.inc.php	(revision 7054)
+++ /extensions/GMaps/gmaps_pip.class.inc.php	(revision 7054)
@@ -0,0 +1,187 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : GMaps
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  GMaps_PIP : classe to manage plugin public pages
+
+  --------------------------------------------------------------------------- */
+
+include_once('gmaps_root.class.inc.php');
+
+class GMaps_PIP extends GMaps_root
+{
+  protected $coords = array();
+  protected $maps = array();
+  protected $content = '';
+  protected $pictureGeolocated;
+
+  public function __construct($prefixeTable, $filelocation)
+  {
+    parent::__construct($prefixeTable, $filelocation);
+    $this->loadConfig();
+
+    $this->initEvents();
+    $this->load_lang();
+
+    $this->pictureGeolocated=false;
+    $this->coords['lat']=0;
+    $this->coords['lng']=0;
+
+    $this->loadMaps();
+  }
+
+  public function __destruct()
+  {
+    unset($section_page);
+    parent::__destruct();
+  }
+
+  /*
+    load language file
+  */
+  public function load_lang()
+  {
+    global $lang;
+
+    load_language('plugin.lang', GMAPS_PATH);
+  }
+
+  /*
+    initialize events call for the plugin
+  */
+  public function initEvents()
+  {
+    parent::initEvents();
+
+    //add_event_handler('loc_end_page_header', array(&$this, 'loadJS'));
+    add_event_handler('amd_jpegMD_loaded', array(&$this, 'prepareMap'));
+    add_event_handler('loc_begin_picture', array(&$this, 'applyMap'), 55);
+  }
+
+
+
+  /* -------------------------------------------------------------------------
+    FUNCTIONS TO MANAGE GMAPS
+  ------------------------------------------------------------------------- */
+
+
+
+  /**
+   * build the maps
+   */
+  public function prepareMap($jpegMD)
+  {
+    global $template;
+
+    if(is_null($jpegMD->getTag('magic.GPS.LatitudeNum')) or
+       is_null($jpegMD->getTag('magic.GPS.LongitudeNum'))) return(false);
+
+    $this->coords['lat']=$jpegMD->getTag('magic.GPS.LatitudeNum')->getValue();
+    $this->coords['lng']=$jpegMD->getTag('magic.GPS.LongitudeNum')->getValue();
+
+    $this->pictureGeolocated=true;
+
+    $mapsProperties='';
+    foreach($this->maps as $val)
+    {
+      $this->content.="<div id='iGMaps".$val['id']."' style='width:".$val['width'].";height:".$val['height'].";".$val['style']."'></div>";
+
+      if($mapsProperties!='') $mapsProperties.=',';
+      $mapsProperties.="
+      {
+        id:'iGMaps".$val['id']."',
+        zoomLevel:".$val['zoomLevel'].",
+        displayMarker:".(($val['displayMarker']=='Y')?'true':'false').",
+        mapTypeId:'".$val['mode']."',
+      }
+      ";
+    }
+    $this->content="<div id='iGMapContent' style='text-align:center;'>".$this->content."</div>";
+
+    $template->append('head_elements',
+"<script type=\"text/javascript\">
+  gmaps =
+    {
+      coords:
+      {
+        latitude:'".$this->coords['lat']."',
+        longitude:'".$this->coords['lng']."',
+      },
+      maps:
+      [$mapsProperties],
+    }
+</script>");
+
+
+    if(!isset($template->known_scripts)) $template->known_scripts=Array();
+
+    if(!array_key_exists('jquery', $template->known_scripts))
+    {
+      $template->known_scripts['jquery']='themes/default/js/jquery.packed.js';
+      $template->block_html_head(null, '<script type="text/javascript" src="themes/default/js/jquery.packed.js"></script>', $template->smarty, $false);
+    }
+
+    $template->known_scripts['maps.google.com/api']='http://maps.google.com/maps/api/js?sensor=false';
+    $template->block_html_head(null, '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>', $template->smarty, $false);
+
+    $template->known_scripts['gmaps.gmaps']='plugins/'.basename(dirname(__FILE__)).'/js/gmaps.js';
+    $template->block_html_head(null, '<script type="text/javascript" src="plugins/'.basename(dirname(__FILE__)).'/js/gmaps.js"></script>', $template->smarty, $false);
+
+
+    //$template->append('head_elements', '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>');
+    //$template->append('head_elements', '<script type="text/javascript" src="plugins/'.basename(dirname(__FILE__)).'/js/gmaps.js"></script>');
+  }
+
+
+  /**
+   * add the maps container to the page
+   */
+  public function applyMap()
+  {
+    global $template;
+
+    if(!$this->pictureGeolocated) return(false);
+
+    $metadata=$template->get_template_vars('metadata');
+
+    $metadata[]=array
+      (
+        'TITLE' => l10n('gmaps_geolocation'),
+        'lines' =>
+          array(
+            '<!--rawContent-->' => $this->content
+          )
+      );
+    $template->assign('metadata', $metadata);
+  }
+
+
+  /**
+   * loads the maps list
+   */
+  private function loadMaps()
+  {
+    $sql="SELECT id, width, height, zoomLevel, displayMarker, mode, style
+          FROM ".$this->tables['maps']."
+          ORDER BY id";
+    $result=pwg_query($sql);
+    if($result)
+    {
+      while($row=pwg_db_fetch_assoc($result))
+      {
+        $this->maps[]=$row;
+      }
+    }
+  }
+
+
+} //class
+
+?>
Index: /extensions/GMaps/gmaps_root.class.inc.php
===================================================================
--- /extensions/GMaps/gmaps_root.class.inc.php	(revision 7054)
+++ /extensions/GMaps/gmaps_root.class.inc.php	(revision 7054)
@@ -0,0 +1,119 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : GMaps
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  GMaps_root : common classe for admin and public classes
+
+  --------------------------------------------------------------------------- */
+  include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
+
+  class GMaps_root extends CommonPlugin
+  {
+    protected $css;
+
+    public function __construct($prefixeTable, $filelocation)
+    {
+      $this->setPluginName('GMaps');
+      $this->setPluginNameFiles("gmaps");
+      parent::__construct($prefixeTable, $filelocation);
+      $this->section_name=$this->getPluginNameFiles();
+
+      $this->setTablesList(array('maps', 'category_maps'));
+      $this->css = new GPCCss(dirname($this->getFileLocation()).'/'.$this->getPluginNameFiles().".css");
+    }
+
+    public function __destruct()
+    {
+      parent::__destruct();
+    }
+
+    public function initEvents()
+    {
+      add_event_handler('blockmanager_register_blocks', array(&$this, 'register_blocks') );
+    }
+
+
+    /*
+      surchage of CommonPlugin->saveConfig function
+    */
+    public function saveConfig()
+    {
+      if(parent::saveConfig())
+      {
+        return(true);
+      }
+      return(false);
+    }
+
+    /*
+      surchage of CommonPlugin->saveConfig function
+    */
+    public function loadConfig()
+    {
+      parent::loadConfig();
+    }
+
+    /*
+      intialize default values
+    */
+    public function initConfig()
+    {
+      //global $user;
+      $this->config=array(
+      );
+    }
+
+
+    /**
+     *
+     */
+    protected function configForTemplate()
+    {
+      global $template;
+
+      $template->assign('gmapsConfig', $this->config);
+    }
+
+
+    public function getAdminLink($mode='')
+    {
+      if($mode=='ajax')
+      {
+        return('plugins/'.basename(dirname($this->getFileLocation())).'/gmaps_ajax.php');
+      }
+      else
+      {
+        return(parent::getAdminLink());
+      }
+    }
+
+    protected function displayResult($action_msg, $result)
+    {
+      global $page;
+
+      if($result)
+      {
+        array_push($page['infos'], $action_msg);
+      }
+      else
+      {
+        array_push($page['errors'], $action_msg);
+      }
+    }
+
+
+    /* ---------------------------------------------------------------------------
+      ajax functions
+    --------------------------------------------------------------------------- */
+
+
+  } //class
+
+?>
Index: /extensions/GMaps/gmaps_version.inc.php
===================================================================
--- /extensions/GMaps/gmaps_version.inc.php	(revision 7054)
+++ /extensions/GMaps/gmaps_version.inc.php	(revision 7054)
@@ -0,0 +1,20 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : GMaps
+  Author     : Grum
+    email    : grum@grum.fr
+    website  : http://photos.grum.fr
+    PWG user : http://forum.piwigo.org/profile.php?id=3706
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  --------------------------------------------------------------------------- */
+
+  if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+  define('GMAPS_VERSION',  '0.2.0');
+  define('GMAPS_VERSION2', '00.02.00');
+  define('GMAPS_GPC_NEEDED', '3.2.0');
+?>
Index: /extensions/GMaps/index.php
===================================================================
--- /extensions/GMaps/index.php	(revision 7054)
+++ /extensions/GMaps/index.php	(revision 7054)
@@ -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/js/gmaps.js
===================================================================
--- /extensions/GMaps/js/gmaps.js	(revision 7054)
+++ /extensions/GMaps/js/gmaps.js	(revision 7054)
@@ -0,0 +1,70 @@
+
+var viewportInitialized = false;
+
+function applyMap(properties)
+{
+  var latlng=new google.maps.LatLng(gmaps.coords.latitude, gmaps.coords.longitude);
+
+  var map = new google.maps.Map($("#"+properties.id).get(0),
+    {
+      mapTypeId: properties.mapTypeId,
+      zoom: properties.zoomLevel,
+      center:latlng,
+      navigationControl: true,
+      scaleControl: false,
+      mapTypeControl:true,
+      mapTypeControlOptions:
+        {
+          style:google.maps.MapTypeControlStyle.DROPDOWN_MENU
+        },
+      markerTitle:'',
+    }
+  );
+
+  if(properties.displayMarker)
+  {
+    var marker = new google.maps.Marker(
+      {
+        position:latlng,
+        map: map,
+        title:properties.markerTitle
+      }
+    );
+    properties.gMarker=marker;
+  }
+
+  properties.gMap=map;
+  properties.gMapCenter=latlng;
+}
+
+$(window).load(function ()
+  {
+    for(i=0;i<gmaps.maps.length;i++)
+    {
+      applyMap(gmaps.maps[i]);
+    }
+
+    /*
+     * this is need for the gally template, because the map initialisation don't
+     * works if the container is not visible
+     */
+    tabId=$('#iGMaps0').get(0).parentNode.parentNode.parentNode.id;
+    tabId='tab'+tabId.toUpperCase().substring(0,1)+tabId.substr(1);
+    $("#"+tabId+" a").bind('click', function ()
+     {
+        if(viewportInitialized==false)
+        {
+          for(i=0;i<gmaps.maps.length;i++)
+          {
+            google.maps.event.trigger(gmaps.maps[i].gMap, 'resize');
+            gmaps.maps[i].gMap.setCenter(gmaps.maps[1].gMapCenter);
+            $('#'+gmaps.maps[i].id+' span, #'+gmaps.maps[i].id+' a').css('font-size', '55.0%');
+          }
+        }
+        viewportInitialized=true;
+     }
+    );
+  }
+);
+
+
Index: /extensions/GMaps/language/en_UK/description.txt
===================================================================
--- /extensions/GMaps/language/en_UK/description.txt	(revision 7054)
+++ /extensions/GMaps/language/en_UK/description.txt	(revision 7054)
@@ -0,0 +1,1 @@
+Display GoogleMaps on the picture page
Index: /extensions/GMaps/language/en_UK/index.php
===================================================================
--- /extensions/GMaps/language/en_UK/index.php	(revision 7054)
+++ /extensions/GMaps/language/en_UK/index.php	(revision 7054)
@@ -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/en_UK/plugin.lang.php
===================================================================
--- /extensions/GMaps/language/en_UK/plugin.lang.php	(revision 7054)
+++ /extensions/GMaps/language/en_UK/plugin.lang.php	(revision 7054)
@@ -0,0 +1,5 @@
+<?php
+
+$lang['gmaps_geolocation'] = 'Geolocation';
+
+?>
Index: /extensions/GMaps/language/fr_FR/description.txt
===================================================================
--- /extensions/GMaps/language/fr_FR/description.txt	(revision 7054)
+++ /extensions/GMaps/language/fr_FR/description.txt	(revision 7054)
@@ -0,0 +1,1 @@
+Permet de gérer des cartes GoogleMap dans la galerie
Index: /extensions/GMaps/language/fr_FR/index.php
===================================================================
--- /extensions/GMaps/language/fr_FR/index.php	(revision 7054)
+++ /extensions/GMaps/language/fr_FR/index.php	(revision 7054)
@@ -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 7054)
+++ /extensions/GMaps/language/fr_FR/plugin.lang.php	(revision 7054)
@@ -0,0 +1,72 @@
+<?php
+
+$lang['gmaps_release']='v';
+
+$lang['gmaps_geolocation'] = 'Géolocalisation';
+$lang['gmaps_maps'] = 'Cartes';
+$lang['gmaps_associate_category_maps'] = 'Association des cartes';
+$lang['gmaps_help'] = 'Aide';
+
+$lang['gmaps_maps_management']='Gestion des cartes';
+
+$lang['gmaps_ok'] = "Ok";
+$lang['gmaps_cancel'] = "Annuler";
+$lang['gmaps_edit'] = "Editer";
+$lang['gmaps_delete'] = "Supprimer";
+$lang['gmaps_loading'] = "Chargement...";
+
+$lang['gmaps_config_map']="Paramétrage d\'une carte";
+$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_deleteMap']="Suppression de la carte";
+$lang['gmaps_invalidId']="Identifiant invalide !";
+$lang['gmaps_mapIdAlreadyExist']="Une carte avec cet identifiant existe déjà !";
+$lang['gmaps_add_a_new_map']="Ajouter une carte";
+
+$lang['gmaps_id']="Identifiant de la carte";
+$lang['gmaps_name']="Nom";
+$lang['gmaps_dimensions']="Dimensions";
+$lang['gmaps_zoomLevel']="Niveau de zoom";
+$lang['gmaps_mapType']="Type d'affichage";
+$lang['gmaps_width']="Largeur";
+$lang['gmaps_height']="Hauteur";
+
+$lang['gmaps_fullScreen']="Plein écran";
+$lang['gmaps_zoomAuto']="Automatique";
+$lang['gmaps_googleMapType_hybrid']="Mixte";
+$lang['gmaps_googleMapType_terrain']="Relief";
+$lang['gmaps_googleMapType_roadmap']="Plan";
+$lang['gmaps_googleMapType_satellite']="Image satellite";
+$lang['gmaps_googleMapTypeControl']="Contrôle du type d'affichage";
+$lang['gmaps_googleMapTypeControl_-1']="Aucun";
+$lang['gmaps_googleMapTypeControl_0']="Automatique";
+$lang['gmaps_googleMapTypeControl_1']="Menu horizontal";
+$lang['gmaps_googleMapTypeControl_2']="Menu déroulant";
+$lang['gmaps_googleMapNavigationControl']="Contrôle du zoom";
+$lang['gmaps_googleMapNavigationControl_-1']="Aucun";
+$lang['gmaps_googleMapNavigationControl_0']="Automatique";
+$lang['gmaps_googleMapNavigationControl_1']="Petit";
+$lang['gmaps_googleMapNavigationControl_2']="Android";
+$lang['gmaps_googleMapNavigationControl_3']="Large";
+
+$lang['gmaps_googleMapScaleControl']="Echelle de la carte";
+$lang['gmaps_display_hidden']="Ne pas afficher";
+$lang['gmaps_display_visible']="Afficher";
+
+$lang['gmaps_googleMapControlType']="Type de contrôle";
+$lang['gmaps_googleMapControlPos']="Type de contrôle";
+$lang['gmaps_googleMapControlPos_T']="En haut";
+$lang['gmaps_googleMapControlPos_B']="En bas";
+$lang['gmaps_googleMapControlPos_L']="A gauche";
+$lang['gmaps_googleMapControlPos_R']="A droite";
+$lang['gmaps_googleMapControlPos_TL']="En haut à gauche";
+$lang['gmaps_googleMapControlPos_TR']="En haut à droite";
+$lang['gmaps_googleMapControlPos_BL']="En bas à gauche";
+$lang['gmaps_googleMapControlPos_BR']="En bas à droite";
+
+
+$lang['gmaps_properties_general']="Propriétés";
+$lang['gmaps_properties_mapType']="Gestion de l'affichage";
+$lang['gmaps_properties_zoomLevel']="Gestion du zoom";
+
+?>
Index: /extensions/GMaps/language/index.php
===================================================================
--- /extensions/GMaps/language/index.php	(revision 7054)
+++ /extensions/GMaps/language/index.php	(revision 7054)
@@ -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/main.inc.php
===================================================================
--- /extensions/GMaps/main.inc.php	(revision 7054)
+++ /extensions/GMaps/main.inc.php	(revision 7054)
@@ -0,0 +1,93 @@
+<?php
+/*
+Plugin Name: GMaps
+Version: 0.2.0
+Description: Display and manage (google) maps
+Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=
+Author: grum@piwigo.org
+Author URI: http://photos.grum.fr
+*/
+
+/*
+--------------------------------------------------------------------------------
+  Author     : Grum
+    email    : grum@piwigo.com
+    website  : http://photos.grum.fr
+    PWG user : http://forum.phpwebgallery.net/profile.php?id=3706
+
+    << May the Little SpaceFrog be with you ! >>
+--------------------------------------------------------------------------------
+
+:: HISTORY
+
+| release | date       |
+| 0.1.0   | 2010-08-22 | * first lines of code
+|         |            |   . release not published
+|         |            |
+| 0.2.0   | 2010-09-30 | * first official release
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+|         |            |
+
+
+:: TO DO
+
+--------------------------------------------------------------------------------
+
+:: NFO
+  GMaps_root : common classe for admin and public classes
+  GMaps_AIM  : classe to manage plugin integration into plugin menu
+  GMaps_AIP  : classe to manage plugin admin pages
+  GMaps_PIP  : classe to manage plugin public pages
+
+--------------------------------------------------------------------------------
+*/
+
+// pour faciliter le debug :o)
+ //ini_set('error_reporting', E_ALL);
+ //ini_set('display_errors', true);
+
+if(!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+
+define('GMAPS_DIR' , basename(dirname(__FILE__)));
+define('GMAPS_PATH' , PHPWG_PLUGINS_PATH . GMAPS_DIR . '/');
+
+include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
+include_once('gmaps_version.inc.php'); // => Don't forget to update this file !!
+
+global $prefixeTable;
+
+if(defined('IN_ADMIN'))
+{
+  //GMaps admin interface loaded and active only if in admin page
+  include_once("gmaps_aim.class.inc.php");
+  $obj=new GMaps_AIM($prefixeTable, __FILE__);
+  $obj->initEvents();
+}
+else
+{
+  if(CommonPlugin::checkGPCRelease(GMAPS_GPC_NEEDED))
+  {
+    //GMaps public interface loaded and active only if in public page
+    include_once("gmaps_pip.class.inc.php");
+    $obj=new GMaps_PIP($prefixeTable, __FILE__);
+  }
+}
+
+set_plugin_data($plugin['id'], $obj);
+
+?>
Index: /extensions/GMaps/maintain.inc.php
===================================================================
--- /extensions/GMaps/maintain.inc.php	(revision 7054)
+++ /extensions/GMaps/maintain.inc.php	(revision 7054)
@@ -0,0 +1,114 @@
+<?php
+/* -----------------------------------------------------------------------------
+  Plugin     : GMaps
+  Author     : Grum
+    email    : grum@piwigo.org
+    website  : http://photos.grum.fr
+
+    << May the Little SpaceFrog be with you ! >>
+  ------------------------------------------------------------------------------
+  See main.inc.php for release information
+
+  --------------------------------------------------------------------------- */
+
+if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+
+include_once('gmaps_version.inc.php'); // => Don't forget to update this file !!
+
+
+if(!defined('GMAPS_DIR')) define('GMAPS_DIR' , basename(dirname(__FILE__)));
+if(!defined('GMAPS_PATH')) define('GMAPS_PATH' , PHPWG_PLUGINS_PATH . GMAPS_DIR . '/');
+
+//ini_set('error_reporting', E_ALL);
+//ini_set('display_errors', true);
+
+global $gpcInstalled, $lang; //needed for plugin manager compatibility
+
+/* -----------------------------------------------------------------------------
+GMaps needs the Grum Plugin Classes
+----------------------------------------------------------------------------- */
+$gpcInstalled=false;
+if(file_exists(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php'))
+{
+  @include_once(PHPWG_PLUGINS_PATH.'GrumPluginClasses/classes/CommonPlugin.class.inc.php');
+  // need GPC release greater or equal than 3.2.0
+  if(CommonPlugin::checkGPCRelease(GMAPS_GPC_NEEDED))
+  {
+    @include_once('gmaps_install.class.inc.php');
+    $gpcInstalled=true;
+  }
+}
+
+function gpcMsgError(&$errors)
+{
+  global $gpcNeeded;
+  $msg=sprintf(l10n('To install this plugin, you need to install Grum Plugin Classes %s before'), GMAPS_GPC_NEEDED);
+  if(is_array($errors))
+  {
+    array_push($errors, $msg);
+  }
+  else
+  {
+    $errors=Array($msg);
+  }
+}
+// -----------------------------------------------------------------------------
+
+
+
+
+load_language('plugin.lang', GMAPS_PATH);
+
+
+function plugin_install($plugin_id, $plugin_version, &$errors)
+{
+  global $prefixeTable, $gpcInstalled;
+  if($gpcInstalled)
+  {
+    $gmaps=new GMaps_Install($prefixeTable, __FILE__);
+    $result=$gmaps->install();
+  }
+  else
+  {
+    gpcMsgError($errors);
+  }
+}
+
+function plugin_activate($plugin_id, $plugin_version, &$errors)
+{
+  global $prefixeTable, $gpcInstalled;
+  if($gpcInstalled)
+  {
+    $gmaps = new GMaps_Install($prefixeTable, __FILE__);
+    $result=$gmaps->activate();
+  }
+}
+
+function plugin_deactivate($plugin_id)
+{
+  global $prefixeTable, $gpcInstalled;
+
+  if($gpcInstalled)
+  {
+    $gmaps=new GMaps_Install($prefixeTable, __FILE__);
+    $gmaps->deactivate();
+  }
+
+}
+
+function plugin_uninstall($plugin_id)
+{
+  global $prefixeTable, $gpcInstalled;
+  if($gpcInstalled)
+  {
+    $gmaps=new GMaps_Install($prefixeTable, __FILE__);
+    $result=$gmaps->uninstall();
+  }
+  else
+  {
+    gpcMsgError($errors);
+  }
+}
+
+
+?>
