[Mapbender-commits] r1879 - in tags: . 2.4.4_rc1 2.4.4_rc1/http 2.4.4_rc1/http/classes 2.4.4_rc1/http/extensions 2.4.4_rc1/http/javascripts 2.4.4_rc1/http/php 2.4.4_rc1/http/tools

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Nov 30 10:25:59 EST 2007


Author: christoph
Date: 2007-11-30 10:25:59 -0500 (Fri, 30 Nov 2007)
New Revision: 1879

Added:
   tags/2.4.4_rc1/
Modified:
   tags/2.4.4_rc1/Changes.txt
   tags/2.4.4_rc1/http/classes/class_gui.php
   tags/2.4.4_rc1/http/classes/class_mb_exception.php
   tags/2.4.4_rc1/http/classes/class_wms.php
   tags/2.4.4_rc1/http/extensions/geom2wfst.php
   tags/2.4.4_rc1/http/index.php
   tags/2.4.4_rc1/http/javascripts/mod_digitize_tab.php
   tags/2.4.4_rc1/http/javascripts/mod_savewmc.php
   tags/2.4.4_rc1/http/javascripts/mod_wfs_SpatialRequest.php
   tags/2.4.4_rc1/http/javascripts/mod_wfs_gazetteer_client.php
   tags/2.4.4_rc1/http/javascripts/wfs.js
   tags/2.4.4_rc1/http/php/mod_renameGUI.php
   tags/2.4.4_rc1/http/php/mod_wfs_result.php
   tags/2.4.4_rc1/http/tools/mapbender_setup.php
Log:


Copied: tags/2.4.4_rc1 (from rev 1870, tags/2.4.3)

Modified: tags/2.4.4_rc1/Changes.txt
===================================================================
--- tags/2.4.3/Changes.txt	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/Changes.txt	2007-11-30 15:25:59 UTC (rev 1879)
@@ -4,6 +4,11 @@
 
 ------------------------
 
+Changelog 2.4.4
+
+see http://www.mapbender.org/index.php/Template:Changelog_2.4.4
+
+
 Changelog 2.4.3
 
 see http://www.mapbender.org/index.php/Template:Changelog_2.4.3
@@ -37,17 +42,17 @@
     neue Features
 
     * Einstellen der Deckkraft (Opacity) einzelner WMSe in der TreeGDE2
-    * Bulgarische Übersetzung der Mapbender-Einführung
-    * Verbesserung des Moduls Add WMS from filtered list: es ist nun möglich, konfigurierte WMSe aus GUIs zu laden
+    * Bulgarische �bersetzung der Mapbender-Einf�hrung
+    * Verbesserung des Moduls Add WMS from filtered list: es ist nun m�glich, konfigurierte WMSe aus GUIs zu laden
     * Update des Moduls Meetingpoint / Treffpunkt: neue Bilddatei, diverse Fehler behoben
     * Verbessertes Logging, auch von JavaScript Fehlern (siehe mapbender.conf#Mapbender_error_logging)
     * poi (noch in keiner GUI enthalten)
-    * JavaScript Kompression; Mapbender lädt schneller
+    * JavaScript Kompression; Mapbender l�dt schneller
     * Dynamisches Overview
     * TreeGDE2 ersetzt die alte Baumstruktur
     * verschiedene Konfigurationen der TreeGDE2 in den Standard-GUIs
-    * vorläufige API Dokumentation für JavaScript Klassen
-    * Druck von temporären Objekten (Linien und Polygone), die mit dem "measure" Element erstellt wurden 
+    * vorl�ufige API Dokumentation f�r JavaScript Klassen
+    * Druck von tempor�ren Objekten (Linien und Polygone), die mit dem "measure" Element erstellt wurden 
 
 
 Changelog 2.4.1
@@ -98,18 +103,18 @@
 
 deutsch
 
-    * Änderungen in der Datenbankarchitektur: Angaben im Wiki unter dbchanges oder Database_Changes_2.4.1. Die update-sqls befinden sich im Download-Paket im Verzeicnis mapbender/resources/db/update/
-    * WFS_gazetteer Auswahlmöglichkeit zwischen mehreren WFS-Konfigurationenüber eine Auswahlliste - thanx to User:Verena Diewald
+    * �nderungen in der Datenbankarchitektur: Angaben im Wiki unter dbchanges oder Database_Changes_2.4.1. Die update-sqls befinden sich im Download-Paket im Verzeicnis mapbender/resources/db/update/
+    * WFS_gazetteer Auswahlm�glichkeit zwischen mehreren WFS-Konfigurationen�ber eine Auswahlliste - thanx to User:Verena Diewald
     * treeGDE - neue Baumstruktur - thanx to User:Melchior Moos
     * Neues Modul add_vendorspecific.
-    * Neues Element setPOI2Scale um eine GUI an einen Punkt in einem bestimmten Maßstab zu öffnen Mod_setPoi2Scale.
-    * Erweiterung des Moduls resizeMapsize. Kartenfenster kann sich automatisch an die Browsergröße anpasssen oder über einen Button. 3 Element vars wurden hinzugefügt.
-    * Neues Administrationselement OrphanWMS, dass informationen über verwaiste WMS liefert und diese löschen kann.
+    * Neues Element setPOI2Scale um eine GUI an einen Punkt in einem bestimmten Ma�stab zu �ffnen Mod_setPoi2Scale.
+    * Erweiterung des Moduls resizeMapsize. Kartenfenster kann sich automatisch an die Browsergr��e anpasssen oder �ber einen Button. 3 Element vars wurden hinzugef�gt.
+    * Neues Administrationselement OrphanWMS, dass informationen �ber verwaiste WMS liefert und diese l�schen kann.
     * Neues Element meetingPoint um Treffpunkte zu generieren und diese als Text oder via E-Mail zu exportieren. Die URL kann durch highlightPOI angezeigt werden.
-    * pdf-Print nun auch mit Din-A2 Unterstützung (Dank an Frank Härtel und Horst Becker).
-    * Neues Element highlightPOI (mod_highlightPOI.php) ermöglicht es beim Öffnen einer GUI ein oder mehrere Punkte mit Beschriftung zu setzen.
+    * pdf-Print nun auch mit Din-A2 Unterst�tzung (Dank an Frank H�rtel und Horst Becker).
+    * Neues Element highlightPOI (mod_highlightPOI.php) erm�glicht es beim �ffnen einer GUI ein oder mehrere Punkte mit Beschriftung zu setzen.
     * Metadaten handling.
-    * Featureinfotunnel schließt leere Fenster ohne Ergebnis gleich wieder. 
+    * Featureinfotunnel schlie�t leere Fenster ohne Ergebnis gleich wieder. 
 
 
 Changelog Mapbender 2.4
@@ -126,8 +131,8 @@
 deutsch
 
     * Bugs im Modul loadWMC wurden behoben.
-    * Neues Modul resizeMapsize das Modul paßt die Kartengröße in Abhängigkeit von der Größe des Browserfensters dynamisch an.
-    * Neues Modul monitorCapabilities: periodisch werden alle WMSe kontrolliert und alle Daten in der neuen Tabelle mn_monitor erfaßt (siehe auch Database_Changes_2.4).
+    * Neues Modul resizeMapsize das Modul pa�t die Kartengr��e in Abh�ngigkeit von der Gr��e des Browserfensters dynamisch an.
+    * Neues Modul monitorCapabilities: periodisch werden alle WMSe kontrolliert und alle Daten in der neuen Tabelle mn_monitor erfa�t (siehe auch Database_Changes_2.4).
     * Neues Modul initWMC: startet den Client mit einem WMS.
     * wms_extent - WMS, der die Ausdehnungen (Extent) der in Mapbender geladenen WMSe anzeigt. 
 
@@ -155,17 +160,17 @@
 
     * Mapbender wechselt zum Subversion (svn) mit dem damit verbundenen Code cleaning
     * owsproxy
-    * treeGDE wurde verbessert, es gibt nun die Möglichkeit alle Layer eines WMS durch einen Klick an- bzw. auszustellen.
+    * treeGDE wurde verbessert, es gibt nun die M�glichkeit alle Layer eines WMS durch einen Klick an- bzw. auszustellen.
     * Bugs in der Legende behoben
-    * Veränderungen in der Datenbankarchitektur: neue Tabelle wfs_featuretype_namespace, neue Spalte wms_owsproxy in Tabelle wms, neue Spalte wms_upload_url in Tabelle wms. Um eine bestehende Datenbank zu aktualisieren, gibt es unter dbchanges weitere Informationen. Database Changes 2.4
-    * Es besteht die Möglichkeit Perpared Statements ab PHP > 5.1.x, PostgreSQL > 7.4 einzusetzen
+    * Ver�nderungen in der Datenbankarchitektur: neue Tabelle wfs_featuretype_namespace, neue Spalte wms_owsproxy in Tabelle wms, neue Spalte wms_upload_url in Tabelle wms. Um eine bestehende Datenbank zu aktualisieren, gibt es unter dbchanges weitere Informationen. Database Changes 2.4
+    * Es besteht die M�glichkeit Perpared Statements ab PHP > 5.1.x, PostgreSQL > 7.4 einzusetzen
     * Neue gui_digitize im Installationsumfang. Mehr unter Digitizing
-    * Neue gui2 im Installationsumfang mit neuen Buttons (button_blue), neuem Style für die Baumstruktur (tree_blue) und mehr Farbe
-    * Standardmäßige md5-Verschlüsselung des Passworts in MySQL und PostgreSQL. Mapbender verschlüsselt nun das Passwort, nicht die Datenbank.
+    * Neue gui2 im Installationsumfang mit neuen Buttons (button_blue), neuem Style f�r die Baumstruktur (tree_blue) und mehr Farbe
+    * Standardm��ige md5-Verschl�sselung des Passworts in MySQL und PostgreSQL. Mapbender verschl�sselt nun das Passwort, nicht die Datenbank.
     * mapbender_setup.php liefert nun mehr Informationen und weist auf Fehler hin (Danke an Marko Samson)
     * Neues Element deleteWFS in der GUI admin1
-    * printPDF: für den Overview ist nun auch der hochqualitative Druck und das Matching möglich
-    * Hilfebutton: jedes Element der GUI ist direkt mit der Hilfeseite im Mapbender Wiki verlinkt (Eintrag in der Tabelle gui_element Spalte e_url). Dieser Link kann an die jeweilige Umgebung angepaßt werden. 
+    * printPDF: f�r den Overview ist nun auch der hochqualitative Druck und das Matching m�glich
+    * Hilfebutton: jedes Element der GUI ist direkt mit der Hilfeseite im Mapbender Wiki verlinkt (Eintrag in der Tabelle gui_element Spalte e_url). Dieser Link kann an die jeweilige Umgebung angepa�t werden. 
 
 
 Changelog 2.2.3
@@ -207,19 +212,19 @@
 
 deutsch
 
-    * print: nun mit Übersichtsfenster mit Positionsrechteck und Maßstabsleiste (beide Funktionalitäten können in der Konfigurationsdatei des Drucks an- oder ausgestellt werden) 
+    * print: nun mit �bersichtsfenster mit Positionsrechteck und Ma�stabsleiste (beide Funktionalit�ten k�nnen in der Konfigurationsdatei des Drucks an- oder ausgestellt werden) 
 
-    * Die Oberflächen gui1_de und gui_de werden nicht mehr weitergeführt, da es zu viel Aufwand darstellt 4 Oberflächen weiterzuführen. Wenn eine deutsche Oberfläche gebraucht wird können die ToolTipTexte auf deutsch angelegt werden. Die Mehrsprachigkeit der einzelnen Elemente soll zukünftig über die Element vars gelöst werden. 
+    * Die Oberfl�chen gui1_de und gui_de werden nicht mehr weitergef�hrt, da es zu viel Aufwand darstellt 4 Oberfl�chen weiterzuf�hren. Wenn eine deutsche Oberfl�che gebraucht wird k�nnen die ToolTipTexte auf deutsch angelegt werden. Die Mehrsprachigkeit der einzelnen Elemente soll zuk�nftig �ber die Element vars gel�st werden. 
 
     * WMC-Nutzung: beinhaltet anzeigen (DisplayWMC), laden (loadWMC), speichern (saveWMC) eines WMCs und auflisten aller WMCs (listWMC). 
 
-    * Element logout: verfügt nun über den element_var logout_location, um zu definieren welche Webseite nach dem Logout angezeigt werden soll. 
+    * Element logout: verf�gt nun �ber den element_var logout_location, um zu definieren welche Webseite nach dem Logout angezeigt werden soll. 
 
-    * Das Übersichtsfenster des PDF-Drucks wird nun auch hochqualitativ angezeigt bei hochqualitativem Druck. 
+    * Das �bersichtsfenster des PDF-Drucks wird nun auch hochqualitativ angezeigt bei hochqualitativem Druck. 
 
-    * Die AddWMS Funktionalität wurde überarbeitet. Eine neue Datei mod_addWMSgeneralFunctions.js stellt nun die Funktionen mod_addWMS_load und mod_addWMS_refresh zur Verfügung. Wichtig für die Elemente addWMSfromfilteredList and addWMSfromList das JavaScript mod_addWMSgeneralFunctions.js muß in der Elementdefinition unter Modul angegeben werden. 
+    * Die AddWMS Funktionalit�t wurde �berarbeitet. Eine neue Datei mod_addWMSgeneralFunctions.js stellt nun die Funktionen mod_addWMS_load und mod_addWMS_refresh zur Verf�gung. Wichtig f�r die Elemente addWMSfromfilteredList and addWMSfromList das JavaScript mod_addWMSgeneralFunctions.js mu� in der Elementdefinition unter Modul angegeben werden. 
 
-    * Element tabs (mod_tab.php) wurde um die element_var open_tab erweitert, um beim Start des Clients einen tab voreingestellt zu öffnen. 
+    * Element tabs (mod_tab.php) wurde um die element_var open_tab erweitert, um beim Start des Clients einen tab voreingestellt zu �ffnen. 
 
     * print: Fehler in der Legende bei gruppierten Ebenen beseitigt. 
 
@@ -227,17 +232,17 @@
 
     * legend: Neue element_var: stickylegend zur Steuerung des Anzeigefesters der Legende (Positionierung / sticky-Frame). 
 
-    * Bereitstellung der GEOS Funktionen für Mapbender mit mysql-Administrationsdatenbank: mapbender.conf / mod_changeEPSG.php / mod_evalArea.php - Zusätzliche Datenbankparameter für eine PostgresDB neben der mysql-Administrationsdatenbank, zur Transformation von Projektionssystemen und Berechnung von Flächen. 
+    * Bereitstellung der GEOS Funktionen f�r Mapbender mit mysql-Administrationsdatenbank: mapbender.conf / mod_changeEPSG.php / mod_evalArea.php - Zus�tzliche Datenbankparameter f�r eine PostgresDB neben der mysql-Administrationsdatenbank, zur Transformation von Projektionssystemen und Berechnung von Fl�chen. 
 
     * Encoding (Zeichensatz) in Mapbender: es besteht nun die Auswahl zwischen UTF-8 oder ISO-8859-1 als Zeichensatz (die Angabe erfolgt in der mapbender.conf CHARSET) 
 
     * wfs configuration: WFS Konfiguration erzeugte Fehler mit der PostgreSQL-Datenbank. 
 
-    * copyright: Neue element_var mod_copyright_text, Angabe zum Copyright-Text über die Administrationsoberfläche. 
+    * copyright: Neue element_var mod_copyright_text, Angabe zum Copyright-Text �ber die Administrationsoberfl�che. 
 
     * fixed: Fehler in class_log behoben. 
 
-    * Datenbankänderungen 
+    * Datenbank�nderungen 
 
 
 Changelog 2.2.2
@@ -252,9 +257,9 @@
 
 deutsch
 
-    * Leider war noch ein Fehler im PostgreSQL Datenbank-Modul übersehen worden. Da im Menü Oberflächenelemente editieren die bestehenden GUIs und deren Elemente nicht angezeigt wurden, um sie als Templates zu verwenden, ließen sich die GUIs nicht nach den eigenen Bedürfnissen anpassen. 
+    * Leider war noch ein Fehler im PostgreSQL Datenbank-Modul �bersehen worden. Da im Men� Oberfl�chenelemente editieren die bestehenden GUIs und deren Elemente nicht angezeigt wurden, um sie als Templates zu verwenden, lie�en sich die GUIs nicht nach den eigenen Bed�rfnissen anpassen. 
 
-Um diesen Fehler zu beheben wurden kleinere Änderungen in der PostgreSQL Datenbank-Struktur vorgenommen. Bitte verwenden Sie daher keine bereits existierende V. 2.2.1-Datenbank falls Sie updaten, sondern benutzen Sie bitte die SQL-Dumps, die dieser Version beigefügt sind.
+Um diesen Fehler zu beheben wurden kleinere �nderungen in der PostgreSQL Datenbank-Struktur vorgenommen. Bitte verwenden Sie daher keine bereits existierende V. 2.2.1-Datenbank falls Sie updaten, sondern benutzen Sie bitte die SQL-Dumps, die dieser Version beigef�gt sind.
 
 Changelog 2.2.1
 
@@ -275,19 +280,19 @@
 
 deutsch
 
-Vielleicht waren wir etwas voreilig mit dem Mapbender Release 2.2 und haben den Fokus nicht auf die Dokumentation und das Debuggig gesetzt. Aber mit Hilfe der User sind viele Fehler aufgezeigt worden und konnten gelöst werden. Hier nun der neue Mapbender 2.2.1. Derzeit gibt es noch keine Dokumentation und auch kein Skript für den automatisierten Update einer bestehenden Mapbender Installation. Die vormals eingesetzen Skripte mapbender_setup.php und validate_db.php können derzeit nicht mehr verwendet werden und wurden aus dem Paket entfernt. Die Skripte müssen erst wieder auf den neuen Release angepaßt werden, damit sie wieder zum Einsatz kommen können.
+Vielleicht waren wir etwas voreilig mit dem Mapbender Release 2.2 und haben den Fokus nicht auf die Dokumentation und das Debuggig gesetzt. Aber mit Hilfe der User sind viele Fehler aufgezeigt worden und konnten gel�st werden. Hier nun der neue Mapbender 2.2.1. Derzeit gibt es noch keine Dokumentation und auch kein Skript f�r den automatisierten Update einer bestehenden Mapbender Installation. Die vormals eingesetzen Skripte mapbender_setup.php und validate_db.php k�nnen derzeit nicht mehr verwendet werden und wurden aus dem Paket entfernt. Die Skripte m�ssen erst wieder auf den neuen Release angepa�t werden, damit sie wieder zum Einsatz kommen k�nnen.
 
     * es lagen einige Bugs bei der Verwendung von PostgreSQL als Administrationsdatenbank vor. Diese sind hoffentlich alle beseitigt. In der Installationsanleitung unter 
 
-mapbender.conf findet sich alles wichtige zur Installation (Alles ist nun einfacher. Es muß nur noch die Datei mapbender.conf angepaßt werden)
+mapbender.conf findet sich alles wichtige zur Installation (Alles ist nun einfacher. Es mu� nur noch die Datei mapbender.conf angepa�t werden)
 
-    * der Name zweier Spalten hat sich geändert:
-          o mb_log.session geändert in mb_log.mb_session (session reserviertes Wort in PostgreSQL)
-          o gui_element.e_closeTag geändert in gui_element.e_closetag (alle Tabellen- und Spaltennamen in Kleinbuchstaben) 
+    * der Name zweier Spalten hat sich ge�ndert:
+          o mb_log.session ge�ndert in mb_log.mb_session (session reserviertes Wort in PostgreSQL)
+          o gui_element.e_closeTag ge�ndert in gui_element.e_closetag (alle Tabellen- und Spaltennamen in Kleinbuchstaben) 
 
-    * Sequences in PostgreSQL: bei der Verwendung von PostgreSQL müssen die Sequenzen der Autowerte nach dem Laden der Daten explizit gesetzt werden. Dazu steht die Datei mapbender/resources/db/pgsql_serial_set_sequences.sql zur Verfügung 
+    * Sequences in PostgreSQL: bei der Verwendung von PostgreSQL m�ssen die Sequenzen der Autowerte nach dem Laden der Daten explizit gesetzt werden. Dazu steht die Datei mapbender/resources/db/pgsql_serial_set_sequences.sql zur Verf�gung 
 
-    * changeEPSG und Flächenberechnung steht derzeit nur Benutzern mit einer PostgreSQL-Datenbank zur Verfügung 
+    * changeEPSG und Fl�chenberechnung steht derzeit nur Benutzern mit einer PostgreSQL-Datenbank zur Verf�gung 
 
 
 Changelog 2.2.0
@@ -317,23 +322,23 @@
 
 deutsch
 
-Hier die Änderungen, die mit der Version 2.2 erfolgt sind:
+Hier die �nderungen, die mit der Version 2.2 erfolgt sind:
 
-    * Nun ist es möglich Mapbender mit einer MySQL- oder PostgreSQL-Datenbank zu installieren. Konfigurieren Sie die Einstellungen in der Datei mapbender.conf.
-    * Sie können die einzelnen Elemente einer GUI mit der Mapbender-Administration editieren (Tabelle element_vars/ css-files/ var).
+    * Nun ist es m�glich Mapbender mit einer MySQL- oder PostgreSQL-Datenbank zu installieren. Konfigurieren Sie die Einstellungen in der Datei mapbender.conf.
+    * Sie k�nnen die einzelnen Elemente einer GUI mit der Mapbender-Administration editieren (Tabelle element_vars/ css-files/ var).
     * WFS
     * Proxy
     * PrintPDF. Dieses Modul erlaubt es dem Benutzer den PrintPDF zu konfigurieren und beinhaltet Overview, Legende, Nordpfeil und ein Logo.
-    * Neue Buttons (button_oo) sind in der GUI 'gui' verfügbar.
+    * Neue Buttons (button_oo) sind in der GUI 'gui' verf�gbar.
     * Ein Klick auf einen Layer referenziert die WMS METADATAURL - neue Spalte layer_metadataurl.
     * Die Legende wird durch die LEGENDURL dargestellt.
-    * Neues Wiki: Um im neuen Wiki editieren zu können, müssen Sie einen Account beantragen bei CCGIS.
+    * Neues Wiki: Um im neuen Wiki editieren zu k�nnen, m�ssen Sie einen Account beantragen bei CCGIS.
     * ToggleModule - definiert ein Element, das beim Start der GUI aktiviert sein soll 
 
-Hier aber schonmal die Änderungen, die uns mit der Version 2.2 erwarten:
+Hier aber schonmal die �nderungen, die uns mit der Version 2.2 erwarten:
 
-    * Mapbender für MySQL oder PostgreSQL
-    * Anpassung der einzelnen Elemente einer GUI über die Mapbender-Administration (element_vars)
+    * Mapbender f�r MySQL oder PostgreSQL
+    * Anpassung der einzelnen Elemente einer GUI �ber die Mapbender-Administration (element_vars)
     * Metadataurl
     * Legendurl 
 
@@ -358,16 +363,16 @@
 
 deutsch
 
-    * Kommunikation über email mail.conf
-    * Neuer Button myGUIlist für die Administrations-GUIs, um in die Liste von meinenGUIs zurück zu kommen.
+    * Kommunikation �ber email mail.conf
+    * Neuer Button myGUIlist f�r die Administrations-GUIs, um in die Liste von meinenGUIs zur�ck zu kommen.
     * Neue Tabelle mb_log
     * Neue Spalte in der Tabelle wms wms_getCapabilities_doc
     * ChangeEpsg_dynamic
-    * Die Rubrik 'Oberflächenelemente editieren' zeigt nun kleine Bilder der Oberfläche zur besseren Orientierung.
+    * Die Rubrik 'Oberfl�chenelemente editieren' zeigt nun kleine Bilder der Oberfl�che zur besseren Orientierung.
     * SQL zur Aktualisierung Ihrer GUIs: siehe Update Mapbender
-    * mapbender/http/tools/validate_db.php - PHP, um die Datenbank zu aktualisieren und wenn nötig neue Spalten und Tabellen hinzuzufügen.
-    * Neue Spalte layer_dataurl in der Tabelle layer hinzugefügt.
-    * Neue Spalten 'legendurl' und 'legendurlformat' in der Tabelle layer_style hinzugefügt.
+    * mapbender/http/tools/validate_db.php - PHP, um die Datenbank zu aktualisieren und wenn n�tig neue Spalten und Tabellen hinzuzuf�gen.
+    * Neue Spalte layer_dataurl in der Tabelle layer hinzugef�gt.
+    * Neue Spalten 'legendurl' und 'legendurlformat' in der Tabelle layer_style hinzugef�gt.
     * Neue Tabelle wms_srs 
 
 
@@ -400,25 +405,25 @@
 
 deutsch
 
-    * Print Ab der Mapbender Version 2.1.0 erfolgt der Standardausdruck von Mapbender als PDF. Hierbei stehen A4 und A3 Druck zur Auswahl sowie Hoch- und Querformat. Der Kartenspiegel kann dabei über eine Konfigurationsdatei an das eigene Design angepaßt werden. Hierbei stehen A4 und A3 Druck zur Auswahl sowie Hoch- und Querformat. 
+    * Print Ab der Mapbender Version 2.1.0 erfolgt der Standardausdruck von Mapbender als PDF. Hierbei stehen A4 und A3 Druck zur Auswahl sowie Hoch- und Querformat. Der Kartenspiegel kann dabei �ber eine Konfigurationsdatei an das eigene Design angepa�t werden. Hierbei stehen A4 und A3 Druck zur Auswahl sowie Hoch- und Querformat. 
 
-    * GUIOwner Der neue Parameter <owner> (Besitzer) wurde der Benutzerverwaltung hinzugefügt. Dies erlaubt eine Unterscheidung zwischen lesen/benutzen einer GUI und der Berechtigung die GUI zu ändern ( edit GUI elements). Dieses Feature ist notwendig als Vorbereitung Mapbender als Portal mit anonymem Zugang einzusetzen, was wiederum notwendig ist, um Wikimap-Funktionalität zu implementieren. Zusätzlich ermöglicht diese Einstellung den Aufbau einer hierarchischen Verwaltung.
-    * Overview Die Übersichtskarte sollte mit dem Modul Overview adressiert werden (<Overview0>, <Overview1>, <Overview2>, ... wurden eingestellt). Das Modul kann mit dem Feld "wms" parametriert werden. Es beinhaltet den Index des WMS, der nicht in der Übersichtskarte angezeigt werden sollte (beginnend bei 0).
+    * GUIOwner Der neue Parameter <owner> (Besitzer) wurde der Benutzerverwaltung hinzugef�gt. Dies erlaubt eine Unterscheidung zwischen lesen/benutzen einer GUI und der Berechtigung die GUI zu �ndern ( edit GUI elements). Dieses Feature ist notwendig als Vorbereitung Mapbender als Portal mit anonymem Zugang einzusetzen, was wiederum notwendig ist, um Wikimap-Funktionalit�t zu implementieren. Zus�tzlich erm�glicht diese Einstellung den Aufbau einer hierarchischen Verwaltung.
+    * Overview Die �bersichtskarte sollte mit dem Modul Overview adressiert werden (<Overview0>, <Overview1>, <Overview2>, ... wurden eingestellt). Das Modul kann mit dem Feld "wms" parametriert werden. Es beinhaltet den Index des WMS, der nicht in der �bersichtskarte angezeigt werden sollte (beginnend bei 0).
     * showCoords_div Bei Aktivierung dieses Buttons werden die Koordinaten der Mausposition unter dem Ziel (target = z.B. mapframe1) angezeigt.
-    * Detaillierte Metadatainformationen für eine GUI. Ebenso Information über die letzte Anfrage als Link.
-    * Zusätzliche Standard-GUIs wurden der Mapbender Datenbank hinzugefügt.
+    * Detaillierte Metadatainformationen f�r eine GUI. Ebenso Information �ber die letzte Anfrage als Link.
+    * Zus�tzliche Standard-GUIs wurden der Mapbender Datenbank hinzugef�gt.
     * Nach der Installation von Mapbender ist bereits ein Set von weltweiten WMSen in verschiedenen GUIs enthalten.
     * Kopieren einer GUI copyGUI / Umbenennen einer GUI RenameGUI.
-    * AddWMS Dynamisches Hinzufügen eines neuen Web Map Services durch die Eingabe der URL in ein OGC WMS Capabilities Dokument. Der aktuelle Ausschnitt, Layer und Einstellungen sind davon nicht betroffen.
-    * Add WMS from list Dynamisches Hinzufügen eines WMS von einer Liste von allen OGC WMS, die in der Mapbender Datenbank enthalten sind für die aktuelle GUI.
-    * Add WMS from filtered list Dynamisches Hinzufügen eines WMS von einer Liste (gefiltert für eine Gruppe oder GUI) für eine GUI .
+    * AddWMS Dynamisches Hinzuf�gen eines neuen Web Map Services durch die Eingabe der URL in ein OGC WMS Capabilities Dokument. Der aktuelle Ausschnitt, Layer und Einstellungen sind davon nicht betroffen.
+    * Add WMS from list Dynamisches Hinzuf�gen eines WMS von einer Liste von allen OGC WMS, die in der Mapbender Datenbank enthalten sind f�r die aktuelle GUI.
+    * Add WMS from filtered list Dynamisches Hinzuf�gen eines WMS von einer Liste (gefiltert f�r eine Gruppe oder GUI) f�r eine GUI .
     * setBackground Definiert einige WMS, die im Hintergrund angezeigt werden.
     * setBackground_all Definieren Sie hier einen oder mehrere WMS, die im Hintergrund angezeigt werden.
-    * DeleteGUI Löschen einer ausgewählten GUI.
-    * DeleteWMS Löschen eines ausgewählten WMS.
-    * Oberflächenelemente editieren (Edit GUI Elements) - Hinzugefügt: GUI Beschreibung editierbar.
-    * WMS GUI Einstellungen (Edit GUI WMS/ WMS GUI settings) - Hinzugefügt: Anzeige der WMS ID.
+    * DeleteGUI L�schen einer ausgew�hlten GUI.
+    * DeleteWMS L�schen eines ausgew�hlten WMS.
+    * Oberfl�chenelemente editieren (Edit GUI Elements) - Hinzugef�gt: GUI Beschreibung editierbar.
+    * WMS GUI Einstellungen (Edit GUI WMS/ WMS GUI settings) - Hinzugef�gt: Anzeige der WMS ID.
     * showCoords_div - Anzeige der Koordinaten unter dem Ziel (target, z.B. mapframe1).
-    * setScaleHint - Setzen eines Maßstabes für Kartenframes.
+    * setScaleHint - Setzen eines Ma�stabes f�r Kartenframes.
     * tabs_vertical - Handhaben von Iframes mit vertikal Karteireitern.
-    * WMS_preferences - Bearbeiten der Einstellungen eines Dienstes eines geladenen WMS, Änderung der Reihenfolge, Entfernen eines WMS, Änderung der Einstellungen. 
\ No newline at end of file
+    * WMS_preferences - Bearbeiten der Einstellungen eines Dienstes eines geladenen WMS, �nderung der Reihenfolge, Entfernen eines WMS, �nderung der Einstellungen. 
\ No newline at end of file

Modified: tags/2.4.4_rc1/http/classes/class_gui.php
===================================================================
--- tags/2.4.3/http/classes/class_gui.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/classes/class_gui.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -183,7 +183,7 @@
 				$error = true;
 			}
 
-			$sql = "INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, e_comment, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) SELECT '" . $newGuiName . "', e_id, e_pos, e_public, e_comment, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url FROM gui_element WHERE fkey_gui_id = '" . $guiList . "';";
+			$sql = "INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) SELECT '" . $newGuiName . "', e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url FROM gui_element WHERE fkey_gui_id = '" . $guiList . "';";
 			$res = db_query($sql);
 			if (!$res) {
 				$report .= "<br><br>" . $sql . "<br><br>" . db_error() . "<br>";
@@ -204,14 +204,15 @@
 				$error = true;
 			}
 
-			$sql = "INSERT INTO gui_mb_group (fkey_gui_id, fkey_mb_group_id, mb_group_type) SELECT '" . $newGuiName . "', fkey_mb_group_id, mb_group_type FROM gui_mb_group WHERE fkey_gui_id = '" . $guiList . "';";
-			$res = db_query($sql);
-			if (!$res) {
-				$report .= "<br><br>" . $sql . "<br><br>" . db_error() . "<br>";
-				$error = true;
-			}
+			if ($withUsers == true) {
+				/* group of original gui is copied as well */
+				$sql = "INSERT INTO gui_mb_group (fkey_gui_id, fkey_mb_group_id, mb_group_type) SELECT '" . $newGuiName . "', fkey_mb_group_id, mb_group_type FROM gui_mb_group WHERE fkey_gui_id = '" . $guiList . "';";
+				$res = db_query($sql);
+				if (!$res) {
+					$report .= "<br><br>" . $sql . "<br><br>" . db_error() . "<br>";
+					$error = true;
+				}
 
-			if ($withUsers == true) {
 				/* users of original gui are copied as well */
 				$sql = "INSERT INTO gui_mb_user (fkey_gui_id, fkey_mb_user_id, mb_user_type) SELECT '" . $newGuiName . "', fkey_mb_user_id, mb_user_type FROM gui_mb_user WHERE fkey_gui_id = '" . $guiList . "';";
 				$res = db_query($sql);

Modified: tags/2.4.4_rc1/http/classes/class_mb_exception.php
===================================================================
--- tags/2.4.3/http/classes/class_mb_exception.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/classes/class_mb_exception.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -29,6 +29,8 @@
 	var $mb_log_level = LOG_LEVEL;	
 	var $dir = "../../log/";
 	var $filename_prefix = "mb_error_";
+	var $result = false;
+	var $message = "";
 
 	function indexOf($level, $levelArray) {
 		$index = false;
@@ -57,12 +59,32 @@
 				if($h = fopen($logfile,"a")){
 					$content = date("Y.m.d, H:i:s") . "," . $n .chr(13).chr(10);
 					if(!fwrite($h,$content)){
-						#exit;
+						$this->result = false;
+						$this->message = "Unable to write " . $logfile;
+						return false;
 					}
 					fclose($h);
+					$this->result = true;
+					$this->message = "Successful.";
+					return true;
 				}
+				else {
+					$this->result = false;
+					$this->message = "Unable to open or generate " . $logfile;
+					return false;
+				}
 			}
+			else {
+				$this->result = false;
+				$this->message = "Directory " . $this->dir . " is not valid.";
+				return false;
+			}
 		}
+		else {
+			$this->result = false;
+			$this->message = "Log level '" . $level . "' is not valid or logging is disabled in mapbender.conf.";
+			return false; 
+		}
 	}
 }
 
@@ -70,7 +92,7 @@
 	var $level = "notice";
 	
 	function mb_notice($message) {
-		$this->mb_log($message, $this->level);
+		return $this->mb_log("Notice: " . $message, $this->level);
 	}
 }
 
@@ -78,7 +100,7 @@
 	var $level = "warning";
 	
 	function mb_warning($message) {
-		$this->mb_log($message, $this->level);
+		return $this->mb_log("Warning: " . $message, $this->level);
 	}
 }
 
@@ -86,7 +108,7 @@
 	var $level = "error";
 	
 	function mb_exception($message) {
-		$this->mb_log($message, $this->level);
+		return $this->mb_log("ERROR: " . $message, $this->level);
 	}
 }
 ?>
\ No newline at end of file

Modified: tags/2.4.4_rc1/http/classes/class_wms.php
===================================================================
--- tags/2.4.3/http/classes/class_wms.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/classes/class_wms.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -435,7 +435,7 @@
 				
 				if(strtoupper($element[tag]) == "SRS"){
 	  				$this->objLayer[$cnt_layer]->wms_srs1 = $element[value];
-					$this->wms_srs = explode (" ", $this->objLayer[0]->wms_srs1);  				
+					$this->wms_srs = array_keys( array_flip(explode (" ", $this->objLayer[0]->wms_srs1)));
 				}						      
 				if(strtoupper($element[tag]) == "LATLONBOUNDINGBOX"){
 					$cnt_epsg++;

Modified: tags/2.4.4_rc1/http/extensions/geom2wfst.php
===================================================================
--- tags/2.4.3/http/extensions/geom2wfst.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/extensions/geom2wfst.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -115,7 +115,7 @@
 }
 else {
 	$response = "error";
-	echo "\"error message\":\"".addslashes($data)."\",";
+	echo "\"error message\":\"".preg_replace("/\"/", "'", preg_replace("/\n/", "", preg_replace("/\r/", "", $data)))."\",";
 }
 echo "\"response\":\"".$response."\"}";
 ?>
\ No newline at end of file

Modified: tags/2.4.4_rc1/http/index.php
===================================================================
--- tags/2.4.3/http/index.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/index.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -109,7 +109,7 @@
 		
 			<div class="mapbender_welcome">Welcome to <font align="left" color="#000000">Ma</font><font color="#0000CE">p</font><font color="#C00000">b</font><font color="#000000">ender</font></div>
 		
-		<font color="#ff0000">Mapbender Version 2.4.3 (2007-10-05)</font>
+		<font color="#ff0000">Mapbender Version 2.4.4 rc1 (2007-11-30)</font>
 		</td></tr>
 	</table>
 <br>

Modified: tags/2.4.4_rc1/http/javascripts/mod_digitize_tab.php
===================================================================
--- tags/2.4.3/http/javascripts/mod_digitize_tab.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/javascripts/mod_digitize_tab.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -1,1243 +1,1243 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_digitize_tab.php
-# Copyright (C) 2002 CCGIS 
-#
-# 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; either version 2, or (at your option)
-# any later version.
-#
-# 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.
-
-session_start();
-import_request_variables("PG");
-require_once("../php/mb_validateSession.php");
-require_once("../../conf/mapbender.conf");
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db(DB,$con);
-$gui_id = $_SESSION["mb_user_gui"];
-?>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-	
-<html>
-<head>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Digitize</title>
-<?php
-$digitize_conf_filename = "digitize_default.conf";
-include '../include/dyn_css.php';
-
-$con = db_connect($DBSERVER,$OWNER,$PW);
-db_select_db(DB,$con);
-$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'digitize' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-$res = db_prep_query($sql, $v, $t);
-$cnt = 0;
-while($row = db_fetch_array($res)){ 
-	$e_src = $row["e_src"];
-	$e_target = explode(",",$row["e_target"]);
-	$cnt++;
-}
-if($cnt > 1) echo "alert('digitize_button: ID not unique!');";
-
-echo "<script language='JavaScript'>";
-echo "var mod_digitize_target = '".$e_target[0]."';";
-echo "var mod_digitize_frame = '".$e_target[1]."';";
-include("../../conf/" . $digitize_conf_filename);
-?>
-
-var wfsWindow;	
-var dwin = null;
-var wfsConf = [];
-var d = new parent.GeometryArray();
-var mod_digitize_width;
-var mod_digitize_height;
-var mod_digitizeEvent = false;
-var nonTransactionalHighlight;
-
-var button_point = "Point";
-var button_line = "Line";
-var button_polygon = "Polygon";
-var button_move = "dragBasePoint";
-var button_insert = "setBasePoint";
-var button_delete = "delBasePoint";
-var button_clear = "clear";
-var button_combine = "combine";
-
-var digitizeDivTag;
-
-var featureTypeElementFormId = "featureTypeElementForm";
-
-try {if(mod_digitize_elName){}}catch(e) {mod_digitize_elName = "digitize";}
-
-// ------------------------------------------------------------------------------------------------------------------------
-// --- polygon, line, point insertion (begin) ----------------------------------------------------------------------------------------------
-
-function appendGeometryArray(obj) {
-	executeDigitizePreFunctions();
-	for (i=0; i<obj.count(); i++) {
-		d.addCopy(obj.get(i));
-	}
-	executeDigitizeSubFunctions();
-}
-
-function mod_digitize_go(e){
-	parent.mb_registerGML(mod_digitize_target,d);   
-
-	// ie workaround
-	if (e == undefined) {
-		e = parent.frames[mod_digitize_target].event;
-	}
-	if (e) {
-		// track mouse position
-		parent.mb_getMousePos(e, mod_digitize_target);
-		var currentPos = new parent.Point(parent.clickX, parent.clickY);
-		s.check(currentPos);
-	}
-	else {
-//		s.clean();
-	}
-
-	var el = parent.frames[mod_digitize_target].document;
-	el.onmousedown = mod_digitize_start;
-}
-
-function mod_digitize_timeout(){
-	var el = parent.frames[mod_digitize_target].document;
-	el.onmousedown = null;
-	el.onmouseup = null;
-	el.onmousemove = null;
-}
-
-function mod_digitize_start(e){
-	// check if a proper geometry is selected	
-	if (d.getGeometry(-1,-1).isComplete() || d.count() == 0){
-		
-		if (mod_digitizeEvent != false) {
-			alert(errorMessageNoGeometrySelected[selectedLanguage]);
-		}
-		return false;
-	}
-	
-	var realWorldPos;
-	if (s.isSnapped()) {
-		realWorldPos = s.getSnappedPoint(); 
-		s.clean();
-	}
-	else {
-		parent.mb_getMousePos(e,mod_digitize_target);
-		realWorldPos = parent.mapToReal(mod_digitize_target,new parent.Point(parent.clickX,parent.clickY));
-	}
-	
-	if (d.get(-1).geomType == parent.geomType.polygon && d.getGeometry(-1,-1).count() > 1 && d.getGeometry(-1,-1).get(0).equals(realWorldPos)) {
-				
-		// close the polygon
-		d.close();
-		parent.mb_disableThisButton(button_polygon);
-		return true;
-	}
-	else if (d.get(-1).geomType == parent.geomType.line && d.getGeometry(-1,-1).count() > 1 && d.getGeometry(-1,-1).get(-1).equals(realWorldPos)) {
-		// close the line
-		d.close();
-		parent.mb_disableThisButton(button_line);
-		return true;
-	}
-	else {
-		// set the calculated real world position as point of the geometry
-		d.getGeometry(-1,-1).addPoint(realWorldPos);
-		
-		if(d.get(-1).geomType == parent.geomType.point){
-			d.close();
-			parent.mb_disableThisButton(button_point);
-			return true;
-		}
-		
-		// add first point of polygon to snapping list (if three points have been inserted).
-		else if (d.get(-1).geomType == parent.geomType.polygon && d.getGeometry(-1,-1).count() == 3) {
-			s.add(d.getPoint(-1, -1, 0));
-		}
-
-		// add last point of line to snapping list (if at least two points have been inserted).
-		else if (d.get(-1).geomType == parent.geomType.line && d.getGeometry(-1,-1).count() >= 2) {
-			if (mod_digitizeEvent != button_move) {
-				s.store(d);
-			}
-			s.add(d.getPoint(-1, -1, -1));
-		}
-	}
-	executeDigitizeSubFunctions();
-	return true;
-}
-// --- polygon, line, point insertion (begin) ----------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------------------------------
-
-// ------------------------------------------------------------------------------------------------------------------------
-// --- basepoint handling (begin) -----------------------------------------------------------------------------------------
-
-var basepointObject = false;
-var basepointMemberIndex = null;
-var basepointGeometryIndex = null;
-var basepointPointIndex = null;
-var basepointDragActive = false;
-
-function handleBasepoint(obj,memberIndex,geometryIndex,pointIndex){
-	if(!(mod_digitizeEvent == button_move || mod_digitizeEvent == button_insert || mod_digitizeEvent == button_delete)){ return false; }
-	
-	basepointObject = obj;
-	basepointMemberIndex = memberIndex;
-	basepointGeometryIndex = geometryIndex;
-	basepointPointIndex = pointIndex;
-	
-	if(mod_digitizeEvent == button_move){
-		mod_digitize_timeout();
-		basepointObject.style.cursor = 'move';
-		basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].selectBasepoint;
-	}
-
-	if(mod_digitizeEvent == button_delete){
-		mod_digitize_timeout();
-		basepointObject.style.cursor = 'crosshair';
-		basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].deleteBasepoint;
-	}
-}
-
-function convertLinepointToBasepoint(obj, memberIndex, geomIndex, pointIndex){
-	if(!(mod_digitizeEvent == button_insert)){ return false; }
-	
-	if(mod_digitizeEvent == button_insert){
-		mod_digitize_timeout();
-		obj.style.cursor = 'crosshair';
-		obj.onclick = insertBasepoint;
-
-		basepointObject = obj;
-		basepointMemberIndex = memberIndex;
-		basepointGeometryIndex = geomIndex;
-		basepointPointIndex = pointIndex;
-	}
-}
-
-function insertBasepoint(e){
-	var i = basepointMemberIndex;
-	var j = basepointGeometryIndex;
-	var k = basepointPointIndex;
-	
-	parent.mb_getMousePos(e, mod_digitize_target);
-	var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX, parent.clickY);
-	var p = new parent.Point(pos[0], pos[1]);
-	d.getGeometry(i,j).addPointAtIndex(p, k);
-
-	executeDigitizeSubFunctions();
-}
-
-function deleteBasepoint(){
-	var i = basepointMemberIndex;
-	var j = basepointGeometryIndex;
-	var k = basepointPointIndex;
-	d.delAllPointsLike(d.getPoint(i,j,k));
-
-	executeDigitizeSubFunctions();
-}
-
-function selectBasepoint(e){
-	if(!basepointDragActive && mod_digitizeEvent == button_move){
-		basepointDragActive = true;
-		s.store(d, d.getPoint(basepointMemberIndex, basepointGeometryIndex, basepointPointIndex));
-		// replace basepoint by transparent blob
-		basepointObject.style.width = mod_digitize_width;
-		basepointObject.style.height = mod_digitize_height;
-		basepointObject.style.left = 0;
-		basepointObject.style.top = 0;
-			
-		if (parent.ie) {
-			// ie cannot handle backgroundColor = 'transparent'
-			basepointObject.style.background = "url(../img/transparent.gif)";
-		}
-		else{
-			basepointObject.style.backgroundColor = 'transparent';
-		}
-
-		basepointObject.onmouseup = releaseBasepoint;
-		basepointObject.onmousemove = dragBasepoint;
-	}
-}
-
-function dragBasepoint(e){
-	if(basepointDragActive){
-		parent.mb_getMousePos(e, mod_digitize_target);
-		var currentPos = new parent.Point(parent.clickX, parent.clickY);
-		var res = s.check(currentPos);
-
-	}
-}
-	
-function updateAllPointsOfNonTransactionalLike(oldP, newP){ 
-	for (var i = 0; i < d.count(); i++) {
-		if (isTransactional(d.get(i))) {
-			d.get(i).updateAllPointsLike(oldP, newP);
-		}
-	}
-}
-
-	
-function releaseBasepoint(e){
-	
-	var i = basepointMemberIndex;
-	var j = basepointGeometryIndex;
-	var k = basepointPointIndex;
-	basepointDragActive = false;
-	
-	parent.mb_getMousePos(e, mod_digitize_target);
-	var basepointDragEnd = new parent.Point(parent.clickX, parent.clickY);
-	basepointObject.onmousedown = null;
-	var p = parent.makeClickPos2RealWorldPos(mod_digitize_target, basepointDragEnd.x, basepointDragEnd.y);
-
-	var oldPoint = parent.cloneObject(d.getPoint(i,j,k));
-	if (s.isSnapped()) {
-		var snappedPoint = parent.cloneObject(s.getSnappedPoint());
-		if (!nonTransactionalEditable) {
-			updateAllPointsOfNonTransactionalLike(oldPoint, snappedPoint);
-		}
-		else {
-			d.updateAllPointsLike(oldPoint, snappedPoint);
-		}
-		s.clean();
-	}
-	else {
-		var newPoint = new parent.Point(p[0],p[1]);
-		if (!nonTransactionalEditable) {
-			updateAllPointsOfNonTransactionalLike(oldPoint, newPoint);
-		}
-		else {
-			d.updateAllPointsLike(oldPoint, newPoint);
-		}
-	}
-	basepointMemberIndex = null;
-	basepointGeometryIndex = null;
-	basepointPointIndex = null;	
-		
-	executeDigitizeSubFunctions();
-}
-// --- basepoint handling (end) -----------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------------------------------
-	
-// ------------------------------------------------------------------------------------------------------------------------
-// --- registered functions (begin) ---------------------------------------------------------------------------------------
-
-function registerDigitizePreFunctions(stringFunction){
-	mod_digitizePreFunctions[mod_digitizePreFunctions.length] = stringFunction;
-}
-
-function registerDigitizeSubFunctions(stringFunction){
-	mod_digitizeSubFunctions[mod_digitizeSubFunctions.length] = stringFunction;
-}
-
-function executeDigitizeSubFunctions(){
-	for(var i=0; i<mod_digitizeSubFunctions.length; i++){
-		eval(mod_digitizeSubFunctions[i]);
-	}
-}
-
-function executeDigitizePreFunctions(){
-	for(var i=0; i<mod_digitizePreFunctions.length; i++){
-		eval(mod_digitizePreFunctions[i]);
-	}
-}
-
-function registerFunctions(){
-	mod_digitizePreFunctions = [];
-	mod_digitizeSubFunctions = [];
-	registerDigitizePreFunctions("updateExtent()");
-	registerDigitizePreFunctions("drawDashedLine()");
-	registerDigitizeSubFunctions("updateListOfGeometries()");
-	registerDigitizeSubFunctions("drawDashedLine()");
-	registerDigitizeSubFunctions("updateMeasureTag()");
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].setStyleForTargetFrame()");
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].checkDigitizeTag()");
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseSnapping()");
-	if (!nonTransactionalEditable) {
-		parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseHighlight()");
-	}
-	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseMeasure()");
-	parent.mb_registerSubFunctions("window.frames['" + mod_digitize_elName + "'].updateExtent()");
-	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].drawDashedLine()");
-	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].updateMeasureTag()");
-	parent.mb_registerWfsReadSubFunctions(function(geom){parent.tab_open(mod_digitize_elName);parent.window.frames[mod_digitize_elName].appendGeometryArray(geom);});
-	parent.mb_registerWfsWriteSubFunctions(function(){parent.zoom(mod_digitize_target, true, 0.999);});
-}
-
-function checkDigitizeTag(){
-	var digitizeTagName = "digitize";
-	var digitizeTagStyle = {"position":"absolute", "top":"0px", "left":"0px", "z-index":digitizeTransactionalZIndex, "font-size":"10px"};
-	 
-	digitizeDivTag = new parent.DivTag(digitizeTagName, mod_digitize_target, digitizeTagStyle);
-	parent.mb_registerPanSubElement(digitizeTagName);
-}
-
-
-function setStyleForTargetFrame(){
-	var cssLink = parent.window.frames[mod_digitize_target].document.createElement("link");
-	cssLink.setAttribute("href", cssUrl); 
-	cssLink.setAttribute("type", "text/css"); 
-	cssLink.setAttribute("rel", "stylesheet"); 
-	var cssTmp = parent.window.frames[mod_digitize_target].document.getElementsByTagName("head")[0];
-	cssTmp.appendChild(cssLink);
-}
-
-function initialiseSnapping(){
-	s = new parent.Snapping(mod_digitize_target, snappingTolerance, snappingColor, snappingHighlightZIndex);
-}
-function initialiseHighlight(){
-	nonTransactionalHighlight = new parent.Highlight(new Array(mod_digitize_target), "nonTransactional", {"position":"absolute", "top":"0px", "left":"0px", "z-index":digitizeNonTransactionalZIndex}, nonTransactionalLineWidth);
-}
-function initialiseMeasure(){
-	measureDivTag = new parent.DivTag(measureTagName, measureTagTarget, measureTagStyle);
-}
-// --- registered functions (end) -----------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------------------------------
-
-
-function updateMeasureTag () {
-	if (d.count() > 0 ) {
-		if (d.get(-1).count() > 0) {
-			if (d.getGeometry(-1, -1).count() > 0) {
-				if (mod_digitizeEvent == button_line || mod_digitizeEvent == button_polygon) {
-					var measureString = "";
-					measureString += measureTagLabelCurrent[selectedLanguage] + d.getGeometry(-1, -1).getCurrentDist(measureNumberOfDigits) + "<br>";
-					measureString += measureTagLabelTotal[selectedLanguage] + d.getGeometry(-1, -1).getTotalDist(measureNumberOfDigits);
-					measureDivTag.write(measureString);
-					return true;
-				}
-			}
-		}
-	}
-	measureDivTag.clean();
-}
-
-
-
-// ------------------------------------------------------------------------------------------------------------------------
-// --- button handling (begin) --------------------------------------------------------------------------------------------
-
-function displayButtons(){
-	for (var i = 0 ; i < buttonDig_id.length ; i ++) {
-		if (parseInt(buttonDig_on[i])==1) {
-			var divTag = document.createElement("div");
-			divTag.setAttribute("id", "div_" + buttonDig_id[i]);
-// FIREFOX 
-			document.getElementById("digButtons").appendChild(divTag);
-
-//IE WORKAROUND, WORKS ALSO FOR FIREFOX
-			var tagContent = "<div style='position:absolute; top:"+buttonDig_y[i]+"px; left:"+buttonDig_x[i]+"px;'><img name=\""+buttonDig_id[i]+"\" onmouseover=\"parent.mb_regButton_frame('initDigButton', mod_digitize_elName, "+i+");\" id=\""+buttonDig_id[i]+"\" title=\""+buttonDig_title_off[i]+"\" src=\""+buttonDig_imgdir+buttonDig_src[i]+"\"></div>";
-			parent.writeTag(mod_digitize_elName,"div_" + buttonDig_id[i],tagContent);
-		}
-	}
-}
-
-function initDigButton(ind, pos){
-	parent.mb_button[ind] = document.getElementById(buttonDig_id[pos]);
-	parent.mb_button[ind].img_over = buttonDig_imgdir + buttonDig_src[pos].replace(/_off/,"_over");
-	parent.mb_button[ind].img_on = buttonDig_imgdir + buttonDig_src[pos].replace(/_off/,"_on");
-	parent.mb_button[ind].img_off = buttonDig_imgdir + buttonDig_src[pos];
-	parent.mb_button[ind].title_on = buttonDig_title_on[pos];
-	parent.mb_button[ind].title_off = buttonDig_title_off[pos];
-	parent.mb_button[ind].status = 0;
-	parent.mb_button[ind].elName = buttonDig_id[pos];
-	parent.mb_button[ind].fName = "";
-	parent.mb_button[ind].go = new Function ("digitizeEnable(parent.mb_button["+ind+"])");
-	parent.mb_button[ind].stop = new Function ("digitizeDisable(parent.mb_button["+ind+"])");
-}	
-
-function digitizeEnable(obj) {
-	if (obj.id == button_move || obj.id == button_insert || obj.id == button_delete) {
-		mod_digitizeEvent = obj.id;
-		executeDigitizePreFunctions();
-	}
-	else if (obj.id == button_point || obj.id == button_line || obj.id == button_polygon || obj.id == button_clear || obj.id == button_combine){
-		var el = parent.frames[mod_digitize_target].document;
-		el.onmousemove = mod_digitize_go;
-
-		mod_digitizeEvent = obj.id;
-
-		if (mod_digitizeEvent == button_point || mod_digitizeEvent == button_line || mod_digitizeEvent == button_polygon || mod_digitizeEvent == button_insert ) {
-			s.store(d);
-		}
-
-		executeDigitizePreFunctions();
-		obj.title = obj.title_on;
-		if (obj.id == button_point) {
-			if (d.count() > 0 && d.get(-1).count() > 0 && !d.get(-1).get(-1).isComplete()) {
-				if (d.get(-1).geomType != parent.geomType.point) {
-					d.close();
-					executeDigitizeSubFunctions();
-				}
-				else {
-					s.add(d.getPoint(-1, -1, 0));
-				}
-			}
-			if (d.count() == 0 || (d.count() > 0 && d.get(-1).count() > 0 && d.get(-1).get(-1).isComplete())) {
-				d.addMember(parent.geomType.point);
-				d.get(-1).addGeometry();
-			}
-			else {
-/*
-//
-// delete existing line or polygon
-//	
-				d.del(-1);
-				d.addMember(parent.geomType.point);
-				d.get(-1).addGeometry();
-*/
-			}
-		}
-		else if (obj.id == button_polygon) {
-			if (d.count() > 0 && d.get(-1).count() > 0 && !d.get(-1).get(-1).isComplete()) {
-				if (d.get(-1).geomType != parent.geomType.polygon) {
-					d.close();
-					executeDigitizeSubFunctions();
-				}
-				else {
-					s.add(d.getPoint(-1, -1, 0));
-				}
-			}
-			if (d.count() == 0 || (d.count() > 0 && d.get(-1).count() > 0 && d.get(-1).get(-1).isComplete())) {
-				// new geometry
-				d.addMember(parent.geomType.polygon);
-				d.get(-1).addGeometry();
-			}
-			else {
-/*
-//
-// continue a line as a polygon
-//	
-				if (d.get(-1).geomType != parent.geomType.polygon) {
-					var geometryTemplate = parent.cloneObject(d.get(-1));
-					d.del(-1);
-					d.addMember(parent.geomType.polygon);
-					for (var i = 0; i < geometryTemplate.count(); i++) {
-						d.get(-1).addGeometry();
-						for (var j = 0; j < geometryTemplate.get(i).count(); j++) {
-							d.get(-1).get(-1).addPoint(geometryTemplate.get(i).get(j));
-						}
-					}
-				}
-				s.add(d.getPoint(-1, -1, 0));
-*/
-			}
-		}
-		else if (obj.id == button_line) {
-			if (d.count() > 0 && d.get(-1).count() > 0 && !d.get(-1).get(-1).isComplete()) {
-				if (d.get(-1).geomType != parent.geomType.line) {
-					d.close();
-					executeDigitizeSubFunctions();
-				}
-				else {
-					s.add(d.getPoint(-1, -1, 0));
-				}
-			}
-			if (d.count() == 0 || (d.count() > 0 && d.get(-1).count() > 0 && d.get(-1).get(-1).isComplete())) {
-				d.addMember(parent.geomType.line);
-				d.get(-1).addGeometry();
-			}
-			else {
-/*
-//
-// continue a polygon as a line
-//	
-				if (d.get(-1).geomType != parent.geomType.line) {
-					var geometryTemplate = parent.cloneObject(d.get(-1));
-					d.del(-1);
-					d.addMember(parent.geomType.line);
-					for (var i = 0; i < geometryTemplate.count(); i++) {
-						d.get(-1).addGeometry();
-						for (var j = 0; j < geometryTemplate.get(i).count(); j++) {
-							d.get(-1).get(-1).addPoint(geometryTemplate.get(i).get(j));
-						}
-					}
-				}
-*/
-			}
-		}
-		else if (obj.id == button_clear) {
-			var clear = confirm(messageConfirmDeleteAllGeomFromList[selectedLanguage]);
-			if (clear) {
-				d = new parent.GeometryArray();
-				parent.mb_disableThisButton(button_clear);
-			}
-		}
-		else if (obj.id == button_combine) {
-//			d.combineToMultiGeometry();
-//			prompt('', d.toJSONString());
-//			parent.mb_ajax_post("../php/jsonTest.php", {json:d.toJSONString()}, function(test, status) {
-//				alert(test);
-//			});
-			parent.mb_disableThisButton(button_combine);
-		}
-	}
-}
-
-function digitizeDisable(obj) {
-	if (obj.id == button_point || obj.id == button_line || obj.id == button_polygon){
-		obj.title = obj.title_off;
-		if (d.get(-1).get(-1).count() == 0) {
-			d.delGeometry(-1,-1);
-		}
-		mod_digitize_timeout();
-		executeDigitizeSubFunctions();
-	}
-	else if (obj.id == button_clear) {
-		mod_digitize_timeout();
-		executeDigitizeSubFunctions();
-	}
-	mod_digitizeEvent = false;
-}
-// --- button handling (end) ----------------------------------------------------------------------------------------------
-// ------------------------------------------------------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------------------------------------
-// --- display (begin) -----------------------------------------------------------------------------------------
-
-function updateExtent() {
-	var anInd = parent.getMapObjIndexByName(mod_digitize_target);
-	var change = false;
-	if (typeof(mod_digitize_width) == 'undefined' || mod_digitize_width != parent.mb_mapObj[anInd].width) {
-		mod_digitize_width = parent.mb_mapObj[anInd].width;
-		change = true;
-	}
-	if (typeof(mod_digitize_height) == 'undefined' || mod_digitize_height != parent.mb_mapObj[anInd].height) {
-		mod_digitize_height = parent.mb_mapObj[anInd].height;
-		change = true;
-	}
-	if (typeof(mod_digitize_epsg) == 'undefined' || mod_digitize_epsg != parent.mb_mapObj[anInd].epsg) {
-		mod_digitize_epsg = parent.mb_mapObj[anInd].epsg;
-		change = true;
-	}
-//	if (change) {
-//		drawDashedLine();
-//	}
-}
-
-function drawDashedLine(){
-	if (!nonTransactionalEditable) {
-		nonTransactionalHighlight.clean();
-	}
-	var smP = "";
-	smP += "<div class='t_img'>";
-	smP += "<img src='"+parent.mb_trans.src+"' width='"+mod_digitize_width+"' height='0'></div>";
-	smP += "<div class='t_img'>";
-	smP += "<img src='"+parent.mb_trans.src+"' width='0' height='"+mod_digitize_height+"'></div>";
-
-	for(var i=0; i<d.count(); i++){
-		if (!nonTransactionalEditable && !isTransactional(d.get(i))) {
-			nonTransactionalHighlight.add(d.get(i), nonTransactionalColor);
-		}
-		else {
-			for(var j=0; j<d.get(i).count(); j++){
-				for(var k = 0; k < d.getGeometry(i,j).count(); k++){
-					var pos = parent.makeRealWorld2mapPos(mod_digitize_target,d.getPoint(i,j,k).x,d.getPoint(i,j,k).y);
-					
-					if (!d.getGeometry(i,j).isComplete() && 
-						( (k == 0 && d.get(i).geomType == parent.geomType.polygon) || (k == d.getGeometry(i,j).count()-1 && d.get(i).geomType == parent.geomType.line))) {
-						smP += "<div class='bp' style='top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;z-index:"+digitizeTransactionalZIndex+";background-color:"+linepointColor+"'";
-					}
-					else {
-						smP += "<div class='bp' style='top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;z-index:"+digitizeTransactionalZIndex+";'";
-					}
-					if(j==0 && d.get(i).geomType == parent.geomType.polygon && !d.getGeometry(i,j).isComplete()){
-						smP += " title='"+closePolygon_title+"' ";
-					}
-					if(mod_digitizeEvent == button_move || mod_digitizeEvent == button_insert || mod_digitizeEvent == button_delete) {
-						smP += " onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].handleBasepoint(this,"+i+","+j+","+k+")' ;";
-					}
-					smP += "></div>";
-				}
-				var mapObjInd = parent.getMapObjIndexByName(mod_digitize_target);
-				for(var k = 1; k < d.getGeometry(i,j).count(); k++){
-					var p0 = parent.realToMap(mod_digitize_target, d.getPoint(i,j,k));
-					var p1 = parent.realToMap(mod_digitize_target, d.getPoint(i,j,k-1));
-					points = parent.calculateVisibleDash(p0, p1, parent.mb_mapObj[mapObjInd].width, parent.mb_mapObj[mapObjInd].height);
-					if (points != false) {
-						smP += evaluateDashes(points[0], points[1], i, j, k);
-					}
-				}
-			}
-		}
-	}
-	digitizeDivTag.write(smP);
-}
-
-function evaluateDashes(start, end, memberIndex, geomIndex, pointIndex){
-	var str_dashedLine = "";
-	var delta = new parent.Point(end.x - start.x, end.y - start.y);
-	 
-	var vecLength = start.dist(end);
-	var n = Math.round(vecLength/dotDistance);
-	var step = new parent.Point(delta.x/n, delta.y/n);
-	for(var i=1; i<n; i++){
-		var x = Math.round(start.x + i * step.x) - 2;
-		var y = Math.round(start.y + i * step.y) - 2;
-		if(x >= 0 && x <= mod_digitize_width && y >= 0 && y <= mod_digitize_height){
-			if (memberIndex == d.count()-1 && !d.getGeometry(-1,-1).isComplete()) {
-				str_dashedLine += "<div class='lp' style='top:"+y+"px;left:"+x+"px;z-index:"+digitizeTransactionalZIndex+";background-color:"+linepointColor+"' ";
-			}
-			else {
-				str_dashedLine += "<div class='lp' style='top:"+y+"px;left:"+x+"px;z-index:"+digitizeTransactionalZIndex+";' ";
-			}
-			if(mod_digitizeEvent == button_insert) {
-				str_dashedLine += "onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].convertLinepointToBasepoint(this,"+memberIndex+","+geomIndex+","+pointIndex+")'";
-			}
-			str_dashedLine += "></div>";
-		}
-	}
-	return str_dashedLine;
-}
-
-function isTransactional(geom) {
-//	alert(typeof(geom.wfs_conf) + " " + geom.wfs_conf + " " + wfsConf.length);
-	if (typeof(geom.wfs_conf) == 'number') {
-		if (geom.wfs_conf >= 0 && geom.wfs_conf < wfsConf.length) {			
-			var isTransactionalGeom = (wfsConf[geom.wfs_conf]['wfs_transaction'] != "" && wfsConf[geom.wfs_conf]['fkey_featuretype_id'] != "");
-			if (isTransactionalGeom) {
-				return true;
-			}
-			else{
-				return false;
-			}
-		}
-	}
-	else if (typeof(geom.wfs_conf) == 'undefined') {
-		return true;
-	}
-}
-
-function isValidWfsConfIndex (wfsConf, wfsConfIndex) {
-	return (typeof(wfsConfIndex) == "number" && wfsConfIndex >=0 && wfsConfIndex < wfsConf.length);
-}
-
-function getName (geom) {
-	wfsConfId = geom.wfs_conf;
-	wfsConf = parent.get_complete_wfs_conf();
-	if (isValidWfsConfIndex(wfsConf, wfsConfId)) {
-		var resultName = "";
-		for (var i = 0 ; i < wfsConf[wfsConfId]['element'].length ; i++) {
-			if (wfsConf[wfsConfId]['element'][i]['f_show'] == 1) {
-				resultName += geom.e.getElementValueByName(wfsConf[wfsConfId]['element'][i]['element_name']) + " ";
-			}
-		}
-		if (resultName == "") {
-			resultName = wfsConf[wfsConfId]['g_label'];
-		}
-		return resultName;
-	}
-	else {
-		return digitizeDefaultGeometryName[selectedLanguage];
-	}
-}
-
-function updateListOfGeometries(){
-	var listOfGeom = "<table style='position:absolute; top:"+geomList_y+"px; left:"+geomList_x+"px;'>\n";
-	if (d.count() > 0) {
-		wfsConf = parent.get_complete_wfs_conf();
-		for (var i = 0 ; i < d.count(); i ++) {
-
-			if (d.get(i).get(-1).isComplete() && (nonTransactionalEditable || isTransactional(d.get(i)))) {
-	
-				listOfGeom += "\t<tr>\n\t\t<td>\n";
-				if (wfsExistsForGeom(d.get(i), wfsConf)) {
-					listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_wfs_src+"' title='"+buttonDig_wfs_title[selectedLanguage]+"' onclick='showWfs("+i+")'>\n";
-				}
-				listOfGeom += "\t\t</td>\n\t\t<td>\n";
-				listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_remove_src+"' title='"+buttonDig_remove_title[selectedLanguage]+"' onclick='parent.mb_disableThisButton(mod_digitizeEvent);d.del("+i+");executeDigitizeSubFunctions();'>\n";
-				listOfGeom += "\t\t</td>\n\t\t<td>\n";
-	
-				if (isValidWfsConfIndex(wfsConf, d.get(i).wfs_conf)) {
-					listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_removeDb_src+"' title='"+buttonDig_removeDb_title[selectedLanguage]+"' onclick=\"var deltrans = confirm('"+messageConfirmDeleteGeomFromDb[selectedLanguage]+"');if (deltrans) dbGeom('delete', "+i+")\">\n";
-				}
-				listOfGeom += "\t\t</td>\n\t\t<td style = 'color:blue;font-size:12px'>\n";
-				listOfGeom += "\t\t\t<div onmouseover='parent.mb_wfs_perform(\"over\",d.get("+i+"));' ";
-				listOfGeom += " onmouseout='parent.mb_wfs_perform(\"out\",d.get("+i+"))' ";
-				listOfGeom += " onclick='parent.mb_wfs_perform(\"click\",d.get("+i+"));' ";
-				var geomName = getName(d.get(i)); 
-				if (d.get(i).geomType == parent.geomType.polygon) {geomName += " ("+messageDescriptionPolygon[selectedLanguage]+")";}
-				else if (d.get(i).geomType == parent.geomType.line) {geomName += " ("+messageDescriptionLine[selectedLanguage]+")";}
-				else if (d.get(i).geomType == parent.geomType.point) {geomName += " ("+messageDescriptionPoint[selectedLanguage]+")";}
-				
-				listOfGeom += ">" + geomName +"</div>\t\t</td>\n\t</tr>\n";
-			}
-		}
-	}
-	listOfGeom += "</table>\n";
-	parent.writeTag(mod_digitize_elName,"listOfGeometries",listOfGeom);
-}
-// --- display (end) -----------------------------------------------------------------------------------------
-// -----------------------------------------------------------------------------------------------------------
-
-
-// -----------------------------------------------------------------------------------------------------------
-// --- wfs window (begin) -----------------------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------------------------------------
-// --- wfs window form check (begin) -----------------------------------------------------------------------------------------
-
-function formCorrect(doc, formId) {
-	var isCorrect = true;
-	var errorMessage = "";
-	var result;
-	var form = doc.getElementById(formId);
-	
-	result = mandatoryFieldsNotEmpty(doc, form);
-	isCorrect = isCorrect && result.isCorrect;
-	errorMessage += result.errorMessage;
-
-	result = validBoxEntrySelected(form);
-	isCorrect = isCorrect && result.isCorrect;
-	errorMessage += result.errorMessage;
-
-	result = dataTypeIsCorrect(doc, form);
-	isCorrect = isCorrect && result.isCorrect;
-	errorMessage += result.errorMessage;
-
-	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
-}
-
-function validBoxEntrySelected(form){
-	var isCorrect = true;
-	var errorMessage = "";
-	for (var i = 0; i < form.childNodes.length && isCorrect; i++) {
-		if (form.childNodes[i].nodeName.toUpperCase() == "SELECT") {
-			if (parseInt(form.childNodes[i].selectedIndex) == 0) {
-				return {"isCorrect":false, "errorMessage":errorMessage};
-			}
-		}
-		else if (form.childNodes[i].hasChildNodes()) {
-			isCorrect = validBoxEntrySelected(form.childNodes[i]).isCorrect;
-		}
-	}
-	if (!isCorrect) {
-		errorMessage = messageSelectAnOption[selectedLanguage] + "\n";
-	}
-	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
-}
-
-function mandatoryFieldsNotEmpty(doc, node){
-	var isCorrect = true;
-	var errorMessage = "";
-	
-	nodeArray = doc.getElementsByName("mandatory");
-	for (var i = 0; i < nodeArray.length && isCorrect; i++) {
-		if (nodeArray[i].nodeName.toUpperCase() == "INPUT" && nodeArray[i].type == "hidden" && nodeArray[i].id.substr(0,10) == "mandatory_") {
-			var nodeId = nodeArray[i].id.substr(10);
-			if (nodeArray[i].value == "true") {
-				if (doc.getElementById(nodeId).value == "") {
-					isCorrect = false;
-					errorMessage += "'"+ doc.getElementById(nodeId).name +"': "+ messageErrorFieldIsEmpty[selectedLanguage] +"\n";
-				}
-			}
-		}
-	}
-	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
-}
-
-function isInteger(str) {
-	if (str.match(/^\d+$/)) {
-		return true;
-	}
-	return false;
-}
-
-function isFloat(str) {
-	if (isInteger(str)) {
-		return true;
-	}
-	if (str.match(/^\d+\.\d+$/)) {
-		return true;
-	}
-	return false;
-}
-
-function replaceCommaByDecimalPoint(str) {
-	var patternString = ",";
-	var pattern = new RegExp(patternString);
-	while (str.match(pattern)) {
-		str = str.replace(pattern, ".");
-	}
-	return str;
-}
-
-function dataTypeIsCorrect(doc, node){
-	var isCorrect = true;
-	var errorMessage = "";
-	
-	nodeArray = doc.getElementsByName("datatype");
-	for (var i = 0; i < nodeArray.length ; i++) {
-		if (nodeArray[i].nodeName.toUpperCase() == "INPUT" && nodeArray[i].type == "hidden" && nodeArray[i].id.substr(0,9) == "datatype_") {
-			var nodeId = nodeArray[i].id.substr(9);
-			var nodeValue = doc.getElementById(nodeId).value;
-			
-			if (nodeArray[i].value == "int") {
-				if (!isInteger(nodeValue)) {
-					isCorrect = false;
-					errorMessage += "'"+doc.getElementById(nodeId).name+"': "+ messageErrorNotAnInteger[selectedLanguage] + "\n";
-				}
-			}
-			else if (nodeArray[i].value == "double") {
-				nodeValue = replaceCommaByDecimalPoint(nodeValue);
-				if (!isFloat(nodeValue)) {
-					isCorrect = false;
-					errorMessage += "'"+doc.getElementById(nodeId).name+"': "+ messageErrorNotAFloat[selectedLanguage] + "\n";
-				}
-				else {
-					doc.getElementById(nodeId).value = nodeValue;
-				}
-			}
-		}
-	}
-	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
-}
-// --- wfs window form check (end) -----------------------------------------------------------------------------------------
-// -----------------------------------------------------------------------------------------------------------
-
-function getAvailableWfsForGeom(geom, wfsConf) {
-	var wfsConfIndices = [];
-	
-	for (var attr in wfsConf) {
-		var isTrans = (wfsConf[attr]['wfs_transaction'] != "");
-		if (!isTrans) {
-			continue;
-		}
-		if (isValidWfsConfIndex(wfsConf, parseInt(geom.wfs_conf))) {
-			
-			if (parseInt(geom.wfs_conf) == parseInt(attr)) {
-				wfsConfIndices.push(attr);
-			}
-		}
-		else {
-			for (var elementIndex = 0; elementIndex < wfsConf[attr]['element'].length ; elementIndex++) {
-				var isGeomColumn = (parseInt(wfsConf[attr]['element'][elementIndex]['f_geom']) == 1); 
-				if (isGeomColumn) {
-					var isMultiPolygon = (geom.geomType == parent.geomType.polygon && wfsConf[attr]['element'][elementIndex]['element_type'] == 'MultiPolygonPropertyType');
-					var isPolygon = (geom.geomType == parent.geomType.polygon && geom.count() == 1 && wfsConf[attr]['element'][elementIndex]['element_type'] == 'PolygonPropertyType');
-					var isMultiLine = (geom.geomType == parent.geomType.line && wfsConf[attr]['element'][elementIndex]['element_type'] == 'MultiLineStringPropertyType');
-					var isLine = (geom.geomType == parent.geomType.line && geom.count() == 1 && wfsConf[attr]['element'][elementIndex]['element_type'] == 'LineStringPropertyType');
-					var isPoint = (geom.geomType == parent.geomType.point && wfsConf[attr]['element'][elementIndex]['element_type'] == 'PointPropertyType');
-//					alert(isMultiPolygon + " " + isPolygon + " " + isMultiLine + " " + isLine + " " + isPoint);
-					if (isMultiPolygon || isPolygon || isMultiLine || isLine || isPoint || wfsConf[attr]['element'][elementIndex]['element_type'] == 'GeometryAssociationType') {
-						
-						wfsConfIndices.push(attr);
-					}
-				}
-			}
-		}	
-	}
-	return wfsConfIndices;
-}
-function wfsExistsForGeom(geom, wfsConf) {
-	wfsConfIndices = getAvailableWfsForGeom(geom, wfsConf);
-//	alert(wfsConfIndices.join(","));
-	if (wfsConfIndices.length > 0) {
-		return true;
-	}
-	return false;
-}
-
-
-//
-// this method opens a new window and displays the attributes in wfs_conf
-//
-function showWfs(geometryIndex) {
-	wfsConf = parent.get_complete_wfs_conf();
-
-	wfsWindow = open("", "wfsattributes", "width="+wfsWindowWidth+", height="+wfsWindowHeight+", resizable, dependent=yes, scrollbars=yes");
-	wfsWindow.document.open("text/html");
-
-	var str = "";
-	var strStyle = "";
-	var defaultIndex = -1;
-
-	str += "<form id='wfs'>\n";
-
-	//
-	// 1. add select box 
-	//
-
-	var onChangeText = "document.getElementById('elementForm').innerHTML = ";
-	onChangeText += "window.opener.buildElementForm(this.value , " + geometryIndex + ");";
-	onChangeText += "window.opener.setWfsWindowStyle(this.value);";
-	
-	str += "\t<select name='wfs' size='" + wfsConf.length + "'";
-	str += " onChange=\""+ onChangeText +"\"";
-	str += ">\n\t\t";
-
-	var wfsConfIndices = getAvailableWfsForGeom(d.get(geometryIndex), wfsConf);
-//	alert(wfsConfIndices.join(","));
-	var selected = false;
-	for (var i = 0; i < wfsConfIndices.length ; i++) {
-		str += "<option value='" + wfsConfIndices[i] + "'";
-		if (!selected) {
-			str += " selected";
-			selected = true;
-			defaultIndex = parseInt(wfsConfIndices[i]);
-		}
-		str += ">" + wfsConf[wfsConfIndices[i]]['wfs_conf_abstract'];
-		str += "</option>\n\t\t";
-	}
-
-	
-	str += "</select>\n\t\t</form>\n\t";
-	str += "<div id='elementForm'>\n</div>";
-	
-	if (defaultIndex != -1) {
-		wfsWindow.document.writeln("<html><head><style type='text/css'>"+wfsConf[defaultIndex]['g_style']+"</style></head><body></body></html>");
-		wfsWindow.document.write(str);
-		wfsWindow.document.close();
-		wfsWindow.document.getElementById("elementForm").innerHTML = buildElementForm(defaultIndex, geometryIndex);
-	}
-	else {
-		wfsWindow.document.writeln("<html><head><style type='text/css'></style></head><body></body></html>");
-		wfsWindow.document.write(str);
-		wfsWindow.document.close();
-	}
-}
-
-function setWfsWindowStyle(wfsConfIndex) {
-	wfsWindow.document.getElementsByTagName("style")[0].innerHTML = wfsConf[wfsConfIndex]['g_style'];
-}
-
-// returns a form with the elements of a selected wfs
-// (if the original wfs is the selected wfs, the values are set too)
-function buildElementForm(wfsConfIndex, memberIndex){
-	var featureTypeMismatch = false;
-	if (parseInt(d.get(memberIndex).wfs_conf) != parseInt(wfsConfIndex)) {featureTypeMismatch = true;}
-	var str = "";
-	var hasGeometryColumn = false;
-	var featureTypeArray = wfsConf[wfsConfIndex];
-	var memberElements;
-	var fid = false;
-
-	if (!featureTypeMismatch) {
-		memberElements = d.get(memberIndex).e;
-		fid = memberElements.getElementValueByName('fid');
-	}
-	
-	if (typeof(featureTypeArray["element"]) !== "undefined") {
-
-		str += "<form id='"+featureTypeElementFormId+"'>\n\t<table>\n";
-		featureTypeElementArray = featureTypeArray["element"];
-		
-		//
-		// 2. add rows to form 
-		//
-		for (var i = 0 ; i < featureTypeElementArray.length ; i ++) {
-			var featureTypeElement = featureTypeElementArray[i];
-
-			var elementName = featureTypeElement['element_name'];
-			var elementType = featureTypeElement['element_type'];
-			var isEditable = (parseInt(featureTypeElement['f_edit']) == 1); 
-			var isMandatory = (parseInt(featureTypeElement['f_mandatory']) == 1); 
-			var isGeomColumn = (parseInt(featureTypeElement['f_geom']) == 1); 
-
-			var elementLabelExists = (featureTypeElement['f_label'] != "");
-			var elementLabel = ""; 
-			if (elementLabelExists) {
-				elementLabel = featureTypeElement['f_label'];
-			}
-			var elementLabelStyle = featureTypeElement['f_label_id'];
-
-			if (!isGeomColumn) {
-				if (isEditable) {
-					str += "\t\t<tr>\n";
-					str += "\t\t\t<td>\n\t\t\t\t<div class = '"+elementLabelStyle+"''>" + elementLabel + "</div>\n\t\t\t</td>\n";
-					str += "\t\t\t<td>\n";
-
-					var elementValue = "";
-					if (!featureTypeMismatch) {
-						for (var j = 0 ; j < memberElements.count() ; j ++) {
-							if (memberElements.getName(j) == featureTypeElement['element_name']) {
-								elementValue = memberElements.getValue(j);
-							}
-						}
-					}
-					var formElementHtml = featureTypeElement['f_form_element_html']; 
-					if (!formElementHtml) {
-						str += "\t\t\t\t<input id = 'datatype_" + elementName + "' name='datatype' type='hidden' value = '" + elementType + "'>\n";
-						str += "\t\t\t\t<input id = 'mandatory_" + elementName + "' name='mandatory' type='hidden' value = '" + isMandatory + "'>\n";
-						str += "\t\t\t\t<input id = '" + elementName + "' name='" + elementLabel + "' type='text' class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
-						}
-						else {
-							while (formElementHtml.match(/\\/)) {
-								formElementHtml = formElementHtml.replace(/\\/, "");
-							} 
-//							alert(formElementHtml);
-							// preselect the correct entry of the box
-							var patternString = "option value='"+elementValue+"'";
-							var pattern = new RegExp(patternString);
-							formElementHtml = formElementHtml.replace(pattern, patternString+" selected");
-//							alert(formElementHtml);
-							str += formElementHtml;
-	
-						}
-						str += "\t\t\t</td>\n\t\t</tr>\n";
-				}
-			}
-			else {
-				hasGeometryColumn = true;
-			}
-		}
-
-		//
-		// 3. add buttons "save", "update", "delete"
-		//
-		str += "</table><table>";
-		var isTransactional = (featureTypeArray['wfs_transaction']); 
-		if (isTransactional) {
-			str += "\t\t<tr>\n";
-
-			var options = ["save", "update", "delete", "abort"];
-			for (var i = 0 ; i < options.length ; i++) {
-				var onClickText = "this.disabled=true;var result = window.opener.formCorrect(document, '"+featureTypeElementFormId+"');";
-				onClickText += 	"if (result.isCorrect) {";
-				onClickText += 		"window.opener.dbGeom('"+options[i]+"', "+memberIndex+"); ";
-//				onClickText +=      "window.close();";
-				onClickText += 	"}";
-				onClickText += 	"else {";
-				onClickText += 		"alert(result.errorMessage);this.disabled=false;"
-				onClickText += 	"}";
-				
-				if (options[i] == "save" && hasGeometryColumn && (!fid || showSaveButtonForExistingGeometries)) {
-					str += "\t\t\t<td><input type='button' name='saveButton' value='"+buttonLabelSaveGeometry[selectedLanguage]+"' onclick=\""+onClickText+"\" /></td>\n";
-				}
-				
-				if (!featureTypeMismatch && fid) {
-					if (options[i] == "update" && hasGeometryColumn) {
-						str += "\t\t\t<td><input type='button' name='updateButton' value='"+buttonLabelUpdateGeometry[selectedLanguage]+"' onclick=\""+onClickText+"\"/></td>\n";
-					}
-					if (options[i] == "delete"){ 
-						var deleteOnClickText = "var deltrans = confirm('"+messageConfirmDeleteGeomFromDb[selectedLanguage]+"');";
-						deleteOnClickText += "if (deltrans){";
-						deleteOnClickText += onClickText + "}";
-						str += "\t\t\t<td><input type='button' name='deleteButton' value='"+buttonLabelDeleteGeometry[selectedLanguage]+"' onclick=\""+deleteOnClickText+"\"/></td>\n";
-					}
-				}
-				if (options[i] == "abort") {
-					str += "\t\t\t<td><input type='button' name='abortButton' value='"+buttonLabelAbort[selectedLanguage]+"' onclick=\"window.close();\" /></td>\n";
-				}
-			}
-			str += "\t\t</tr>\n";
-		}
-		str += "\t</table>\n";
-		str += "<input type='hidden' id='fid' value='"+fid+"'>";
-//			str += "<input type='text' name='mb_wfs_conf'>";
-		str += "</form>\n";
-	}
-	return str;
-}
-
-function dbGeom(type,m) {
-	if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
-		d.get(m).wfs_conf = parseInt(wfsWindow.document.forms[0].wfs.options[wfsWindow.document.forms[0].wfs.selectedIndex].value);
-		d.get(m).e = new parent.Wfs_element();
-	}
-	else {
-		wfsConf = parent.get_complete_wfs_conf();
-	}
-	var myconf = wfsConf[d.get(m).wfs_conf];
-	
-	var mapObjInd = parent.getMapObjIndexByName(mod_digitize_target);
-
-	if (myconf['featuretype_srs'] != parent.mb_mapObj[mapObjInd].epsg) {
-		alert(errorMessageEpsgMismatch[selectedLanguage] + parent.mb_mapObj[mapObjInd].epsg + " / "+ myconf['featuretype_srs']);
-	}
-	else {
-		var fid = false;
-		var errorMessage = "";
-		if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
-			myform = wfsWindow.document.getElementById(featureTypeElementFormId);
-		
-			for (var i=0; i<myform.length; i++){
-				if (myform.elements[i].id == "fid") {
-					fid = myform.elements[i].value;
-					d.get(m).e.setElement('fid', fid);
-				}
-				else if (myform.elements[i].type == 'text' ){
-					if (myform.elements[i].id) {
-						d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].value);
-					}
-					else {
-						errorMessage = messageErrorFormEvaluation[selectedLanguage];
-					}
-				}
-				// selectbox
-				else if (typeof(myform.elements[i].selectedIndex) == 'number') {
-					if (myform.elements[i].id) {
-						d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].options[myform.elements[i].selectedIndex].value);
-					}
-					else {
-						errorMessage = messageErrorFormEvaluation[selectedLanguage];
-					}
-				}
-			}
-		}
-		else {
-			fid = d.get(m).e.getElementValueByName('fid');
-		}
-		str = parent.get_wfs_str(myconf, d, m, type, fid);
-		
-		parent.mb_ajax_post("../extensions/geom2wfst.php", {'filter':str,'url':myconf['wfs_transaction']}, function(json,status){
-			var result = eval('('+json+')');
-			var response = result.response;
-			var fid = result.fid;
-			wfsSubWrite(m, type, status, response, fid);
-		});
-	}
-}
-
-function wfsSubWrite(m, type, status, response, fid) {
-	if (type == 'save' && fid) {
-		d.get(m).e.setElement("fid", fid);
-	}
-	if (type == 'delete') {
-		parent.mb_disableThisButton(mod_digitizeEvent);
-		d.del(m);
-	}
-	parent.mb_execWfsWriteSubFunctions();
-	executeDigitizeSubFunctions();
-	
-	if (status == "success" && response == "success") {
-		var wfsWriteMessage = messageSuccessWfsWrite[selectedLanguage];
-	}
-	else {
-		var wfsWriteMessage = messageErrorWfsWrite[selectedLanguage];
-	} 
-
-	if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
-		wfsWindow.alert(wfsWriteMessage);
-		window.setTimeout("wfsWindow.close()",0);
-	}
-	else {
-		alert(wfsWriteMessage);
-	}
-}
-// --- wfs window (begin) -----------------------------------------------------------------------------------------
-// -----------------------------------------------------------------------------------------------------------
-
-	</script>
-	</head>
-	<body onload="registerFunctions();displayButtons();">
-		<table cellpadding='0' cellspacing='0' align = center><tr><td><div id='digButtons'></div></td></tr></table>
-		<div id = 'listOfGeometries'></div>
-	</body>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_digitize_tab.php
+# Copyright (C) 2002 CCGIS 
+#
+# 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; either version 2, or (at your option)
+# any later version.
+#
+# 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.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$gui_id = $_SESSION["mb_user_gui"];
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+	
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Digitize</title>
+<?php
+$digitize_conf_filename = "digitize_default.conf";
+include '../include/dyn_css.php';
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'digitize' AND fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sql, $v, $t);
+$cnt = 0;
+while($row = db_fetch_array($res)){ 
+	$e_src = $row["e_src"];
+	$e_target = explode(",",$row["e_target"]);
+	$cnt++;
+}
+if($cnt > 1) echo "alert('digitize_button: ID not unique!');";
+
+echo "<script language='JavaScript'>";
+echo "var mod_digitize_target = '".$e_target[0]."';";
+echo "var mod_digitize_frame = '".$e_target[1]."';";
+include("../../conf/" . $digitize_conf_filename);
+?>
+
+var wfsWindow;	
+var dwin = null;
+var wfsConf = [];
+var d = new parent.GeometryArray();
+var mod_digitize_width;
+var mod_digitize_height;
+var mod_digitizeEvent = false;
+var nonTransactionalHighlight;
+
+var button_point = "Point";
+var button_line = "Line";
+var button_polygon = "Polygon";
+var button_move = "dragBasePoint";
+var button_insert = "setBasePoint";
+var button_delete = "delBasePoint";
+var button_clear = "clear";
+var button_combine = "combine";
+
+var digitizeDivTag;
+
+var featureTypeElementFormId = "featureTypeElementForm";
+
+try {if(mod_digitize_elName){}}catch(e) {mod_digitize_elName = "digitize";}
+
+// ------------------------------------------------------------------------------------------------------------------------
+// --- polygon, line, point insertion (begin) ----------------------------------------------------------------------------------------------
+
+function appendGeometryArray(obj) {
+	executeDigitizePreFunctions();
+	for (i=0; i<obj.count(); i++) {
+		d.addCopy(obj.get(i));
+	}
+	executeDigitizeSubFunctions();
+}
+
+function mod_digitize_go(e){
+	parent.mb_registerGML(mod_digitize_target,d);   
+
+	// ie workaround
+	if (e == undefined) {
+		e = parent.frames[mod_digitize_target].event;
+	}
+	if (e) {
+		// track mouse position
+		parent.mb_getMousePos(e, mod_digitize_target);
+		var currentPos = new parent.Point(parent.clickX, parent.clickY);
+		s.check(currentPos);
+	}
+	else {
+//		s.clean();
+	}
+
+	var el = parent.frames[mod_digitize_target].document;
+	el.onmousedown = mod_digitize_start;
+}
+
+function mod_digitize_timeout(){
+	var el = parent.frames[mod_digitize_target].document;
+	el.onmousedown = null;
+	el.onmouseup = null;
+	el.onmousemove = null;
+}
+
+function mod_digitize_start(e){
+	// check if a proper geometry is selected	
+	if (d.getGeometry(-1,-1).isComplete() || d.count() == 0){
+		
+		if (mod_digitizeEvent != false) {
+			alert(errorMessageNoGeometrySelected[selectedLanguage]);
+		}
+		return false;
+	}
+	
+	var realWorldPos;
+	if (s.isSnapped()) {
+		realWorldPos = s.getSnappedPoint(); 
+		s.clean();
+	}
+	else {
+		parent.mb_getMousePos(e,mod_digitize_target);
+		realWorldPos = parent.mapToReal(mod_digitize_target,new parent.Point(parent.clickX,parent.clickY));
+	}
+	
+	if (d.get(-1).geomType == parent.geomType.polygon && d.getGeometry(-1,-1).count() > 1 && d.getGeometry(-1,-1).get(0).equals(realWorldPos)) {
+				
+		// close the polygon
+		d.close();
+		parent.mb_disableThisButton(button_polygon);
+		return true;
+	}
+	else if (d.get(-1).geomType == parent.geomType.line && d.getGeometry(-1,-1).count() > 1 && d.getGeometry(-1,-1).get(-1).equals(realWorldPos)) {
+		// close the line
+		d.close();
+		parent.mb_disableThisButton(button_line);
+		return true;
+	}
+	else {
+		// set the calculated real world position as point of the geometry
+		d.getGeometry(-1,-1).addPoint(realWorldPos);
+		
+		if(d.get(-1).geomType == parent.geomType.point){
+			d.close();
+			parent.mb_disableThisButton(button_point);
+			return true;
+		}
+		
+		// add first point of polygon to snapping list (if three points have been inserted).
+		else if (d.get(-1).geomType == parent.geomType.polygon && d.getGeometry(-1,-1).count() == 3) {
+			s.add(d.getPoint(-1, -1, 0));
+		}
+
+		// add last point of line to snapping list (if at least two points have been inserted).
+		else if (d.get(-1).geomType == parent.geomType.line && d.getGeometry(-1,-1).count() >= 2) {
+			if (mod_digitizeEvent != button_move) {
+				s.store(d);
+			}
+			s.add(d.getPoint(-1, -1, -1));
+		}
+	}
+	executeDigitizeSubFunctions();
+	return true;
+}
+// --- polygon, line, point insertion (begin) ----------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------------------------------
+// --- basepoint handling (begin) -----------------------------------------------------------------------------------------
+
+var basepointObject = false;
+var basepointMemberIndex = null;
+var basepointGeometryIndex = null;
+var basepointPointIndex = null;
+var basepointDragActive = false;
+
+function handleBasepoint(obj,memberIndex,geometryIndex,pointIndex){
+	if(!(mod_digitizeEvent == button_move || mod_digitizeEvent == button_insert || mod_digitizeEvent == button_delete)){ return false; }
+	
+	basepointObject = obj;
+	basepointMemberIndex = memberIndex;
+	basepointGeometryIndex = geometryIndex;
+	basepointPointIndex = pointIndex;
+	
+	if(mod_digitizeEvent == button_move){
+		mod_digitize_timeout();
+		basepointObject.style.cursor = 'move';
+		basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].selectBasepoint;
+	}
+
+	if(mod_digitizeEvent == button_delete){
+		mod_digitize_timeout();
+		basepointObject.style.cursor = 'crosshair';
+		basepointObject.onmousedown = parent.window.frames[mod_digitize_elName].deleteBasepoint;
+	}
+}
+
+function convertLinepointToBasepoint(obj, memberIndex, geomIndex, pointIndex){
+	if(!(mod_digitizeEvent == button_insert)){ return false; }
+	
+	if(mod_digitizeEvent == button_insert){
+		mod_digitize_timeout();
+		obj.style.cursor = 'crosshair';
+		obj.onclick = insertBasepoint;
+
+		basepointObject = obj;
+		basepointMemberIndex = memberIndex;
+		basepointGeometryIndex = geomIndex;
+		basepointPointIndex = pointIndex;
+	}
+}
+
+function insertBasepoint(e){
+	var i = basepointMemberIndex;
+	var j = basepointGeometryIndex;
+	var k = basepointPointIndex;
+	
+	parent.mb_getMousePos(e, mod_digitize_target);
+	var pos = parent.makeClickPos2RealWorldPos(mod_digitize_target,parent.clickX, parent.clickY);
+	var p = new parent.Point(pos[0], pos[1]);
+	d.getGeometry(i,j).addPointAtIndex(p, k);
+
+	executeDigitizeSubFunctions();
+}
+
+function deleteBasepoint(){
+	var i = basepointMemberIndex;
+	var j = basepointGeometryIndex;
+	var k = basepointPointIndex;
+	d.delAllPointsLike(d.getPoint(i,j,k));
+
+	executeDigitizeSubFunctions();
+}
+
+function selectBasepoint(e){
+	if(!basepointDragActive && mod_digitizeEvent == button_move){
+		basepointDragActive = true;
+		s.store(d, d.getPoint(basepointMemberIndex, basepointGeometryIndex, basepointPointIndex));
+		// replace basepoint by transparent blob
+		basepointObject.style.width = mod_digitize_width;
+		basepointObject.style.height = mod_digitize_height;
+		basepointObject.style.left = 0;
+		basepointObject.style.top = 0;
+			
+		if (parent.ie) {
+			// ie cannot handle backgroundColor = 'transparent'
+			basepointObject.style.background = "url(../img/transparent.gif)";
+		}
+		else{
+			basepointObject.style.backgroundColor = 'transparent';
+		}
+
+		basepointObject.onmouseup = releaseBasepoint;
+		basepointObject.onmousemove = dragBasepoint;
+	}
+}
+
+function dragBasepoint(e){
+	if(basepointDragActive){
+		parent.mb_getMousePos(e, mod_digitize_target);
+		var currentPos = new parent.Point(parent.clickX, parent.clickY);
+		var res = s.check(currentPos);
+
+	}
+}
+	
+function updateAllPointsOfNonTransactionalLike(oldP, newP){ 
+	for (var i = 0; i < d.count(); i++) {
+		if (isTransactional(d.get(i))) {
+			d.get(i).updateAllPointsLike(oldP, newP);
+		}
+	}
+}
+
+	
+function releaseBasepoint(e){
+	
+	var i = basepointMemberIndex;
+	var j = basepointGeometryIndex;
+	var k = basepointPointIndex;
+	basepointDragActive = false;
+	
+	parent.mb_getMousePos(e, mod_digitize_target);
+	var basepointDragEnd = new parent.Point(parent.clickX, parent.clickY);
+	basepointObject.onmousedown = null;
+	var p = parent.makeClickPos2RealWorldPos(mod_digitize_target, basepointDragEnd.x, basepointDragEnd.y);
+
+	var oldPoint = parent.cloneObject(d.getPoint(i,j,k));
+	if (s.isSnapped()) {
+		var snappedPoint = parent.cloneObject(s.getSnappedPoint());
+		if (!nonTransactionalEditable) {
+			updateAllPointsOfNonTransactionalLike(oldPoint, snappedPoint);
+		}
+		else {
+			d.updateAllPointsLike(oldPoint, snappedPoint);
+		}
+		s.clean();
+	}
+	else {
+		var newPoint = new parent.Point(p[0],p[1]);
+		if (!nonTransactionalEditable) {
+			updateAllPointsOfNonTransactionalLike(oldPoint, newPoint);
+		}
+		else {
+			d.updateAllPointsLike(oldPoint, newPoint);
+		}
+	}
+	basepointMemberIndex = null;
+	basepointGeometryIndex = null;
+	basepointPointIndex = null;	
+		
+	executeDigitizeSubFunctions();
+}
+// --- basepoint handling (end) -----------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------------------------------
+	
+// ------------------------------------------------------------------------------------------------------------------------
+// --- registered functions (begin) ---------------------------------------------------------------------------------------
+
+function registerDigitizePreFunctions(stringFunction){
+	mod_digitizePreFunctions[mod_digitizePreFunctions.length] = stringFunction;
+}
+
+function registerDigitizeSubFunctions(stringFunction){
+	mod_digitizeSubFunctions[mod_digitizeSubFunctions.length] = stringFunction;
+}
+
+function executeDigitizeSubFunctions(){
+	for(var i=0; i<mod_digitizeSubFunctions.length; i++){
+		eval(mod_digitizeSubFunctions[i]);
+	}
+}
+
+function executeDigitizePreFunctions(){
+	for(var i=0; i<mod_digitizePreFunctions.length; i++){
+		eval(mod_digitizePreFunctions[i]);
+	}
+}
+
+function registerFunctions(){
+	mod_digitizePreFunctions = [];
+	mod_digitizeSubFunctions = [];
+	registerDigitizePreFunctions("updateExtent()");
+	registerDigitizePreFunctions("drawDashedLine()");
+	registerDigitizeSubFunctions("updateListOfGeometries()");
+	registerDigitizeSubFunctions("drawDashedLine()");
+	registerDigitizeSubFunctions("updateMeasureTag()");
+	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].setStyleForTargetFrame()");
+	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].checkDigitizeTag()");
+	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseSnapping()");
+	if (!nonTransactionalEditable) {
+		parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseHighlight()");
+	}
+	parent.mb_registerInitFunctions("window.frames['"+ mod_digitize_elName + "'].initialiseMeasure()");
+	parent.mb_registerSubFunctions("window.frames['" + mod_digitize_elName + "'].updateExtent()");
+	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].drawDashedLine()");
+	parent.mb_registerSubFunctions("window.frames['"+ mod_digitize_elName + "'].updateMeasureTag()");
+	parent.mb_registerWfsReadSubFunctions(function(geom){parent.tab_open(mod_digitize_elName);parent.window.frames[mod_digitize_elName].appendGeometryArray(geom);});
+	parent.mb_registerWfsWriteSubFunctions(function(){parent.zoom(mod_digitize_target, true, 0.999);});
+}
+
+function checkDigitizeTag(){
+	var digitizeTagName = "digitize";
+	var digitizeTagStyle = {"position":"absolute", "top":"0px", "left":"0px", "z-index":digitizeTransactionalZIndex, "font-size":"10px"};
+	 
+	digitizeDivTag = new parent.DivTag(digitizeTagName, mod_digitize_target, digitizeTagStyle);
+	parent.mb_registerPanSubElement(digitizeTagName);
+}
+
+
+function setStyleForTargetFrame(){
+	var cssLink = parent.window.frames[mod_digitize_target].document.createElement("link");
+	cssLink.setAttribute("href", cssUrl); 
+	cssLink.setAttribute("type", "text/css"); 
+	cssLink.setAttribute("rel", "stylesheet"); 
+	var cssTmp = parent.window.frames[mod_digitize_target].document.getElementsByTagName("head")[0];
+	cssTmp.appendChild(cssLink);
+}
+
+function initialiseSnapping(){
+	s = new parent.Snapping(mod_digitize_target, snappingTolerance, snappingColor, snappingHighlightZIndex);
+}
+function initialiseHighlight(){
+	nonTransactionalHighlight = new parent.Highlight(new Array(mod_digitize_target), "nonTransactional", {"position":"absolute", "top":"0px", "left":"0px", "z-index":digitizeNonTransactionalZIndex}, nonTransactionalLineWidth);
+}
+function initialiseMeasure(){
+	measureDivTag = new parent.DivTag(measureTagName, measureTagTarget, measureTagStyle);
+}
+// --- registered functions (end) -----------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------------------------------
+
+
+function updateMeasureTag () {
+	if (d.count() > 0 ) {
+		if (d.get(-1).count() > 0) {
+			if (d.getGeometry(-1, -1).count() > 0) {
+				if (mod_digitizeEvent == button_line || mod_digitizeEvent == button_polygon) {
+					var measureString = "";
+					measureString += measureTagLabelCurrent[selectedLanguage] + d.getGeometry(-1, -1).getCurrentDist(measureNumberOfDigits) + "<br>";
+					measureString += measureTagLabelTotal[selectedLanguage] + d.getGeometry(-1, -1).getTotalDist(measureNumberOfDigits);
+					measureDivTag.write(measureString);
+					return true;
+				}
+			}
+		}
+	}
+	measureDivTag.clean();
+}
+
+
+
+// ------------------------------------------------------------------------------------------------------------------------
+// --- button handling (begin) --------------------------------------------------------------------------------------------
+
+function displayButtons(){
+	for (var i = 0 ; i < buttonDig_id.length ; i ++) {
+		if (parseInt(buttonDig_on[i])==1) {
+			var divTag = document.createElement("div");
+			divTag.setAttribute("id", "div_" + buttonDig_id[i]);
+// FIREFOX 
+			document.getElementById("digButtons").appendChild(divTag);
+
+//IE WORKAROUND, WORKS ALSO FOR FIREFOX
+			var tagContent = "<div style='position:absolute; top:"+buttonDig_y[i]+"px; left:"+buttonDig_x[i]+"px;'><img name=\""+buttonDig_id[i]+"\" onmouseover=\"parent.mb_regButton_frame('initDigButton', mod_digitize_elName, "+i+");\" id=\""+buttonDig_id[i]+"\" title=\""+buttonDig_title_off[i]+"\" src=\""+buttonDig_imgdir+buttonDig_src[i]+"\"></div>";
+			parent.writeTag(mod_digitize_elName,"div_" + buttonDig_id[i],tagContent);
+		}
+	}
+}
+
+function initDigButton(ind, pos){
+	parent.mb_button[ind] = document.getElementById(buttonDig_id[pos]);
+	parent.mb_button[ind].img_over = buttonDig_imgdir + buttonDig_src[pos].replace(/_off/,"_over");
+	parent.mb_button[ind].img_on = buttonDig_imgdir + buttonDig_src[pos].replace(/_off/,"_on");
+	parent.mb_button[ind].img_off = buttonDig_imgdir + buttonDig_src[pos];
+	parent.mb_button[ind].title_on = buttonDig_title_on[pos];
+	parent.mb_button[ind].title_off = buttonDig_title_off[pos];
+	parent.mb_button[ind].status = 0;
+	parent.mb_button[ind].elName = buttonDig_id[pos];
+	parent.mb_button[ind].fName = "";
+	parent.mb_button[ind].go = new Function ("digitizeEnable(parent.mb_button["+ind+"])");
+	parent.mb_button[ind].stop = new Function ("digitizeDisable(parent.mb_button["+ind+"])");
+}	
+
+function digitizeEnable(obj) {
+	if (obj.id == button_move || obj.id == button_insert || obj.id == button_delete) {
+		mod_digitizeEvent = obj.id;
+		executeDigitizePreFunctions();
+	}
+	else if (obj.id == button_point || obj.id == button_line || obj.id == button_polygon || obj.id == button_clear || obj.id == button_combine){
+		var el = parent.frames[mod_digitize_target].document;
+		el.onmousemove = mod_digitize_go;
+
+		mod_digitizeEvent = obj.id;
+
+		if (mod_digitizeEvent == button_point || mod_digitizeEvent == button_line || mod_digitizeEvent == button_polygon || mod_digitizeEvent == button_insert ) {
+			s.store(d);
+		}
+
+		executeDigitizePreFunctions();
+		obj.title = obj.title_on;
+		if (obj.id == button_point) {
+			if (d.count() > 0 && d.get(-1).count() > 0 && !d.get(-1).get(-1).isComplete()) {
+				if (d.get(-1).geomType != parent.geomType.point) {
+					d.close();
+					executeDigitizeSubFunctions();
+				}
+				else {
+					s.add(d.getPoint(-1, -1, 0));
+				}
+			}
+			if (d.count() == 0 || (d.count() > 0 && d.get(-1).count() > 0 && d.get(-1).get(-1).isComplete())) {
+				d.addMember(parent.geomType.point);
+				d.get(-1).addGeometry();
+			}
+			else {
+/*
+//
+// delete existing line or polygon
+//	
+				d.del(-1);
+				d.addMember(parent.geomType.point);
+				d.get(-1).addGeometry();
+*/
+			}
+		}
+		else if (obj.id == button_polygon) {
+			if (d.count() > 0 && d.get(-1).count() > 0 && !d.get(-1).get(-1).isComplete()) {
+				if (d.get(-1).geomType != parent.geomType.polygon) {
+					d.close();
+					executeDigitizeSubFunctions();
+				}
+				else {
+					s.add(d.getPoint(-1, -1, 0));
+				}
+			}
+			if (d.count() == 0 || (d.count() > 0 && d.get(-1).count() > 0 && d.get(-1).get(-1).isComplete())) {
+				// new geometry
+				d.addMember(parent.geomType.polygon);
+				d.get(-1).addGeometry();
+			}
+			else {
+/*
+//
+// continue a line as a polygon
+//	
+				if (d.get(-1).geomType != parent.geomType.polygon) {
+					var geometryTemplate = parent.cloneObject(d.get(-1));
+					d.del(-1);
+					d.addMember(parent.geomType.polygon);
+					for (var i = 0; i < geometryTemplate.count(); i++) {
+						d.get(-1).addGeometry();
+						for (var j = 0; j < geometryTemplate.get(i).count(); j++) {
+							d.get(-1).get(-1).addPoint(geometryTemplate.get(i).get(j));
+						}
+					}
+				}
+				s.add(d.getPoint(-1, -1, 0));
+*/
+			}
+		}
+		else if (obj.id == button_line) {
+			if (d.count() > 0 && d.get(-1).count() > 0 && !d.get(-1).get(-1).isComplete()) {
+				if (d.get(-1).geomType != parent.geomType.line) {
+					d.close();
+					executeDigitizeSubFunctions();
+				}
+				else {
+					s.add(d.getPoint(-1, -1, 0));
+				}
+			}
+			if (d.count() == 0 || (d.count() > 0 && d.get(-1).count() > 0 && d.get(-1).get(-1).isComplete())) {
+				d.addMember(parent.geomType.line);
+				d.get(-1).addGeometry();
+			}
+			else {
+/*
+//
+// continue a polygon as a line
+//	
+				if (d.get(-1).geomType != parent.geomType.line) {
+					var geometryTemplate = parent.cloneObject(d.get(-1));
+					d.del(-1);
+					d.addMember(parent.geomType.line);
+					for (var i = 0; i < geometryTemplate.count(); i++) {
+						d.get(-1).addGeometry();
+						for (var j = 0; j < geometryTemplate.get(i).count(); j++) {
+							d.get(-1).get(-1).addPoint(geometryTemplate.get(i).get(j));
+						}
+					}
+				}
+*/
+			}
+		}
+		else if (obj.id == button_clear) {
+			var clear = confirm(messageConfirmDeleteAllGeomFromList[selectedLanguage]);
+			if (clear) {
+				d = new parent.GeometryArray();
+				parent.mb_disableThisButton(button_clear);
+			}
+		}
+		else if (obj.id == button_combine) {
+//			d.combineToMultiGeometry();
+//			prompt('', d.toJSONString());
+//			parent.mb_ajax_post("../php/jsonTest.php", {json:d.toJSONString()}, function(test, status) {
+//				alert(test);
+//			});
+			parent.mb_disableThisButton(button_combine);
+		}
+	}
+}
+
+function digitizeDisable(obj) {
+	if (obj.id == button_point || obj.id == button_line || obj.id == button_polygon){
+		obj.title = obj.title_off;
+		if (d.get(-1).get(-1).count() == 0) {
+			d.delGeometry(-1,-1);
+		}
+		mod_digitize_timeout();
+		executeDigitizeSubFunctions();
+	}
+	else if (obj.id == button_clear) {
+		mod_digitize_timeout();
+		executeDigitizeSubFunctions();
+	}
+	mod_digitizeEvent = false;
+}
+// --- button handling (end) ----------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------------------------------------
+// --- display (begin) -----------------------------------------------------------------------------------------
+
+function updateExtent() {
+	var anInd = parent.getMapObjIndexByName(mod_digitize_target);
+	var change = false;
+	if (typeof(mod_digitize_width) == 'undefined' || mod_digitize_width != parent.mb_mapObj[anInd].width) {
+		mod_digitize_width = parent.mb_mapObj[anInd].width;
+		change = true;
+	}
+	if (typeof(mod_digitize_height) == 'undefined' || mod_digitize_height != parent.mb_mapObj[anInd].height) {
+		mod_digitize_height = parent.mb_mapObj[anInd].height;
+		change = true;
+	}
+	if (typeof(mod_digitize_epsg) == 'undefined' || mod_digitize_epsg != parent.mb_mapObj[anInd].epsg) {
+		mod_digitize_epsg = parent.mb_mapObj[anInd].epsg;
+		change = true;
+	}
+//	if (change) {
+//		drawDashedLine();
+//	}
+}
+
+function drawDashedLine(){
+	if (!nonTransactionalEditable) {
+		nonTransactionalHighlight.clean();
+	}
+	var smP = "";
+	smP += "<div class='t_img'>";
+	smP += "<img src='"+parent.mb_trans.src+"' width='"+mod_digitize_width+"' height='0'></div>";
+	smP += "<div class='t_img'>";
+	smP += "<img src='"+parent.mb_trans.src+"' width='0' height='"+mod_digitize_height+"'></div>";
+
+	for(var i=0; i<d.count(); i++){
+		if (!nonTransactionalEditable && !isTransactional(d.get(i))) {
+			nonTransactionalHighlight.add(d.get(i), nonTransactionalColor);
+		}
+		else {
+			for(var j=0; j<d.get(i).count(); j++){
+				for(var k = 0; k < d.getGeometry(i,j).count(); k++){
+					var pos = parent.makeRealWorld2mapPos(mod_digitize_target,d.getPoint(i,j,k).x,d.getPoint(i,j,k).y);
+					
+					if (!d.getGeometry(i,j).isComplete() && 
+						( (k == 0 && d.get(i).geomType == parent.geomType.polygon) || (k == d.getGeometry(i,j).count()-1 && d.get(i).geomType == parent.geomType.line))) {
+						smP += "<div class='bp' style='top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;z-index:"+digitizeTransactionalZIndex+";background-color:"+linepointColor+"'";
+					}
+					else {
+						smP += "<div class='bp' style='top:"+(pos[1]-2)+"px;left:"+(pos[0]-2)+"px;z-index:"+digitizeTransactionalZIndex+";'";
+					}
+					if(j==0 && d.get(i).geomType == parent.geomType.polygon && !d.getGeometry(i,j).isComplete()){
+						smP += " title='"+closePolygon_title+"' ";
+					}
+					if(mod_digitizeEvent == button_move || mod_digitizeEvent == button_insert || mod_digitizeEvent == button_delete) {
+						smP += " onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].handleBasepoint(this,"+i+","+j+","+k+")' ;";
+					}
+					smP += "></div>";
+				}
+				var mapObjInd = parent.getMapObjIndexByName(mod_digitize_target);
+				for(var k = 1; k < d.getGeometry(i,j).count(); k++){
+					var p0 = parent.realToMap(mod_digitize_target, d.getPoint(i,j,k));
+					var p1 = parent.realToMap(mod_digitize_target, d.getPoint(i,j,k-1));
+					points = parent.calculateVisibleDash(p0, p1, parent.mb_mapObj[mapObjInd].width, parent.mb_mapObj[mapObjInd].height);
+					if (points != false) {
+						smP += evaluateDashes(points[0], points[1], i, j, k);
+					}
+				}
+			}
+		}
+	}
+	digitizeDivTag.write(smP);
+}
+
+function evaluateDashes(start, end, memberIndex, geomIndex, pointIndex){
+	var str_dashedLine = "";
+	var delta = new parent.Point(end.x - start.x, end.y - start.y);
+	 
+	var vecLength = start.dist(end);
+	var n = Math.round(vecLength/dotDistance);
+	var step = new parent.Point(delta.x/n, delta.y/n);
+	for(var i=1; i<n; i++){
+		var x = Math.round(start.x + i * step.x) - 2;
+		var y = Math.round(start.y + i * step.y) - 2;
+		if(x >= 0 && x <= mod_digitize_width && y >= 0 && y <= mod_digitize_height){
+			if (memberIndex == d.count()-1 && !d.getGeometry(-1,-1).isComplete()) {
+				str_dashedLine += "<div class='lp' style='top:"+y+"px;left:"+x+"px;z-index:"+digitizeTransactionalZIndex+";background-color:"+linepointColor+"' ";
+			}
+			else {
+				str_dashedLine += "<div class='lp' style='top:"+y+"px;left:"+x+"px;z-index:"+digitizeTransactionalZIndex+";' ";
+			}
+			if(mod_digitizeEvent == button_insert) {
+				str_dashedLine += "onmouseover='parent.window.frames[\""+mod_digitize_elName+"\"].convertLinepointToBasepoint(this,"+memberIndex+","+geomIndex+","+pointIndex+")'";
+			}
+			str_dashedLine += "></div>";
+		}
+	}
+	return str_dashedLine;
+}
+
+function isTransactional(geom) {
+//	alert(typeof(geom.wfs_conf) + " " + geom.wfs_conf + " " + wfsConf.length);
+	if (typeof(geom.wfs_conf) == 'number') {
+		if (geom.wfs_conf >= 0 && geom.wfs_conf < wfsConf.length) {			
+			var isTransactionalGeom = (wfsConf[geom.wfs_conf]['wfs_transaction'] != "" && wfsConf[geom.wfs_conf]['fkey_featuretype_id'] != "");
+			if (isTransactionalGeom) {
+				return true;
+			}
+			else{
+				return false;
+			}
+		}
+	}
+	else if (typeof(geom.wfs_conf) == 'undefined') {
+		return true;
+	}
+}
+
+function isValidWfsConfIndex (wfsConf, wfsConfIndex) {
+	return (typeof(wfsConfIndex) == "number" && wfsConfIndex >=0 && wfsConfIndex < wfsConf.length);
+}
+
+function getName (geom) {
+	wfsConfId = geom.wfs_conf;
+	wfsConf = parent.get_complete_wfs_conf();
+	if (isValidWfsConfIndex(wfsConf, wfsConfId)) {
+		var resultName = "";
+		for (var i = 0 ; i < wfsConf[wfsConfId]['element'].length ; i++) {
+			if (wfsConf[wfsConfId]['element'][i]['f_show'] == 1) {
+				resultName += geom.e.getElementValueByName(wfsConf[wfsConfId]['element'][i]['element_name']) + " ";
+			}
+		}
+		if (resultName == "") {
+			resultName = wfsConf[wfsConfId]['g_label'];
+		}
+		return resultName;
+	}
+	else {
+		return digitizeDefaultGeometryName[selectedLanguage];
+	}
+}
+
+function updateListOfGeometries(){
+	var listOfGeom = "<table style='position:absolute; top:"+geomList_y+"px; left:"+geomList_x+"px;'>\n";
+	if (d.count() > 0) {
+		wfsConf = parent.get_complete_wfs_conf();
+		for (var i = 0 ; i < d.count(); i ++) {
+
+			if (d.get(i).get(-1).isComplete() && (nonTransactionalEditable || isTransactional(d.get(i)))) {
+	
+				listOfGeom += "\t<tr>\n\t\t<td>\n";
+				if (wfsExistsForGeom(d.get(i), wfsConf)) {
+					listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_wfs_src+"' title='"+buttonDig_wfs_title[selectedLanguage]+"' onclick='showWfs("+i+")'>\n";
+				}
+				listOfGeom += "\t\t</td>\n\t\t<td>\n";
+				listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_remove_src+"' title='"+buttonDig_remove_title[selectedLanguage]+"' onclick='parent.mb_disableThisButton(mod_digitizeEvent);d.del("+i+");executeDigitizeSubFunctions();'>\n";
+				listOfGeom += "\t\t</td>\n\t\t<td>\n";
+	
+				if (isValidWfsConfIndex(wfsConf, d.get(i).wfs_conf)) {
+					listOfGeom += "\t\t\t<img src = '"+buttonDig_imgdir+buttonDig_removeDb_src+"' title='"+buttonDig_removeDb_title[selectedLanguage]+"' onclick=\"var deltrans = confirm('"+messageConfirmDeleteGeomFromDb[selectedLanguage]+"');if (deltrans) dbGeom('delete', "+i+")\">\n";
+				}
+				listOfGeom += "\t\t</td>\n\t\t<td style = 'color:blue;font-size:12px'>\n";
+				listOfGeom += "\t\t\t<div onmouseover='parent.mb_wfs_perform(\"over\",d.get("+i+"));' ";
+				listOfGeom += " onmouseout='parent.mb_wfs_perform(\"out\",d.get("+i+"))' ";
+				listOfGeom += " onclick='parent.mb_wfs_perform(\"click\",d.get("+i+"));' ";
+				var geomName = getName(d.get(i)); 
+				if (d.get(i).geomType == parent.geomType.polygon) {geomName += " ("+messageDescriptionPolygon[selectedLanguage]+")";}
+				else if (d.get(i).geomType == parent.geomType.line) {geomName += " ("+messageDescriptionLine[selectedLanguage]+")";}
+				else if (d.get(i).geomType == parent.geomType.point) {geomName += " ("+messageDescriptionPoint[selectedLanguage]+")";}
+				
+				listOfGeom += ">" + geomName +"</div>\t\t</td>\n\t</tr>\n";
+			}
+		}
+	}
+	listOfGeom += "</table>\n";
+	parent.writeTag(mod_digitize_elName,"listOfGeometries",listOfGeom);
+}
+// --- display (end) -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------------------------------------------
+// --- wfs window (begin) -----------------------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------------------------------------
+// --- wfs window form check (begin) -----------------------------------------------------------------------------------------
+
+function formCorrect(doc, formId) {
+	var isCorrect = true;
+	var errorMessage = "";
+	var result;
+	var form = doc.getElementById(formId);
+	
+	result = mandatoryFieldsNotEmpty(doc, form);
+	isCorrect = isCorrect && result.isCorrect;
+	errorMessage += result.errorMessage;
+
+	result = validBoxEntrySelected(form);
+	isCorrect = isCorrect && result.isCorrect;
+	errorMessage += result.errorMessage;
+
+	result = dataTypeIsCorrect(doc, form);
+	isCorrect = isCorrect && result.isCorrect;
+	errorMessage += result.errorMessage;
+
+	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
+}
+
+function validBoxEntrySelected(form){
+	var isCorrect = true;
+	var errorMessage = "";
+	for (var i = 0; i < form.childNodes.length && isCorrect; i++) {
+		if (form.childNodes[i].nodeName.toUpperCase() == "SELECT") {
+			if (parseInt(form.childNodes[i].selectedIndex) == 0) {
+				return {"isCorrect":false, "errorMessage":errorMessage};
+			}
+		}
+		else if (form.childNodes[i].hasChildNodes()) {
+			isCorrect = validBoxEntrySelected(form.childNodes[i]).isCorrect;
+		}
+	}
+	if (!isCorrect) {
+		errorMessage = messageSelectAnOption[selectedLanguage] + "\n";
+	}
+	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
+}
+
+function mandatoryFieldsNotEmpty(doc, node){
+	var isCorrect = true;
+	var errorMessage = "";
+	
+	nodeArray = doc.getElementsByName("mandatory");
+	for (var i = 0; i < nodeArray.length && isCorrect; i++) {
+		if (nodeArray[i].nodeName.toUpperCase() == "INPUT" && nodeArray[i].type == "hidden" && nodeArray[i].id.substr(0,10) == "mandatory_") {
+			var nodeId = nodeArray[i].id.substr(10);
+			if (nodeArray[i].value == "true") {
+				if (doc.getElementById(nodeId).value == "") {
+					isCorrect = false;
+					errorMessage += "'"+ doc.getElementById(nodeId).name +"': "+ messageErrorFieldIsEmpty[selectedLanguage] +"\n";
+				}
+			}
+		}
+	}
+	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
+}
+
+function isInteger(str) {
+	if (str.match(/^\d*$/)) {
+		return true;
+	}
+	return false;
+}
+
+function isFloat(str) {
+	if (isInteger(str)) {
+		return true;
+	}
+	if (str.match(/^\d+\.\d+$/)) {
+		return true;
+	}
+	return false;
+}
+
+function replaceCommaByDecimalPoint(str) {
+	var patternString = ",";
+	var pattern = new RegExp(patternString);
+	while (str.match(pattern)) {
+		str = str.replace(pattern, ".");
+	}
+	return str;
+}
+
+function dataTypeIsCorrect(doc, node){
+	var isCorrect = true;
+	var errorMessage = "";
+	
+	nodeArray = doc.getElementsByName("datatype");
+	for (var i = 0; i < nodeArray.length ; i++) {
+		if (nodeArray[i].nodeName.toUpperCase() == "INPUT" && nodeArray[i].type == "hidden" && nodeArray[i].id.substr(0,9) == "datatype_") {
+			var nodeId = nodeArray[i].id.substr(9);
+			var nodeValue = doc.getElementById(nodeId).value;
+			
+			if (nodeArray[i].value == "int") {
+				if (!isInteger(nodeValue)) {
+					isCorrect = false;
+					errorMessage += "'"+doc.getElementById(nodeId).name+"': "+ messageErrorNotAnInteger[selectedLanguage] + "\n";
+				}
+			}
+			else if (nodeArray[i].value == "double") {
+				nodeValue = replaceCommaByDecimalPoint(nodeValue);
+				if (!isFloat(nodeValue)) {
+					isCorrect = false;
+					errorMessage += "'"+doc.getElementById(nodeId).name+"': "+ messageErrorNotAFloat[selectedLanguage] + "\n";
+				}
+				else {
+					doc.getElementById(nodeId).value = nodeValue;
+				}
+			}
+		}
+	}
+	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
+}
+// --- wfs window form check (end) -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------------------------
+
+function getAvailableWfsForGeom(geom, wfsConf) {
+	var wfsConfIndices = [];
+	
+	for (var attr in wfsConf) {
+		var isTrans = (wfsConf[attr]['wfs_transaction'] != "");
+		if (!isTrans) {
+			continue;
+		}
+		if (isValidWfsConfIndex(wfsConf, parseInt(geom.wfs_conf))) {
+			
+			if (parseInt(geom.wfs_conf) == parseInt(attr)) {
+				wfsConfIndices.push(attr);
+			}
+		}
+		else {
+			for (var elementIndex = 0; elementIndex < wfsConf[attr]['element'].length ; elementIndex++) {
+				var isGeomColumn = (parseInt(wfsConf[attr]['element'][elementIndex]['f_geom']) == 1); 
+				if (isGeomColumn) {
+					var isMultiPolygon = (geom.geomType == parent.geomType.polygon && wfsConf[attr]['element'][elementIndex]['element_type'] == 'MultiPolygonPropertyType');
+					var isPolygon = (geom.geomType == parent.geomType.polygon && geom.count() == 1 && wfsConf[attr]['element'][elementIndex]['element_type'] == 'PolygonPropertyType');
+					var isMultiLine = (geom.geomType == parent.geomType.line && wfsConf[attr]['element'][elementIndex]['element_type'] == 'MultiLineStringPropertyType');
+					var isLine = (geom.geomType == parent.geomType.line && geom.count() == 1 && wfsConf[attr]['element'][elementIndex]['element_type'] == 'LineStringPropertyType');
+					var isPoint = (geom.geomType == parent.geomType.point && wfsConf[attr]['element'][elementIndex]['element_type'] == 'PointPropertyType');
+//					alert(isMultiPolygon + " " + isPolygon + " " + isMultiLine + " " + isLine + " " + isPoint);
+					if (isMultiPolygon || isPolygon || isMultiLine || isLine || isPoint || wfsConf[attr]['element'][elementIndex]['element_type'] == 'GeometryAssociationType') {
+						
+						wfsConfIndices.push(attr);
+					}
+				}
+			}
+		}	
+	}
+	return wfsConfIndices;
+}
+function wfsExistsForGeom(geom, wfsConf) {
+	wfsConfIndices = getAvailableWfsForGeom(geom, wfsConf);
+//	alert(wfsConfIndices.join(","));
+	if (wfsConfIndices.length > 0) {
+		return true;
+	}
+	return false;
+}
+
+
+//
+// this method opens a new window and displays the attributes in wfs_conf
+//
+function showWfs(geometryIndex) {
+	wfsConf = parent.get_complete_wfs_conf();
+
+	wfsWindow = open("", "wfsattributes", "width="+wfsWindowWidth+", height="+wfsWindowHeight+", resizable, dependent=yes, scrollbars=yes");
+	wfsWindow.document.open("text/html");
+
+	var str = "";
+	var strStyle = "";
+	var defaultIndex = -1;
+
+	str += "<form id='wfs'>\n";
+
+	//
+	// 1. add select box 
+	//
+
+	var onChangeText = "document.getElementById('elementForm').innerHTML = ";
+	onChangeText += "window.opener.buildElementForm(this.value , " + geometryIndex + ");";
+	onChangeText += "window.opener.setWfsWindowStyle(this.value);";
+	
+	str += "\t<select name='wfs' size='" + wfsConf.length + "'";
+	str += " onChange=\""+ onChangeText +"\"";
+	str += ">\n\t\t";
+
+	var wfsConfIndices = getAvailableWfsForGeom(d.get(geometryIndex), wfsConf);
+//	alert(wfsConfIndices.join(","));
+	var selected = false;
+	for (var i = 0; i < wfsConfIndices.length ; i++) {
+		str += "<option value='" + wfsConfIndices[i] + "'";
+		if (!selected) {
+			str += " selected";
+			selected = true;
+			defaultIndex = parseInt(wfsConfIndices[i]);
+		}
+		str += ">" + wfsConf[wfsConfIndices[i]]['wfs_conf_abstract'];
+		str += "</option>\n\t\t";
+	}
+
+	
+	str += "</select>\n\t\t</form>\n\t";
+	str += "<div id='elementForm'>\n</div>";
+	
+	if (defaultIndex != -1) {
+		wfsWindow.document.writeln("<html><head><style type='text/css'>"+wfsConf[defaultIndex]['g_style']+"</style></head><body></body></html>");
+		wfsWindow.document.write(str);
+		wfsWindow.document.close();
+		wfsWindow.document.getElementById("elementForm").innerHTML = buildElementForm(defaultIndex, geometryIndex);
+	}
+	else {
+		wfsWindow.document.writeln("<html><head><style type='text/css'></style></head><body></body></html>");
+		wfsWindow.document.write(str);
+		wfsWindow.document.close();
+	}
+}
+
+function setWfsWindowStyle(wfsConfIndex) {
+	wfsWindow.document.getElementsByTagName("style")[0].innerHTML = wfsConf[wfsConfIndex]['g_style'];
+}
+
+// returns a form with the elements of a selected wfs
+// (if the original wfs is the selected wfs, the values are set too)
+function buildElementForm(wfsConfIndex, memberIndex){
+	var featureTypeMismatch = false;
+	if (parseInt(d.get(memberIndex).wfs_conf) != parseInt(wfsConfIndex)) {featureTypeMismatch = true;}
+	var str = "";
+	var hasGeometryColumn = false;
+	var featureTypeArray = wfsConf[wfsConfIndex];
+	var memberElements;
+	var fid = false;
+
+	if (!featureTypeMismatch) {
+		memberElements = d.get(memberIndex).e;
+		fid = memberElements.getElementValueByName('fid');
+	}
+	
+	if (typeof(featureTypeArray["element"]) !== "undefined") {
+
+		str += "<form id='"+featureTypeElementFormId+"'>\n\t<table>\n";
+		featureTypeElementArray = featureTypeArray["element"];
+		
+		//
+		// 2. add rows to form 
+		//
+		for (var i = 0 ; i < featureTypeElementArray.length ; i ++) {
+			var featureTypeElement = featureTypeElementArray[i];
+
+			var elementName = featureTypeElement['element_name'];
+			var elementType = featureTypeElement['element_type'];
+			var isEditable = (parseInt(featureTypeElement['f_edit']) == 1); 
+			var isMandatory = (parseInt(featureTypeElement['f_mandatory']) == 1); 
+			var isGeomColumn = (parseInt(featureTypeElement['f_geom']) == 1); 
+
+			var elementLabelExists = (featureTypeElement['f_label'] != "");
+			var elementLabel = ""; 
+			if (elementLabelExists) {
+				elementLabel = featureTypeElement['f_label'];
+			}
+			var elementLabelStyle = featureTypeElement['f_label_id'];
+
+			if (!isGeomColumn) {
+				if (isEditable) {
+					str += "\t\t<tr>\n";
+					str += "\t\t\t<td>\n\t\t\t\t<div class = '"+elementLabelStyle+"''>" + elementLabel + "</div>\n\t\t\t</td>\n";
+					str += "\t\t\t<td>\n";
+
+					var elementValue = "";
+					if (!featureTypeMismatch) {
+						for (var j = 0 ; j < memberElements.count() ; j ++) {
+							if (memberElements.getName(j) == featureTypeElement['element_name']) {
+								elementValue = memberElements.getValue(j);
+							}
+						}
+					}
+					var formElementHtml = featureTypeElement['f_form_element_html']; 
+					if (!formElementHtml) {
+						str += "\t\t\t\t<input id = 'datatype_" + elementName + "' name='datatype' type='hidden' value = '" + elementType + "'>\n";
+						str += "\t\t\t\t<input id = 'mandatory_" + elementName + "' name='mandatory' type='hidden' value = '" + isMandatory + "'>\n";
+						str += "\t\t\t\t<input id = '" + elementName + "' name='" + elementLabel + "' type='text' class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
+						}
+						else {
+							while (formElementHtml.match(/\\/)) {
+								formElementHtml = formElementHtml.replace(/\\/, "");
+							} 
+//							alert(formElementHtml);
+							// preselect the correct entry of the box
+							var patternString = "option value='"+elementValue+"'";
+							var pattern = new RegExp(patternString);
+							formElementHtml = formElementHtml.replace(pattern, patternString+" selected");
+//							alert(formElementHtml);
+							str += formElementHtml;
+	
+						}
+						str += "\t\t\t</td>\n\t\t</tr>\n";
+				}
+			}
+			else {
+				hasGeometryColumn = true;
+			}
+		}
+
+		//
+		// 3. add buttons "save", "update", "delete"
+		//
+		str += "</table><table>";
+		var isTransactional = (featureTypeArray['wfs_transaction']); 
+		if (isTransactional) {
+			str += "\t\t<tr>\n";
+
+			var options = ["save", "update", "delete", "abort"];
+			for (var i = 0 ; i < options.length ; i++) {
+				var onClickText = "this.disabled=true;var result = window.opener.formCorrect(document, '"+featureTypeElementFormId+"');";
+				onClickText += 	"if (result.isCorrect) {";
+				onClickText += 		"window.opener.dbGeom('"+options[i]+"', "+memberIndex+"); ";
+//				onClickText +=      "window.close();";
+				onClickText += 	"}";
+				onClickText += 	"else {";
+				onClickText += 		"alert(result.errorMessage);this.disabled=false;"
+				onClickText += 	"}";
+				
+				if (options[i] == "save" && hasGeometryColumn && (!fid || showSaveButtonForExistingGeometries)) {
+					str += "\t\t\t<td><input type='button' name='saveButton' value='"+buttonLabelSaveGeometry[selectedLanguage]+"' onclick=\""+onClickText+"\" /></td>\n";
+				}
+				
+				if (!featureTypeMismatch && fid) {
+					if (options[i] == "update" && hasGeometryColumn) {
+						str += "\t\t\t<td><input type='button' name='updateButton' value='"+buttonLabelUpdateGeometry[selectedLanguage]+"' onclick=\""+onClickText+"\"/></td>\n";
+					}
+					if (options[i] == "delete"){ 
+						var deleteOnClickText = "var deltrans = confirm('"+messageConfirmDeleteGeomFromDb[selectedLanguage]+"');";
+						deleteOnClickText += "if (deltrans){";
+						deleteOnClickText += onClickText + "}";
+						str += "\t\t\t<td><input type='button' name='deleteButton' value='"+buttonLabelDeleteGeometry[selectedLanguage]+"' onclick=\""+deleteOnClickText+"\"/></td>\n";
+					}
+				}
+				if (options[i] == "abort") {
+					str += "\t\t\t<td><input type='button' name='abortButton' value='"+buttonLabelAbort[selectedLanguage]+"' onclick=\"window.close();\" /></td>\n";
+				}
+			}
+			str += "\t\t</tr>\n";
+		}
+		str += "\t</table>\n";
+		str += "<input type='hidden' id='fid' value='"+fid+"'>";
+//			str += "<input type='text' name='mb_wfs_conf'>";
+		str += "</form>\n";
+	}
+	return str;
+}
+
+function dbGeom(type,m) {
+	if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
+		d.get(m).wfs_conf = parseInt(wfsWindow.document.forms[0].wfs.options[wfsWindow.document.forms[0].wfs.selectedIndex].value);
+		d.get(m).e = new parent.Wfs_element();
+	}
+	else {
+		wfsConf = parent.get_complete_wfs_conf();
+	}
+	var myconf = wfsConf[d.get(m).wfs_conf];
+	
+	var mapObjInd = parent.getMapObjIndexByName(mod_digitize_target);
+
+	if (myconf['featuretype_srs'] != parent.mb_mapObj[mapObjInd].epsg) {
+		alert(errorMessageEpsgMismatch[selectedLanguage] + parent.mb_mapObj[mapObjInd].epsg + " / "+ myconf['featuretype_srs']);
+	}
+	else {
+		var fid = false;
+		var errorMessage = "";
+		if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
+			myform = wfsWindow.document.getElementById(featureTypeElementFormId);
+		
+			for (var i=0; i<myform.length; i++){
+				if (myform.elements[i].id == "fid") {
+					fid = myform.elements[i].value;
+					d.get(m).e.setElement('fid', fid);
+				}
+				else if (myform.elements[i].type == 'text' ){
+					if (myform.elements[i].id) {
+						d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].value);
+					}
+					else {
+						errorMessage = messageErrorFormEvaluation[selectedLanguage];
+					}
+				}
+				// selectbox
+				else if (typeof(myform.elements[i].selectedIndex) == 'number') {
+					if (myform.elements[i].id) {
+						d.get(m).e.setElement(myform.elements[i].id, myform.elements[i].options[myform.elements[i].selectedIndex].value);
+					}
+					else {
+						errorMessage = messageErrorFormEvaluation[selectedLanguage];
+					}
+				}
+			}
+		}
+		else {
+			fid = d.get(m).e.getElementValueByName('fid');
+		}
+		str = parent.get_wfs_str(myconf, d, m, type, fid);
+		
+		parent.mb_ajax_post("../extensions/geom2wfst.php", {'filter':str,'url':myconf['wfs_transaction']}, function(json,status){
+			var result = eval('('+json+')');
+			var response = result.response;
+			var fid = result.fid;
+			wfsSubWrite(m, type, status, response, fid);
+		});
+	}
+}
+
+function wfsSubWrite(m, type, status, response, fid) {
+	if (type == 'save' && fid) {
+		d.get(m).e.setElement("fid", fid);
+	}
+	if (type == 'delete') {
+		parent.mb_disableThisButton(mod_digitizeEvent);
+		d.del(m);
+	}
+	parent.mb_execWfsWriteSubFunctions();
+	executeDigitizeSubFunctions();
+	
+	if (status == "success" && response == "success") {
+		var wfsWriteMessage = messageSuccessWfsWrite[selectedLanguage];
+	}
+	else {
+		var wfsWriteMessage = messageErrorWfsWrite[selectedLanguage];
+	} 
+
+	if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
+		wfsWindow.alert(wfsWriteMessage);
+		window.setTimeout("wfsWindow.close()",0);
+	}
+	else {
+		alert(wfsWriteMessage);
+	}
+}
+// --- wfs window (begin) -----------------------------------------------------------------------------------------
+// -----------------------------------------------------------------------------------------------------------
+
+	</script>
+	</head>
+	<body onload="registerFunctions();displayButtons();">
+		<table cellpadding='0' cellspacing='0' align = center><tr><td><div id='digButtons'></div></td></tr></table>
+		<div id = 'listOfGeometries'></div>
+	</body>
 </html>
\ No newline at end of file

Modified: tags/2.4.4_rc1/http/javascripts/mod_savewmc.php
===================================================================
--- tags/2.4.3/http/javascripts/mod_savewmc.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/javascripts/mod_savewmc.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -1,59 +1,68 @@
-<?php
-# $Id: mod_savewmc.php 264 2006-05-12 11:07:19Z vera_schulze 
-# http://www.mapbender.org/index.php/mod_savewmc.php
-# Copyright (C) 2002 CCGIS
-#
-# 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; either version 2, or (at your option)
-# any later version.
-#
-# 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.
-
-require_once("../../conf/mapbender.conf");
-
-$gui_id = $_REQUEST["gui_id"];
-
-include("../include/dyn_js.php");
-
-echo "mod_savewmc_target = '".$e_target."';";
-?>
-function setOnUnload() {
-	document.getElementsByTagName('body')[0].setAttribute("onUnload", "mod_savewmc('session');");
-}
-
-try {if (saveInSession) {}}catch(e) {saveInSession = 0;}
-
-if (saveInSession == '1') {
-	mb_registerInitFunctions('setOnUnload()');
-}
-
-var mod_savewmc_img = new Image(); mod_savewmc_img.src = "<?php  echo $e_src;  ?>";
-//var mod_savewmc_img_over = new Image(); mod_savewmc_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
-
-
-function mod_savewmc(title){
-	
-	var ind = getMapObjIndexByName(mod_savewmc_target);
-	var session = 0;
-	var generalTitle = title;
-
-	if (generalTitle) {
-		if (generalTitle == 'session') {
-			session = 1;
-		}
-	}
-	else {
-		generalTitle = prompt("Save WMC as...");
-	}
-	mb_ajax_post("../php/mod_insertWmcIntoDb.php", {"saveInSession":session, "generalTitle":generalTitle, "mapObject":mb_mapObj[ind].toJSONString()}, function (result, status) {
-		alert(result);
-	});
+<?php
+# $Id: mod_savewmc.php 264 2006-05-12 11:07:19Z vera_schulze 
+# http://www.mapbender.org/index.php/mod_savewmc.php
+# Copyright (C) 2002 CCGIS
+#
+# 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; either version 2, or (at your option)
+# any later version.
+#
+# 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.
+
+require_once("../../conf/mapbender.conf");
+
+$gui_id = $_REQUEST["gui_id"];
+
+include("../include/dyn_js.php");
+
+echo "mod_savewmc_target = '".$e_target."';";
+?>
+function setOnUnload() {
+	if (ie) {
+		document.getElementsByTagName('body')[0].onunload = function() {var x = new Function ("", "mod_savewmc_session()"); x(); };
+	}
+	else {
+		document.getElementsByTagName('body')[0].setAttribute("onUnload", "mod_savewmc_session();");
+	}
+}
+
+try {if (saveInSession) {}}catch(e) {saveInSession = 0;}
+
+if (saveInSession == 1) {
+	mb_registerInitFunctions('setOnUnload()');
+}
+
+var mod_savewmc_img = new Image(); mod_savewmc_img.src = "<?php  echo $e_src;  ?>";
+//var mod_savewmc_img_over = new Image(); mod_savewmc_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
+
+function mod_savewmc_session(){
+	sendMapDataToServer("session", function(result, status) {});
+}
+
+function mod_savewmc(title){
+	var generalTitle = title ? title : prompt("Save WMC as...");
+	if (generalTitle != "" && generalTitle != null) {
+		sendMapDataToServer(generalTitle, function(result, status) {alert(status + ": " + result);});
+	}
+}
+
+function sendMapDataToServer(generalTitle, callbackFunction) {
+	var user = "<?php echo $_SESSION["mb_user_id"]; ?>";
+	var ind = getMapObjIndexByName(mod_savewmc_target);
+	
+	var	extensionDataString = "";
+	if (currentWmcExtensionData != null) {
+		extensionDataString = currentWmcExtensionData.toJSONString();
+	}
+
+	window.frames['ajax'].$.ajaxSetup({async:false}); //TODO: find out why async doesn't work onunload
+	window.frames['ajax'].$.post("../php/mod_insertWmcIntoDb.php", {"saveInSession":saveInSession, "generalTitle":generalTitle, "extensionData":extensionDataString, "mapObject":mb_mapObj[ind].toJSONString()}, callbackFunction);
 }
\ No newline at end of file

Modified: tags/2.4.4_rc1/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- tags/2.4.3/http/javascripts/mod_wfs_SpatialRequest.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/javascripts/mod_wfs_SpatialRequest.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -1,478 +1,478 @@
-<?php
-#$Id: mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
-# Copyright (C) 2002 CCGIS 
-#
-# 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; either version 2, or (at your option)
-# any later version.
-#
-# 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.
-
-session_start();
-import_request_variables("PG");
-require_once("../php/mb_validateSession.php");
-require_once("../../conf/mapbender.conf");
-require_once("../../conf/wfs_default.conf");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
-$gui_id = $_REQUEST["gui_id"];
-$e_id_css = "setSpatialRequest";
-
-$wfs_conf_filename = "wfs_default.conf";
-include '../include/dyn_php.php';
-include("../../conf/" . $wfs_conf_filename);
-
-include '../include/dyn_js.php';
-$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'setSpatialRequest' AND fkey_gui_id = '".$gui_id."'";
-$res = db_query($sql);
-$cnt = 0;
-while($row = db_fetch_array($res)){ 
-   $e_src = $row["e_src"];
-   $e_target = $row["e_target"];
-   $cnt++;
-}
-if($cnt > 1){ echo "alert('setExtRequest: ID not unique!');\n";}
-echo "var mod_wfs_spatialRequest_target = '".$e_target."';\n";
-?>
-
-var wfsAreaType_point = "point";
-var wfsAreaType_polygon = "polygon";
-var wfsAreaType_rectangle = "rectangle";
-var wfsAreaType_extent = "extent";
-var wfsAreaType_current = "";
-
-var mod_wfs_spatialRequest_frameName = "";
-var mod_wfs_spatialRequest_epsg;
-var mod_wfs_spatialRequest_width;
-var mod_wfs_spatialRequest_height;
-
-var mod_wfs_spatialRequest_bg = "";
-var mod_wfs_spatialRequest_pgsql = true;
-var mod_wfs_spatialRequest_win = null;
-var mod_wfs_spatialRequest_thema = false;
-
-var button_point = "point";
-var button_polygon = "polygon";
-var button_rectangle = "rectangle";
-var button_extent = "extent";
-var button_dialogue = "dialogue";
-var mb_wfs_tolerance = 8;
-
-var activeButton = null;
-var mod_wfs_spatialRequest_geometry = null;
-var mod_wfs_spatialRequestSubFunctions = [];
-
-
-// ------------------------------------------------------------------------------------------
-// ------------ button handling -------------------------------------------------------------
-
-function displayButtons() {
-	for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
-		if (parseInt(buttonWfs_on[i])==1) {
-			document.write("<div id='div_"+buttonWfs_id[i]+"' style='position:absolute; top:"+buttonWfs_y[i]+"; left:"+buttonWfs_x[i]+"; z-index:"+buttonWfs_zIndex+"'><img name=\""+buttonWfs_id[i]+"\" onmouseover=\"mb_regButton_frame('initWfsButton', null, "+i+");\" id=\""+buttonWfs_id[i]+"\" title=\""+buttonWfs_title_off[i]+"\" src=\""+buttonWfs_imgdir+buttonWfs_src[i]+"\"></div>");
-		}
-	}
-}
-
-function initWfsButton(ind, pos) {
-	mb_button[ind] = document.getElementById(buttonWfs_id[pos]);
-	mb_button[ind].img_over = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_over");
-	mb_button[ind].img_on = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_on");
-	mb_button[ind].img_off = buttonWfs_imgdir + buttonWfs_src[pos];
-	mb_button[ind].status = 0;
-	mb_button[ind].elName = buttonWfs_id[pos];
-	mb_button[ind].fName = "";
-	mb_button[ind].go = new Function ("wfsEnable(mb_button["+ind+"], " + pos + ")");
-	mb_button[ind].stop = new Function ("wfsDisable(mb_button["+ind+"], " + pos + ")");
-	var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
-	mod_wfs_spatialRequest_width = mb_mapObj[ind].width;
-	mod_wfs_spatialRequest_height = mb_mapObj[ind].height;
-	mod_wfs_spatialRequest_epsg = mb_mapObj[ind].epsg;
-	mb_registerSubFunctions("drawDashedLineExt()");
-	mb_registerPanSubElement("measuring");
-}	
-
-function wfsEnable(obj) {
-	if (obj.id == button_point) {
-		if (activeButton == null) {
-			activeButton = obj;
-		}
-		mod_wfs_spatialRequest_geometry = new Geometry(geomType.point);
-		wfsAreaType_current = wfsAreaType_point;
-		mod_wfs_spatialRequest_digitize_go(geomType.point);		
-	}
-	if (obj.id == button_polygon) {
-		if (activeButton == null) {
-			activeButton = obj;
-		}
-		mod_wfs_spatialRequest_geometry = new Geometry(geomType.polygon);
-		wfsAreaType_current = wfsAreaType_polygon;
-		mod_wfs_spatialRequest_digitize_go(geomType.polygon);		
-		var measureSub = "";
-		for(var i=0; i<mod_wfs_spatialRequestSubFunctions.length; i++){
-			measureSub += eval(mod_wfs_spatialRequestSubFunctions[i]);
-		}   
-		writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
-	}
-	else if (obj.id == button_rectangle){
-		if (activeButton == null) {
-			activeButton = obj;
-		}
-		mod_wfs_spatialRequest_geometry = new Geometry(geomType.line);
-		wfsAreaType_current = wfsAreaType_rectangle;
-		mod_selAreaExt_click();	
-	}
-	else if (obj.id == button_extent){
-		if (activeButton == null) {
-			activeButton = obj;
-		}
-		mod_wfs_spatialRequest_geometry = new Geometry(geomType.line);
-		wfsAreaType_current = wfsAreaType_extent;
-		var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
-		var p0 = mapToReal(mod_wfs_spatialRequest_target, new Point(0,0));
-		var p1 = mapToReal(mod_wfs_spatialRequest_target, new Point(mb_mapObj[ind].width,mb_mapObj[ind].height)); 
-		mod_wfs_spatialRequest_geometry.addPoint(p0);
-		mod_wfs_spatialRequest_geometry.addPoint(p1);
-		mod_getAreaExt_send();
-	}
-	else if (obj.id == button_dialogue) {
-		activeButton = obj;
-		mod_wfs_SpatialRequest_dialog();
-	}
-}
-
-function wfsDisable(obj) {
-	var el = window.frames[mod_wfs_spatialRequest_target].document; 
-	el.onmousedown = null;
-	el.ondblclick = null;
-	el.onmousemove = null;
-	writeTag(mod_wfs_spatialRequest_target,"measure_display","");
-	writeTag(mod_wfs_spatialRequest_target,"measure_sub","");
-	activeButton = null;
-}
-
-// ------------------------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------------------------
-// -------------------- rectangle -----------------------------------------------------------------
-
-function mod_selAreaExt_click(){
-   var el = window.frames[mod_wfs_spatialRequest_target].document;
-   el.onmouseover = mod_selAreaExt_init;
-   el.onmousedown = mod_box_start;
-   el.onmouseup = mod_selAreaExt_get;
-   el.onmousemove = mod_box_run;
-}
-function mod_selAreaExt_init(e){
-   mb_isBF = mod_wfs_spatialRequest_target;
-   mb_zF = mod_wfs_spatialRequest_target;
-}
-function mod_selAreaExt_get(e){
-	mod_selAreaExt_setValidClipping(mod_box_stop(e));
-	mb_isBF = mod_wfs_spatialRequest_target;
-	mb_zF = mod_wfs_spatialRequest_target;
-}
-function mod_selAreaExt_setValidClipping(coords){
-	if (mod_wfs_spatialRequest_geometry != null) {
-		mod_wfs_spatialRequest_geometry.addPoint(new Point(coords[0],coords[1]));
-		mod_wfs_spatialRequest_geometry.addPoint(new Point(coords[2],coords[3]));
-		
-		if(mod_wfs_spatialRequest_geometry.count() == 2){
-			mod_getAreaExt_send();
-		}
-		else{
-			alert(errorMessageInvalidExtent[selectedLanguage])
-			mb_disableThisButton(activeButton.id);
-		}
-	}
-}
-// ----------------------------------------------------------------------------------------------
-
-
-// ----------------------------------------------------------------------------------------------
-// -------------------- polygon && point --------------------------------------------------------
-
-function mod_wfs_spatialRequest_digitize_go(geomType){
-	if (geomType == geomType.polygon) {
-		mod_wfs_spatialRequest_geometry = new Geometry(geomType.polygon);
-	}
-	s = new Snapping(mod_wfs_spatialRequest_target);
-
-	var el = window.frames[mod_wfs_spatialRequest_target].document;
-	el.onmousedown = mod_wfs_spatialRequest_start;
-	el.onmousemove = mod_wfs_spatialRequest_run;
-	var measureSub = "";
-	for(var i=0; i<mod_wfs_spatialRequestSubFunctions.length; i++){
-		measureSub += eval(mod_wfs_spatialRequestSubFunctions[i]);
-	}   
-	writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
-}
-
-// ---------------------------------------------------------------------------------------------
-
-function mod_wfs_spatialRequest_run(e) {
-	if (mod_wfs_spatialRequest_geometry.count() >= 3) {
-		mb_getMousePos(e,mod_wfs_spatialRequest_target);
-		var pos = new Point(clickX,clickY).round(2);
-		s.check(pos);
-	}
-}
-
-function mod_wfs_spatialRequest_start(e){
-	var realWorldPos;
-	if (s.isSnapped() == true) {
-		realWorldPos = s.getSnappedPoint(); 
-		s.clean();
-	}
-	else {
-		mb_getMousePos(e,mod_wfs_spatialRequest_target);
-		realWorldPos = mapToReal(mod_wfs_spatialRequest_target,new Point(clickX,clickY)).round(2);
-	}
-
-	mod_wfs_spatialRequest_geometry.addPoint(realWorldPos);
-
-	if (mod_wfs_spatialRequest_geometry.count() == 1) {
-		s.add(mod_wfs_spatialRequest_geometry.get(0));
-	}
-	if (s.isSnapped() && mod_wfs_spatialRequest_geometry.count() >= 3 && mod_wfs_spatialRequest_geometry.get(-1).equals(mod_wfs_spatialRequest_geometry.get(0))) {
-		mod_wfs_spatialRequest_geometry.close();
-		mod_getAreaExt_send();
-		return;
-	}
-	
-	if(wfsAreaType_current == wfsAreaType_point){
-		mod_getAreaExt_send();
-		return;
-	}
-	drawDashedLineExt();
-}
-function drawDashedLineExt(){
-	var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mod_wfs_spatialRequest_width+"' height='0'></div>";
-	str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mod_wfs_spatialRequest_height+"'></div>";
-	if (mod_wfs_spatialRequest_geometry != null) {
-		for(var i=0; i<mod_wfs_spatialRequest_geometry.count(); i++){
-			var pos = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(i));
-			str_mPoints += "<div style='font-size:1px;position:absolute;top:"+(pos.y-2)+"px;left:"+(pos.x-2)+"px;width:3px;height:3px;background-color:#ff0000'></div>";
-		}
-		if(mod_wfs_spatialRequest_geometry.count()>1){
-			for(var k=1; k<mod_wfs_spatialRequest_geometry.count(); k++){
-				var pos0 = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(k));
-				var pos1 = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(k-1));
-				str_mPoints += evaluateDashesExt(pos1,pos0,k);
-			}
-		}
-	}
-	writeTag(mod_wfs_spatialRequest_target,"measuring",str_mPoints);
-}
-function evaluateDashesExt(p1,p0,count){
-	var str_dashedLine = "";
-	var d = p0.dist(p1);
-	var n = Math.round(d);
-	var s =  p0.minus(p1).dividedBy(n);
-	for(var i=1; i<n; i++){
-		var currPoint = p1.plus(s.times(i)).minus(new Point(2,2)).round(0); 
-		if(currPoint.x >= 0 && currPoint.x <= mod_wfs_spatialRequest_width && currPoint.y >= 0 && currPoint.y <= mod_wfs_spatialRequest_height){
-			str_dashedLine += "<div style='font-size:1px;position:absolute;top:"+currPoint.y+"px;left:"+currPoint.x+"px;width:3px;height:3px;background-color:#ff0000'></div>";
-		}
-	}
-	return str_dashedLine;
-}
-function mod_wfs_spatialRequest_close(){
-	if(mod_wfs_spatialRequest_geometry.count() < 3){
-		return;
-	}
-	mod_wfs_spatialRequest_geometry.closeGeometry();
-	drawDashedLineExt();
-	mod_getAreaExt_send();
-}
-
-function register_setExtRequestSubFunctions(stringFunction){
-	mod_wfs_spatialRequestSubFunctions[mod_wfs_spatialRequestSubFunctions.length] = stringFunction;
-}
-
-function mod_getAreaExt_send(){	
-	mb_setwfsrequest(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry);
-	mod_wfs_spatialRequest_delete();
-	mb_disableThisButton(activeButton.id);
-	mod_wfs_spatialRequest_geometry = null;
-}
-
-function mod_wfs_spatialRequest_delete(){
-	writeTag(mod_wfs_spatialRequest_target,"measuring","");
-	writeTag(mod_wfs_spatialRequest_target,"measure_display","");
-}
-
-function mod_wfs_spatialRequest_timeout(){
-	var el = window.frames[mod_wfs_spatialRequest_target].document; 
-	el.onmousedown = null;
-	el.ondblclick = null;
-	el.onmousemove = null;
-}
-
-function mod_wfs_spatialRequest_disableTimeout(){
-	var el = window.frames[mod_wfs_spatialRequest_target].document;
-	el.onmousedown = mod_wfs_spatialRequest_start;
-}
-
-
-function isSetWfsResultToDigitize() {
-	if (parseInt(buttonWfs_toDigitize_on)==1) return true;
-	return false;
-}
-
-function mod_wfs_SpatialRequest_dialog(){	
-	if(!mod_wfs_spatialRequest_win || mod_wfs_spatialRequest_win == null || mod_wfs_spatialRequest_win.closed == true){
-		mod_wfs_spatialRequest_win = window.open("","mod_wfs_spatialRequest_win","width=200,height=150,resizable=yes");
-		mod_wfs_spatialRequest_win.document.open("text/html");
-		
-		mod_wfs_spatialRequest_win.document.writeln('<script language="JavaScript" type="text/javascript">');	
-		mod_wfs_spatialRequest_win.document.writeln('function set(obj){');
-			mod_wfs_spatialRequest_win.document.writeln('for(var i=0; i< document.getElementsByName("geom").length; i++){');
-				mod_wfs_spatialRequest_win.document.writeln('if(document.getElementsByName("geom")[i].checked){');
-					mod_wfs_spatialRequest_win.document.writeln('window.opener.mod_setExtRequest_geom = document.getElementsByName("geom")[i].value;'); 
-				mod_wfs_spatialRequest_win.document.writeln('}');
-			mod_wfs_spatialRequest_win.document.writeln('}');
-//			mod_wfs_spatialRequest_win.document.writeln('window.opener.mod_wfs_spatialRequest_geom = obj.value;');
-			mod_wfs_spatialRequest_win.document.writeln('window.opener.wfsEnable(obj);');
-			mod_wfs_spatialRequest_win.document.writeln('window.close();');
-			mod_wfs_spatialRequest_win.document.writeln('return false;	');
-		mod_wfs_spatialRequest_win.document.writeln('}');
-		mod_wfs_spatialRequest_win.document.writeln('</script>');
-		
-		mod_wfs_spatialRequest_win.document.writeln("<form>");
-		mod_wfs_spatialRequest_win.document.writeln("<input id='point' name='geom' type='radio' value='"+button_point+"' onclick='set(this)'> Punkt<br>");
-		mod_wfs_spatialRequest_win.document.writeln("<input id='rectangle' name='geom' type='radio' value='"+button_rectangle+"' onclick='set(this)'> Rechteck<br>");
-		mod_wfs_spatialRequest_win.document.writeln("<input id='polygon' name='geom' type='radio' value='"+button_polygon+"'onclick='set(this)'> Polygon<br>");
-		mod_wfs_spatialRequest_win.document.writeln("<input id='extent' name='geom' type='radio' value='"+button_extent+"'onclick='set(this)'> Extent<br>");
-		var checked = "";
-//		if (mod_wfs_spatialRequest_useExtent) {
-//			checked = " checked";
-//		}		
-		//mod_wfs_spatialRequest_win.document.writeln("<input id='extent' name='geom' type='radio' value='extent' onclick='set(this)' " + checked + "> Extent<br>");
-		mod_wfs_spatialRequest_win.document.writeln("</form>");
-		mod_wfs_spatialRequest_win.document.close();
-	}
-	else{
-		mod_wfs_spatialRequest_win.focus();
-	}	
-}
-
-function mb_setwfsrequest(target,queryGeom){
-	//mb_wfs_reset();
-	var ind = getMapObjIndexByName(target);
-	var w = [];
-	w_ = [];
-	wfs_config = window.frames["wfs_conf"].get_wfs_conf();
-	for (var i=0; i<mb_mapObj[ind].wms.length; i++){
-		for(var ii=0; ii<mb_mapObj[ind].wms[i].objLayer.length; ii++){
-			var o = mb_mapObj[ind].wms[i].objLayer[ii];
-			if(o.gui_layer_wfs_featuretype != '' && o.gui_layer_querylayer == '1'){
-				w[w.length] = o.gui_layer_wfs_featuretype;
-			}	
-		}
-	}
-	for(var i=0; i<w.length; i++){
-		for(var ii=0; ii<wfs_config.length; ii++){			
-			if(wfs_config[ii]['wfs_conf_id'] == w[i]) w_[w_.length] = ii;
-		}
-	}
-	
-	if(queryGeom.geomType==geomType.polygon){
-		for(var i=0; i<w_.length; i++){
-			var url = wfs_config[w_[i]]['wfs_getfeature'];
-			url += "service=wfs&request=getFeature&version=1.0.0";
-			url += "&typename="+ wfs_config[w_[i]]['featuretype_name'];
-			url += "&filter=";
-			var filter = '<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="http://www.opengis.net/gml">';
-			filter += "<Within><ogc:PropertyName>";
-			for(var j=0; j<wfs_config[w_[i]]['element'].length; j++){
-				if(wfs_config[w_[i]]['element'][j]['f_geom'] == 1){
-					filter += wfs_config[w_[i]]['element'][j]['element_name'];
-				}
-			}
-			filter += "</ogc:PropertyName><gml:Polygon srsName=\"EPSG:4326\">";
-			filter += '<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
-			for(var k=0; k<queryGeom.count(); k++){
-				if(k>0)	filter += " ";
-				filter += queryGeom.get(k).x+","+queryGeom.get(k).y;								 
-			}
-			filter += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>';
-			filter += '</gml:Polygon></Within></ogc:Filter>';
-			mb_get_geom(url, filter, i, w_[i]);
-		}
-	}
-	else if(queryGeom.geomType==geomType.line){
-		var rectangle = [];
-		if(queryGeom.geomType == geomType.line){
-			var rectangle = queryGeom.getBBox();
-		}
-		for(var i=0; i<w_.length; i++){
-			var url = wfs_config[w_[i]]['wfs_getfeature'];
-			param = "service=wfs&request=getFeature&version=1.0.0&typename="+ wfs_config[w_[i]]['featuretype_name']+"&filter=";
-			var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>";
-			filter += "<ogc:BBOX><ogc:PropertyName>";
-			for(var j=0; j<wfs_config[w_[i]]['element'].length; j++){
-				if(wfs_config[w_[i]]['element'][j]['f_geom'] == 1){
-					filter += wfs_config[w_[i]]['element'][j]['element_name'];
-				}
-			}
-			filter += "</ogc:PropertyName><gml:Box srsName='4326'><gml:coordinates>";	
-			filter += rectangle[0].x+","+rectangle[0].y+ " " + rectangle[1].x+","+rectangle[1].y; 
-			filter += "</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter>";
-			url += param;
-			mb_get_geom(url, filter, i, w_[i]);
-		}
-	}
-	else if(queryGeom.geomType == geomType.point){
-		var tmp = queryGeom.get(0);
-		var buffer = mb_wfs_tolerance/2;
-		for(var i=0; i<w_.length; i++){
-			var url = wfs_config[w_[i]]['wfs_getfeature'];
-			param = "service=wfs&request=getFeature&version=1.0.0&typename="+ wfs_config[w_[i]]['featuretype_name']+"&filter=";
-			var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>";
-			filter += "<Intersects><ogc:PropertyName>";
-			for(var j=0; j<wfs_config[w_[i]]['element'].length; j++){
-				if(wfs_config[w_[i]]['element'][j]['f_geom'] == 1){
-					filter += wfs_config[w_[i]]['element'][j]['element_name'];
-				}
-			}
-			filter += "</ogc:PropertyName><gml:Polygon srsName='4326'><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
-			filter += (tmp.x - buffer) + "," + (tmp.y - buffer) + " " + (tmp.x + buffer) + "," + (tmp.y - buffer) +  " ";
-			filter += (tmp.x + buffer) + "," + (tmp.y + buffer) + " " + (tmp.x - buffer) + "," + (tmp.y + buffer) + " " + (tmp.x - buffer) + "," + (tmp.y - buffer); 
-			filter += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></ogc:Filter>";
-			url += param;
-			mb_get_geom(url, filter, i, w_[i]);
-		}
-	}
-//	highlight = new Highlight(mb_wfs_targets, highlight_tag_id, {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex}, generalHighlightLineWidth);
-	return true;
-}
-
-function mb_get_geom(url, filter, index, wfs_conf_id) {
-	
-	mb_ajax_post("../" + wfsResultModulePath + wfsResultModuleFilename,{'url':url,'filter':filter,'typename':wfs_config[wfs_conf_id]['featuretype_name'],'wfs_conf_id':wfs_conf_id},function(js_code,status){
-//		alert(js_code);
-		eval(js_code);
-		if (typeof(geom) == 'object') mb_execWfsReadSubFunctions(geom);
-//		prompt('', js_code);
-	});
-}
-
-//deprecated stuff
-function mod_wfs_spatialRequest_dialog(){	
-}
-function useExtentIsSet () {
-	return mod_wfs_spatialRequest_useExtent;
-}
-
-displayButtons();
+<?php
+#$Id: mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# 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; either version 2, or (at your option)
+# any later version.
+#
+# 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.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+require_once("../../conf/wfs_default.conf");
+$con = db_connect(DBSERVER,OWNER,PW);
+db_select_db(DB,$con);
+
+$gui_id = $_REQUEST["gui_id"];
+$e_id_css = "setSpatialRequest";
+
+$wfs_conf_filename = "wfs_default.conf";
+include '../include/dyn_php.php';
+include("../../conf/" . $wfs_conf_filename);
+
+include '../include/dyn_js.php';
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'setSpatialRequest' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+while($row = db_fetch_array($res)){ 
+   $e_src = $row["e_src"];
+   $e_target = $row["e_target"];
+   $cnt++;
+}
+if($cnt > 1){ echo "alert('setExtRequest: ID not unique!');\n";}
+echo "var mod_wfs_spatialRequest_target = '".$e_target."';\n";
+?>
+
+var wfsAreaType_point = "point";
+var wfsAreaType_polygon = "polygon";
+var wfsAreaType_rectangle = "rectangle";
+var wfsAreaType_extent = "extent";
+var wfsAreaType_current = "";
+
+var mod_wfs_spatialRequest_frameName = "";
+var mod_wfs_spatialRequest_epsg;
+var mod_wfs_spatialRequest_width;
+var mod_wfs_spatialRequest_height;
+
+var mod_wfs_spatialRequest_bg = "";
+var mod_wfs_spatialRequest_pgsql = true;
+var mod_wfs_spatialRequest_win = null;
+var mod_wfs_spatialRequest_thema = false;
+
+var button_point = "point";
+var button_polygon = "polygon";
+var button_rectangle = "rectangle";
+var button_extent = "extent";
+var button_dialogue = "dialogue";
+var mb_wfs_tolerance = 8;
+
+var activeButton = null;
+var mod_wfs_spatialRequest_geometry = null;
+var mod_wfs_spatialRequestSubFunctions = [];
+
+
+// ------------------------------------------------------------------------------------------
+// ------------ button handling -------------------------------------------------------------
+
+function displayButtons() {
+	for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
+		if (parseInt(buttonWfs_on[i])==1) {
+			document.write("<div id='div_"+buttonWfs_id[i]+"' style='position:absolute; top:"+buttonWfs_y[i]+"; left:"+buttonWfs_x[i]+"; z-index:"+buttonWfs_zIndex+"'><img name=\""+buttonWfs_id[i]+"\" onmouseover=\"mb_regButton_frame('initWfsButton', null, "+i+");\" id=\""+buttonWfs_id[i]+"\" title=\""+buttonWfs_title_off[i]+"\" src=\""+buttonWfs_imgdir+buttonWfs_src[i]+"\"></div>");
+		}
+	}
+}
+
+function initWfsButton(ind, pos) {
+	mb_button[ind] = document.getElementById(buttonWfs_id[pos]);
+	mb_button[ind].img_over = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_over");
+	mb_button[ind].img_on = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_on");
+	mb_button[ind].img_off = buttonWfs_imgdir + buttonWfs_src[pos];
+	mb_button[ind].status = 0;
+	mb_button[ind].elName = buttonWfs_id[pos];
+	mb_button[ind].fName = "";
+	mb_button[ind].go = new Function ("wfsEnable(mb_button["+ind+"], " + pos + ")");
+	mb_button[ind].stop = new Function ("wfsDisable(mb_button["+ind+"], " + pos + ")");
+	var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+	mod_wfs_spatialRequest_width = mb_mapObj[ind].width;
+	mod_wfs_spatialRequest_height = mb_mapObj[ind].height;
+	mod_wfs_spatialRequest_epsg = mb_mapObj[ind].epsg;
+	mb_registerSubFunctions("drawDashedLineExt()");
+	mb_registerPanSubElement("measuring");
+}	
+
+function wfsEnable(obj) {
+	if (obj.id == button_point) {
+		if (activeButton == null) {
+			activeButton = obj;
+		}
+		mod_wfs_spatialRequest_geometry = new Geometry(geomType.point);
+		wfsAreaType_current = wfsAreaType_point;
+		mod_wfs_spatialRequest_digitize_go(geomType.point);		
+	}
+	if (obj.id == button_polygon) {
+		if (activeButton == null) {
+			activeButton = obj;
+		}
+		mod_wfs_spatialRequest_geometry = new Geometry(geomType.polygon);
+		wfsAreaType_current = wfsAreaType_polygon;
+		mod_wfs_spatialRequest_digitize_go(geomType.polygon);		
+		var measureSub = "";
+		for(var i=0; i<mod_wfs_spatialRequestSubFunctions.length; i++){
+			measureSub += eval(mod_wfs_spatialRequestSubFunctions[i]);
+		}   
+		writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
+	}
+	else if (obj.id == button_rectangle){
+		if (activeButton == null) {
+			activeButton = obj;
+		}
+		mod_wfs_spatialRequest_geometry = new Geometry(geomType.line);
+		wfsAreaType_current = wfsAreaType_rectangle;
+		mod_selAreaExt_click();	
+	}
+	else if (obj.id == button_extent){
+		if (activeButton == null) {
+			activeButton = obj;
+		}
+		mod_wfs_spatialRequest_geometry = new Geometry(geomType.line);
+		wfsAreaType_current = wfsAreaType_extent;
+		var ind = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+		var p0 = mapToReal(mod_wfs_spatialRequest_target, new Point(0,0));
+		var p1 = mapToReal(mod_wfs_spatialRequest_target, new Point(mb_mapObj[ind].width,mb_mapObj[ind].height)); 
+		mod_wfs_spatialRequest_geometry.addPoint(p0);
+		mod_wfs_spatialRequest_geometry.addPoint(p1);
+		mod_getAreaExt_send();
+	}
+	else if (obj.id == button_dialogue) {
+		activeButton = obj;
+		mod_wfs_SpatialRequest_dialog();
+	}
+}
+
+function wfsDisable(obj) {
+	var el = window.frames[mod_wfs_spatialRequest_target].document; 
+	el.onmousedown = null;
+	el.ondblclick = null;
+	el.onmousemove = null;
+	writeTag(mod_wfs_spatialRequest_target,"measure_display","");
+	writeTag(mod_wfs_spatialRequest_target,"measure_sub","");
+	activeButton = null;
+}
+
+// ------------------------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------------------------
+// -------------------- rectangle -----------------------------------------------------------------
+
+function mod_selAreaExt_click(){
+   var el = window.frames[mod_wfs_spatialRequest_target].document;
+   el.onmouseover = mod_selAreaExt_init;
+   el.onmousedown = mod_box_start;
+   el.onmouseup = mod_selAreaExt_get;
+   el.onmousemove = mod_box_run;
+}
+function mod_selAreaExt_init(e){
+   mb_isBF = mod_wfs_spatialRequest_target;
+   mb_zF = mod_wfs_spatialRequest_target;
+}
+function mod_selAreaExt_get(e){
+	mod_selAreaExt_setValidClipping(mod_box_stop(e));
+	mb_isBF = mod_wfs_spatialRequest_target;
+	mb_zF = mod_wfs_spatialRequest_target;
+}
+function mod_selAreaExt_setValidClipping(coords){
+	if (mod_wfs_spatialRequest_geometry != null) {
+		mod_wfs_spatialRequest_geometry.addPoint(new Point(coords[0],coords[1]));
+		mod_wfs_spatialRequest_geometry.addPoint(new Point(coords[2],coords[3]));
+		
+		if(mod_wfs_spatialRequest_geometry.count() == 2){
+			mod_getAreaExt_send();
+		}
+		else{
+			alert(errorMessageInvalidExtent[selectedLanguage])
+			mb_disableThisButton(activeButton.id);
+		}
+	}
+}
+// ----------------------------------------------------------------------------------------------
+
+
+// ----------------------------------------------------------------------------------------------
+// -------------------- polygon && point --------------------------------------------------------
+
+function mod_wfs_spatialRequest_digitize_go(geomType){
+	if (geomType == geomType.polygon) {
+		mod_wfs_spatialRequest_geometry = new Geometry(geomType.polygon);
+	}
+	s = new Snapping(mod_wfs_spatialRequest_target);
+
+	var el = window.frames[mod_wfs_spatialRequest_target].document;
+	el.onmousedown = mod_wfs_spatialRequest_start;
+	el.onmousemove = mod_wfs_spatialRequest_run;
+	var measureSub = "";
+	for(var i=0; i<mod_wfs_spatialRequestSubFunctions.length; i++){
+		measureSub += eval(mod_wfs_spatialRequestSubFunctions[i]);
+	}   
+	writeTag(mod_wfs_spatialRequest_target,"measure_sub",measureSub);
+}
+
+// ---------------------------------------------------------------------------------------------
+
+function mod_wfs_spatialRequest_run(e) {
+	if (mod_wfs_spatialRequest_geometry.count() >= 3) {
+		mb_getMousePos(e,mod_wfs_spatialRequest_target);
+		var pos = new Point(clickX,clickY).round(2);
+		s.check(pos);
+	}
+}
+
+function mod_wfs_spatialRequest_start(e){
+	var realWorldPos;
+	if (s.isSnapped() == true) {
+		realWorldPos = s.getSnappedPoint(); 
+		s.clean();
+	}
+	else {
+		mb_getMousePos(e,mod_wfs_spatialRequest_target);
+		realWorldPos = mapToReal(mod_wfs_spatialRequest_target,new Point(clickX,clickY)).round(2);
+	}
+
+	mod_wfs_spatialRequest_geometry.addPoint(realWorldPos);
+
+	if (mod_wfs_spatialRequest_geometry.count() == 1) {
+		s.add(mod_wfs_spatialRequest_geometry.get(0));
+	}
+	if (s.isSnapped() && mod_wfs_spatialRequest_geometry.count() >= 3 && mod_wfs_spatialRequest_geometry.get(-1).equals(mod_wfs_spatialRequest_geometry.get(0))) {
+		mod_wfs_spatialRequest_geometry.close();
+		mod_getAreaExt_send();
+		return;
+	}
+	
+	if(wfsAreaType_current == wfsAreaType_point){
+		mod_getAreaExt_send();
+		return;
+	}
+	drawDashedLineExt();
+}
+function drawDashedLineExt(){
+	var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mod_wfs_spatialRequest_width+"' height='0'></div>";
+	str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mod_wfs_spatialRequest_height+"'></div>";
+	if (mod_wfs_spatialRequest_geometry != null) {
+		for(var i=0; i<mod_wfs_spatialRequest_geometry.count(); i++){
+			var pos = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(i));
+			str_mPoints += "<div style='font-size:1px;position:absolute;top:"+(pos.y-2)+"px;left:"+(pos.x-2)+"px;width:3px;height:3px;background-color:#ff0000'></div>";
+		}
+		if(mod_wfs_spatialRequest_geometry.count()>1){
+			for(var k=1; k<mod_wfs_spatialRequest_geometry.count(); k++){
+				var pos0 = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(k));
+				var pos1 = realToMap(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry.get(k-1));
+				str_mPoints += evaluateDashesExt(pos1,pos0,k);
+			}
+		}
+	}
+	writeTag(mod_wfs_spatialRequest_target,"measuring",str_mPoints);
+}
+function evaluateDashesExt(p1,p0,count){
+	var str_dashedLine = "";
+	var d = p0.dist(p1);
+	var n = Math.round(d);
+	var s =  p0.minus(p1).dividedBy(n);
+	for(var i=1; i<n; i++){
+		var currPoint = p1.plus(s.times(i)).minus(new Point(2,2)).round(0); 
+		if(currPoint.x >= 0 && currPoint.x <= mod_wfs_spatialRequest_width && currPoint.y >= 0 && currPoint.y <= mod_wfs_spatialRequest_height){
+			str_dashedLine += "<div style='font-size:1px;position:absolute;top:"+currPoint.y+"px;left:"+currPoint.x+"px;width:3px;height:3px;background-color:#ff0000'></div>";
+		}
+	}
+	return str_dashedLine;
+}
+function mod_wfs_spatialRequest_close(){
+	if(mod_wfs_spatialRequest_geometry.count() < 3){
+		return;
+	}
+	mod_wfs_spatialRequest_geometry.closeGeometry();
+	drawDashedLineExt();
+	mod_getAreaExt_send();
+}
+
+function register_setExtRequestSubFunctions(stringFunction){
+	mod_wfs_spatialRequestSubFunctions[mod_wfs_spatialRequestSubFunctions.length] = stringFunction;
+}
+
+function mod_getAreaExt_send(){	
+	mb_setwfsrequest(mod_wfs_spatialRequest_target,mod_wfs_spatialRequest_geometry);
+	mod_wfs_spatialRequest_delete();
+	mb_disableThisButton(activeButton.id);
+	mod_wfs_spatialRequest_geometry = null;
+}
+
+function mod_wfs_spatialRequest_delete(){
+	writeTag(mod_wfs_spatialRequest_target,"measuring","");
+	writeTag(mod_wfs_spatialRequest_target,"measure_display","");
+}
+
+function mod_wfs_spatialRequest_timeout(){
+	var el = window.frames[mod_wfs_spatialRequest_target].document; 
+	el.onmousedown = null;
+	el.ondblclick = null;
+	el.onmousemove = null;
+}
+
+function mod_wfs_spatialRequest_disableTimeout(){
+	var el = window.frames[mod_wfs_spatialRequest_target].document;
+	el.onmousedown = mod_wfs_spatialRequest_start;
+}
+
+
+function isSetWfsResultToDigitize() {
+	if (parseInt(buttonWfs_toDigitize_on)==1) return true;
+	return false;
+}
+
+function mod_wfs_SpatialRequest_dialog(){	
+	if(!mod_wfs_spatialRequest_win || mod_wfs_spatialRequest_win == null || mod_wfs_spatialRequest_win.closed == true){
+		mod_wfs_spatialRequest_win = window.open("","mod_wfs_spatialRequest_win","width=200,height=150,resizable=yes");
+		mod_wfs_spatialRequest_win.document.open("text/html");
+		
+		mod_wfs_spatialRequest_win.document.writeln('<script language="JavaScript" type="text/javascript">');	
+		mod_wfs_spatialRequest_win.document.writeln('function set(obj){');
+			mod_wfs_spatialRequest_win.document.writeln('for(var i=0; i< document.getElementsByName("geom").length; i++){');
+				mod_wfs_spatialRequest_win.document.writeln('if(document.getElementsByName("geom")[i].checked){');
+					mod_wfs_spatialRequest_win.document.writeln('window.opener.mod_setExtRequest_geom = document.getElementsByName("geom")[i].value;'); 
+				mod_wfs_spatialRequest_win.document.writeln('}');
+			mod_wfs_spatialRequest_win.document.writeln('}');
+//			mod_wfs_spatialRequest_win.document.writeln('window.opener.mod_wfs_spatialRequest_geom = obj.value;');
+			mod_wfs_spatialRequest_win.document.writeln('window.opener.wfsEnable(obj);');
+			mod_wfs_spatialRequest_win.document.writeln('window.close();');
+			mod_wfs_spatialRequest_win.document.writeln('return false;	');
+		mod_wfs_spatialRequest_win.document.writeln('}');
+		mod_wfs_spatialRequest_win.document.writeln('</script>');
+		
+		mod_wfs_spatialRequest_win.document.writeln("<form>");
+		mod_wfs_spatialRequest_win.document.writeln("<input id='point' name='geom' type='radio' value='"+button_point+"' onclick='set(this)'> Punkt<br>");
+		mod_wfs_spatialRequest_win.document.writeln("<input id='rectangle' name='geom' type='radio' value='"+button_rectangle+"' onclick='set(this)'> Rechteck<br>");
+		mod_wfs_spatialRequest_win.document.writeln("<input id='polygon' name='geom' type='radio' value='"+button_polygon+"'onclick='set(this)'> Polygon<br>");
+		mod_wfs_spatialRequest_win.document.writeln("<input id='extent' name='geom' type='radio' value='"+button_extent+"'onclick='set(this)'> Extent<br>");
+		var checked = "";
+//		if (mod_wfs_spatialRequest_useExtent) {
+//			checked = " checked";
+//		}		
+		//mod_wfs_spatialRequest_win.document.writeln("<input id='extent' name='geom' type='radio' value='extent' onclick='set(this)' " + checked + "> Extent<br>");
+		mod_wfs_spatialRequest_win.document.writeln("</form>");
+		mod_wfs_spatialRequest_win.document.close();
+	}
+	else{
+		mod_wfs_spatialRequest_win.focus();
+	}	
+}
+
+function mb_setwfsrequest(target,queryGeom){
+	//mb_wfs_reset();
+	var ind = getMapObjIndexByName(target);
+	var w = [];
+	w_ = [];
+	wfs_config = window.frames["wfs_conf"].get_wfs_conf();
+	for (var i=0; i<mb_mapObj[ind].wms.length; i++){
+		for(var ii=0; ii<mb_mapObj[ind].wms[i].objLayer.length; ii++){
+			var o = mb_mapObj[ind].wms[i].objLayer[ii];
+			if(o.gui_layer_wfs_featuretype != '' && o.gui_layer_querylayer == '1'){
+				w[w.length] = o.gui_layer_wfs_featuretype;
+			}	
+		}
+	}
+	for(var i=0; i<w.length; i++){
+		for(var ii=0; ii<wfs_config.length; ii++){			
+			if(wfs_config[ii]['wfs_conf_id'] == w[i]) w_[w_.length] = ii;
+		}
+	}
+	
+	if(queryGeom.geomType==geomType.polygon){
+		for(var i=0; i<w_.length; i++){
+			var url = wfs_config[w_[i]]['wfs_getfeature'];
+			url += "service=wfs&request=getFeature&version=1.0.0";
+			url += "&typename="+ wfs_config[w_[i]]['featuretype_name'];
+			url += "&filter=";
+			var filter = '<ogc:Filter xmlns:ogc="http://ogc.org" xmlns:gml="http://www.opengis.net/gml">';
+			filter += "<Within><ogc:PropertyName>";
+			for(var j=0; j<wfs_config[w_[i]]['element'].length; j++){
+				if(wfs_config[w_[i]]['element'][j]['f_geom'] == 1){
+					filter += wfs_config[w_[i]]['element'][j]['element_name'];
+				}
+			}
+			filter += "</ogc:PropertyName><gml:Polygon srsName=\"EPSG:4326\">";
+			filter += '<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
+			for(var k=0; k<queryGeom.count(); k++){
+				if(k>0)	filter += " ";
+				filter += queryGeom.get(k).x+","+queryGeom.get(k).y;								 
+			}
+			filter += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>';
+			filter += '</gml:Polygon></Within></ogc:Filter>';
+			mb_get_geom(url, filter, i, wfs_config[w_[i]]['featuretype_name'], w_[i], w[i]);
+		}
+	}
+	else if(queryGeom.geomType==geomType.line){
+		var rectangle = [];
+		if(queryGeom.geomType == geomType.line){
+			var rectangle = queryGeom.getBBox();
+		}
+		for(var i=0; i<w_.length; i++){
+			var url = wfs_config[w_[i]]['wfs_getfeature'];
+			param = "service=wfs&request=getFeature&version=1.0.0&typename="+ wfs_config[w_[i]]['featuretype_name']+"&filter=";
+			var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>";
+			filter += "<ogc:BBOX><ogc:PropertyName>";
+			for(var j=0; j<wfs_config[w_[i]]['element'].length; j++){
+				if(wfs_config[w_[i]]['element'][j]['f_geom'] == 1){
+					filter += wfs_config[w_[i]]['element'][j]['element_name'];
+				}
+			}
+			filter += "</ogc:PropertyName><gml:Box srsName='4326'><gml:coordinates>";	
+			filter += rectangle[0].x+","+rectangle[0].y+ " " + rectangle[1].x+","+rectangle[1].y; 
+			filter += "</gml:coordinates></gml:Box></ogc:BBOX></ogc:Filter>";
+			url += param;
+			mb_get_geom(url, filter, i, wfs_config[w_[i]]['featuretype_name'], w_[i], w[i]);
+		}
+	}
+	else if(queryGeom.geomType == geomType.point){
+		var tmp = queryGeom.get(0);
+		var buffer = mb_wfs_tolerance/2;
+		for(var i=0; i<w_.length; i++){
+			var url = wfs_config[w_[i]]['wfs_getfeature'];
+			param = "service=wfs&request=getFeature&version=1.0.0&typename="+ wfs_config[w_[i]]['featuretype_name']+"&filter=";
+			var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>";
+			filter += "<Intersects><ogc:PropertyName>";
+			for(var j=0; j<wfs_config[w_[i]]['element'].length; j++){
+				if(wfs_config[w_[i]]['element'][j]['f_geom'] == 1){
+					filter += wfs_config[w_[i]]['element'][j]['element_name'];
+				}
+			}
+			filter += "</ogc:PropertyName><gml:Polygon srsName='4326'><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+			filter += (tmp.x - buffer) + "," + (tmp.y - buffer) + " " + (tmp.x + buffer) + "," + (tmp.y - buffer) +  " ";
+			filter += (tmp.x + buffer) + "," + (tmp.y + buffer) + " " + (tmp.x - buffer) + "," + (tmp.y + buffer) + " " + (tmp.x - buffer) + "," + (tmp.y - buffer); 
+			filter += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></ogc:Filter>";
+			url += param;
+			mb_get_geom(url, filter, i, wfs_config[w_[i]]['featuretype_name'], w_[i], w[i]);
+		}
+	}
+//	highlight = new Highlight(mb_wfs_targets, highlight_tag_id, {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex}, generalHighlightLineWidth);
+	return true;
+}
+
+function mb_get_geom(url, filter, index, typename, js_wfs_conf_id, db_wfs_conf_id) {
+	
+	mb_ajax_post("../" + wfsResultModulePath + wfsResultModuleFilename, {'url':url,'filter':filter,'typename':typename,'js_wfs_conf_id':js_wfs_conf_id, 'db_wfs_conf_id':db_wfs_conf_id}, function(js_code,status){
+//		alert(js_code);
+		eval(js_code);
+		if (typeof(geom) == 'object') mb_execWfsReadSubFunctions(geom);
+//		prompt('', js_code);
+	});
+}
+
+//deprecated stuff
+function mod_wfs_spatialRequest_dialog(){	
+}
+function useExtentIsSet () {
+	return mod_wfs_spatialRequest_useExtent;
+}
+
+displayButtons();

Modified: tags/2.4.4_rc1/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- tags/2.4.3/http/javascripts/mod_wfs_gazetteer_client.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/javascripts/mod_wfs_gazetteer_client.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -50,6 +50,7 @@
 var point_px = 10;
 var resultGeom = null;
 var cw_fillcolor = "#cc33cc";
+var g_buffer;
 
 
 parent.mb_registerInitFunctions("window.frames['"+this.name+"'].initModWfsGazetteer()");
@@ -73,8 +74,8 @@
 
 function appendStyles() {
 	var styleObj;
-	var rule = global_wfsConfObj[global_selectedWfsConfId].g_style + global_wfsConfObj[global_selectedWfsConfId].g_res_style;
-	if (parent.ie) {
+        var rule = global_wfsConfObj[global_selectedWfsConfId].g_style + global_wfsConfObj[global_selectedWfsConfId].g_res_style;
+        if (parent.ie) {
 		var styleSheetObj=document.createStyleSheet();
 		styleObj=styleSheetObj.owningElement || styleSheetObj.ownerNode;
 		styleObj.setAttribute("type","text/css");
@@ -114,6 +115,7 @@
 		else if (wfsCount === 1) {
 			appendStyles();
 			appendWfsForm();
+			g_buffer = global_wfsConfObj[global_selectedWfsConfId].g_buffer; 
 		}
 		else {
 			appendWfsConfSelectBox();
@@ -312,7 +314,7 @@
 	else if (event == "click"){
 		global_resultHighlight.del(resultGeom.get(index), cw_fillcolor);
 		var bbox = resultGeom.get(index).getBBox();
-		var buffer = new parent.Point(1,1);
+            var buffer = new parent.Point(g_buffer,g_buffer);
 		bbox[0] = bbox[0].minus(buffer);
 		bbox[1] = bbox[1].plus(buffer);
 		parent.mb_calculateExtent(targetArray[0], bbox[0].x, bbox[0].y, bbox[1].x, bbox[1].y);

Modified: tags/2.4.4_rc1/http/javascripts/wfs.js
===================================================================
--- tags/2.4.3/http/javascripts/wfs.js	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/javascripts/wfs.js	2007-11-30 15:25:59 UTC (rev 1879)
@@ -1,320 +1,322 @@
-<?php
-#$Id$
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
-# Copyright (C) 2002 CCGIS 
-#
-# 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; either version 2, or (at your option)
-# any later version.
-#
-# 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.
-
-session_start();
-import_request_variables("PG");
-require_once("../php/mb_validateSession.php");
-require_once("../../conf/mapbender.conf");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
-
-$gui_id = $_REQUEST["gui_id"];
-$e_id_css = "wfs";
-include '../include/dyn_js.php';
-require_once("wfs_usemap.js");
-?>
-var highlight_tag_id = "wfs_highlight_tag";
-var mb_wfs_fetched = [];
-
-
-var mb_wfs_target = "mapframe1";
-var mb_wfs_objwin = null;
-var mb_wfs_objwin_left = 800;
-var mb_wfs_objwin_top = 200;
-var mb_wfs_objwin_width = 200;
-var mb_wfs_objwin_height = 200;
-var mb_wfs_targets = new Array("mapframe1","overview");
-var mb_wfs_fillColor = "#ff0000";
-var usemap = "";
-var mod_usemap_radius = 10;
-var mod_usemap_line_tolerance = 5;
-var useCheckboxForHighlighting = true;
-
-var mb_wfs_fetch = new GeometryArray();
-
-var highlight;
-
-mb_registerInitFunctions('initHighlight()');
-
-function initHighlight() {
-	var styleObj = {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex};
-	highlight = new Highlight(mb_wfs_targets, highlight_tag_id, styleObj, generalHighlightLineWidth);
-}
-try {if(displayWfsResultList){}}catch(e) {displayWfsResultList = 0;}
-
-if (displayWfsResultList == 1) {
-	//mb_registerWfsReadSubFunctions(function(geom){mb_wfs_listMember(geom)});
-}
-
-
-if (parseInt(useUsemap) == 1) {
-	mb_registerSubFunctions('mod_usemap("")');
-}
-
-if (useCheckboxForHighlighting) { 
-	mb_registerSubFunctions('highlight.paint()');
-}
-
-/*
-if (useExtentIsSet()) {
-	mb_registerSubFunctions("mb_setwfsrequest_extent()");
-}
-function mb_setwfsrequest_extent() {
-
-	if (useExtentIsSet()) {
-		var ind = getMapObjIndexByName(mb_wfs_targets[0]);
-		var pos_a = makeClickPos2RealWorldPos(mb_wfs_targets[0],0,0);
-		var pos_b = makeClickPos2RealWorldPos(mb_wfs_targets[0],mb_mapObj[ind].width,mb_mapObj[ind].height);
-	
-		var x = [];
-		var y = [];
-		x[0] = pos_a[0];
-		x[1] = pos_b[0];
-		y[0] = pos_a[1];
-		y[1] = pos_b[1];
-		
-		mb_setwfsrequest(mb_wfs_targets[0],'rectangle',x,y);
-	}
-}
-*/
-
-function mb_wfs_listMember(geomArray){
-	mb_wfs_fetch.union(geomArray);
-	var wfs_conf = get_complete_wfs_conf();
-	var str = "<table>";
-	for(var i=0; i<mb_wfs_fetch.count(); i++){
-		var t = wfs_conf[mb_wfs_fetch.get(i).wfs_conf];
-		for(var j=0; j<t['element'].length; j++){
-			if(t['element'][j]['f_show'] > 0){
-				var k = mb_wfs_fetch.get(i).e.getElementIndexByName(t['element'][j]['element_name']);
-				//alert(k);
-				if(k != -1){
-					str += "<tr><td>";
-					if (useCheckboxForHighlighting) {
-						str += "<input type=checkbox id=highlightCheckbox" + i + " onChange='highlightGeometry(" + i + ")'></td><td>";
-					}
-					str += "<div";
-					if (!useCheckboxForHighlighting) {
-						str += " onmouseover='mb_wfs_perform(\"over\",mb_wfs_fetch.get("+i+"))' ";
-						str += " onmouseout='mb_wfs_perform(\"out\",mb_wfs_fetch.get("+i+"))' ";
-					}
-					str += " onclick='mb_wfs_perform(\"click\",mb_wfs_fetch.get("+i+"))' ";
-					str += ">" + mb_wfs_fetch.get(i).e.getValue(k)+ "</div></td></tr>";
-				}
-			}
-		}
-	}
-	str += "</table>";
-	mb_wfs_objwin.innerHTML = str;
-//	if (parseInt(useUsemap) == 1) mod_usemap(wfs_name);
-}
-
-function mb_wfs_reset(){
-	mb_wfs_fetch = new parent.GeometryArray();
-	usemap = "";
-	
-	if(mb_wfs_objwin == null){
-		var iframe=document.createElement('div');
-		iframe.setAttribute("style","position:absolute;left:"+mb_wfs_objwin_left+"px;top:"+mb_wfs_objwin_top+"px;width:"+mb_wfs_objwin_width+"px;height:"+mb_wfs_objwin_height+"px");
-		mb_wfs_objwin = document.body.appendChild(iframe);
-		mb_wfs_objwin.id = "mb_wfs_objwin";
-		mb_wfs_objwin.name = "mb_wfs_objwin";
-		mb_wfs_objwin.style.position = 'absolute';
-		mb_wfs_objwin.style.left = mb_wfs_objwin_left+"px";
-		mb_wfs_objwin.style.top = mb_wfs_objwin_top+"px";
-		mb_wfs_objwin.style.width = mb_wfs_objwin_width+"px";
-		mb_wfs_objwin.style.height = mb_wfs_objwin_height+"px";
-	}
-	for(var i=0; i<mb_wfsreq; i++){
-		if(document.getElementById("mb_wfs_win_"+mb_wfsreq)){
-			document.removeChild("mb_wfs_win_"+mb_wfsreq);
-		}
-	}
-	mb_wfsreq = 0;
-	return true;
-}
-
-function get_complete_wfs_conf() {
-	var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
-	return wfs_conf;
-}
-
-function highlightGeometry(i) {
-	var id = "highlightCheckbox"+i;
-	if (document.getElementById(id).checked) highlight.add(mb_wfs_fetch.get(i), '#00ff00');
-	else highlight.del(mb_wfs_fetch.get(i), '#00ff00');
-}
-
-function mb_wfs_perform(type,m){
-
-	var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
-	if(type=='over') highlight.add(m, '#0000ff');
-	else if(type=='out') highlight.del(m, '#0000ff');
-	else if(type=='click') {
-		var tmp = m.getBBox();
-		if (m.geomType == geomType.point) {
-			var b = 1;
-		}
-		else {
-			var b = 0;
-		}
-		if (typeof(m.wfs_conf) != "undefined") {
-			b = parseFloat(wfs_conf[m.wfs_conf]['g_buffer']);
-		}
-		var buffer = new Point(b,b);
-		var bbox_ll = tmp[0].minus(buffer);
-		var bbox_ru = tmp[1].plus(buffer);
-		mb_calcExtent(mb_wfs_targets[0],bbox_ll, bbox_ru);
-		zoom(mb_wfs_targets[0], 'true', 1.0);
-	}
-}
-
-function get_wfs_str(myconf, d, m, type, fid) {
-	var str = '<wfs:Transaction version="1.0.0" service="WFS" xmlns="http://www.someserver.com/myns" ';
-
-	var ns_gml = false;	var ns_ogc = false;	var ns_xsi = false;	var ns_wfs = false;	var ns_topp = false;
-	
-	for (var q = 0 ; q < myconf['namespaces'].length ; q++) {
-		if (myconf['namespaces'][q]['name'] == "gml") ns_gml = true;
-		else if (myconf['namespaces'][q]['name'] == "ogc") ns_ogc = true;
-		else if (myconf['namespaces'][q]['name'] == "xsi") ns_xsi = true;
-		else if (myconf['namespaces'][q]['name'] == "wfs") ns_wfs = true;
-		else if (myconf['namespaces'][q]['name'] == "topp") ns_topp = true;
-		str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
-	}
-	
-	if (ns_gml == false) str += 'xmlns:gml="http://www.opengis.net/gml" ';
-	if (ns_ogc == false) str += 'xmlns:ogc="http://www.opengis.net/ogc" ';
-	if (ns_xsi == false) str += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';
-	if (ns_topp == false) str += 'xmlns:topp="http://www.someserver.com/topp" ';
-	if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
-	
-	str += 'xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd">';
-
-	
-	//
-	// ---------------------------------------- SAVE -------------------------------------------------
-	//
-	if (type == "save") {
-		str += '<wfs:Insert><'+ myconf['featuretype_name']+'>';
-		for(var i=0; i<d.get(m).e.count(); i++){
-			if(d.get(m).e.getValue(i) != "" && d.get(m).e.getName(i) != "fid"){
-				var tmp = d.get(m).e.getName(i);
-				str += '<' + tmp  + '>' + d.get(m).e.getValue(i) + '</' + tmp  + '>';
-			}
-		}
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];	
-			}
-		}
-		str += '<' + el_geom + '>';	
-		if(d.get(m).geomType == geomType.point){
-			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:coordinates>';
-			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y; 
-			str += '</gml:coordinates>';
-			str += '</gml:Point>';		
-		}
-		if(d.get(m).geomType == geomType.line){
-			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
-			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
-			str += '</gml:MultiLineString>';
-		}
-		if(d.get(m).geomType == geomType.polygon){
-			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
-
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
-			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
-		}
-		str += '</' + el_geom + '></'+ myconf['featuretype_name']+'></wfs:Insert>';		
-	}
-	//
-	// --------------------------------------- UPDATE ------------------------------------------------
-	//
-	else if (type == "update") {
-		str += '<wfs:Update typeName="'+ myconf['featuretype_name']+'">';
-		for(var i=0; i<d.get(m).e.count(); i++){
-			if(d.get(m).e.getValue(i) != "" && d.get(m).e.getName(i) != "fid"){
-				str += '<wfs:Property>';
-				str += '<wfs:Name>'+d.get(m).e.getName(i)+'</wfs:Name>';
-				str += '<wfs:Value>'+d.get(m).e.getValue(i)+'</wfs:Value>';
-				str += '</wfs:Property>';
-			}
-		}
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];	
-			}
-		}
-		str += '<wfs:Property><wfs:Name>' + el_geom + '</wfs:Name><wfs:Value>';
-		if(d.get(m).geomType == geomType.point){
-			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '"><gml:coordinates>';
-			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y; 
-			str += '</gml:coordinates></gml:Point>';		
-		}
-		if(d.get(m).geomType == geomType.line){
-			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
-			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
-			str += '</gml:MultiLineString>';
-		}
-		if(d.get(m).geomType == geomType.polygon){
-			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
-			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
-			for(var k=0; k<d.getGeometry(m,0).count(); k++){
-				if(k>0)	str += " ";	
-				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
-			} 
-			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
-		}
-		str += '</wfs:Value></wfs:Property>';
-		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
-		str += '</wfs:Update>';
-	}
-	//
-	// --------------------------------------- DELETE ------------------------------------------------
-	//
-	else if (type == "delete") {
-		str += '<wfs:Delete typeName="'+ myconf['featuretype_name']+'">';
-		for(var j=0; j<myconf['element'].length; j++){
-			if(myconf['element'][j]['f_geom'] == 1){
-				var el_geom = myconf['element'][j]['element_name'];	
-			}
-		}
-		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
-		str += '</wfs:Delete>';
-	}
-	
-	str += '</wfs:Transaction>';
-	return str;
-}
+<?php
+#$Id$
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
+# Copyright (C) 2002 CCGIS 
+#
+# 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; either version 2, or (at your option)
+# any later version.
+#
+# 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.
+
+session_start();
+import_request_variables("PG");
+require_once("../php/mb_validateSession.php");
+require_once("../../conf/mapbender.conf");
+$con = db_connect(DBSERVER,OWNER,PW);
+db_select_db(DB,$con);
+
+$gui_id = $_REQUEST["gui_id"];
+$e_id_css = "wfs";
+include '../include/dyn_js.php';
+require_once("wfs_usemap.js");
+?>
+var highlight_tag_id = "wfs_highlight_tag";
+var mb_wfs_fetched = [];
+
+
+var mb_wfs_target = "mapframe1";
+var mb_wfs_objwin = null;
+var mb_wfs_objwin_left = 800;
+var mb_wfs_objwin_top = 200;
+var mb_wfs_objwin_width = 200;
+var mb_wfs_objwin_height = 200;
+var mb_wfs_targets = new Array("mapframe1","overview");
+var mb_wfs_fillColor = "#ff0000";
+var usemap = "";
+var mod_usemap_radius = 10;
+var mod_usemap_line_tolerance = 5;
+var useCheckboxForHighlighting = true;
+
+var mb_wfs_fetch = new GeometryArray();
+
+var highlight;
+
+mb_registerInitFunctions('initHighlight()');
+
+function initHighlight() {
+	var styleObj = {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex};
+	highlight = new Highlight(mb_wfs_targets, highlight_tag_id, styleObj, generalHighlightLineWidth);
+}
+try {if(displayWfsResultList){}}catch(e) {displayWfsResultList = 0;}
+
+if (displayWfsResultList == 1) {
+	//mb_registerWfsReadSubFunctions(function(geom){mb_wfs_listMember(geom)});
+}
+
+
+if (parseInt(useUsemap) == 1) {
+	mb_registerSubFunctions('mod_usemap("")');
+}
+
+if (useCheckboxForHighlighting) { 
+	mb_registerSubFunctions('highlight.paint()');
+}
+
+/*
+if (useExtentIsSet()) {
+	mb_registerSubFunctions("mb_setwfsrequest_extent()");
+}
+function mb_setwfsrequest_extent() {
+
+	if (useExtentIsSet()) {
+		var ind = getMapObjIndexByName(mb_wfs_targets[0]);
+		var pos_a = makeClickPos2RealWorldPos(mb_wfs_targets[0],0,0);
+		var pos_b = makeClickPos2RealWorldPos(mb_wfs_targets[0],mb_mapObj[ind].width,mb_mapObj[ind].height);
+	
+		var x = [];
+		var y = [];
+		x[0] = pos_a[0];
+		x[1] = pos_b[0];
+		y[0] = pos_a[1];
+		y[1] = pos_b[1];
+		
+		mb_setwfsrequest(mb_wfs_targets[0],'rectangle',x,y);
+	}
+}
+*/
+
+function mb_wfs_listMember(geomArray){
+	mb_wfs_fetch.union(geomArray);
+	var wfs_conf = get_complete_wfs_conf();
+	var str = "<table>";
+	for(var i=0; i<mb_wfs_fetch.count(); i++){
+		var t = wfs_conf[mb_wfs_fetch.get(i).wfs_conf];
+		for(var j=0; j<t['element'].length; j++){
+			if(t['element'][j]['f_show'] > 0){
+				var k = mb_wfs_fetch.get(i).e.getElementIndexByName(t['element'][j]['element_name']);
+				//alert(k);
+				if(k != -1){
+					str += "<tr><td>";
+					if (useCheckboxForHighlighting) {
+						str += "<input type=checkbox id=highlightCheckbox" + i + " onChange='highlightGeometry(" + i + ")'></td><td>";
+					}
+					str += "<div";
+					if (!useCheckboxForHighlighting) {
+						str += " onmouseover='mb_wfs_perform(\"over\",mb_wfs_fetch.get("+i+"))' ";
+						str += " onmouseout='mb_wfs_perform(\"out\",mb_wfs_fetch.get("+i+"))' ";
+					}
+					str += " onclick='mb_wfs_perform(\"click\",mb_wfs_fetch.get("+i+"))' ";
+					str += ">" + mb_wfs_fetch.get(i).e.getValue(k)+ "</div></td></tr>";
+				}
+			}
+		}
+	}
+	str += "</table>";
+	mb_wfs_objwin.innerHTML = str;
+//	if (parseInt(useUsemap) == 1) mod_usemap(wfs_name);
+}
+
+function mb_wfs_reset(){
+	mb_wfs_fetch = new parent.GeometryArray();
+	usemap = "";
+	
+	if(mb_wfs_objwin == null){
+		var iframe=document.createElement('div');
+		iframe.setAttribute("style","position:absolute;left:"+mb_wfs_objwin_left+"px;top:"+mb_wfs_objwin_top+"px;width:"+mb_wfs_objwin_width+"px;height:"+mb_wfs_objwin_height+"px");
+		mb_wfs_objwin = document.body.appendChild(iframe);
+		mb_wfs_objwin.id = "mb_wfs_objwin";
+		mb_wfs_objwin.name = "mb_wfs_objwin";
+		mb_wfs_objwin.style.position = 'absolute';
+		mb_wfs_objwin.style.left = mb_wfs_objwin_left+"px";
+		mb_wfs_objwin.style.top = mb_wfs_objwin_top+"px";
+		mb_wfs_objwin.style.width = mb_wfs_objwin_width+"px";
+		mb_wfs_objwin.style.height = mb_wfs_objwin_height+"px";
+	}
+	for(var i=0; i<mb_wfsreq; i++){
+		if(document.getElementById("mb_wfs_win_"+mb_wfsreq)){
+			document.removeChild("mb_wfs_win_"+mb_wfsreq);
+		}
+	}
+	mb_wfsreq = 0;
+	return true;
+}
+
+function get_complete_wfs_conf() {
+	var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
+	return wfs_conf;
+}
+
+function highlightGeometry(i) {
+	var id = "highlightCheckbox"+i;
+	if (document.getElementById(id).checked) highlight.add(mb_wfs_fetch.get(i), '#00ff00');
+	else highlight.del(mb_wfs_fetch.get(i), '#00ff00');
+}
+
+function mb_wfs_perform(type,m){
+
+	var wfs_conf = window.frames["wfs_conf"].get_wfs_conf();
+	if(type=='over') highlight.add(m, '#0000ff');
+	else if(type=='out') highlight.del(m, '#0000ff');
+	else if(type=='click') {
+		var tmp = m.getBBox();
+		if (m.geomType == geomType.point) {
+			var b = 1;
+		}
+		else {
+			var b = 0;
+		}
+		if (typeof(m.wfs_conf) != "undefined") {
+			b = parseFloat(wfs_conf[m.wfs_conf]['g_buffer']);
+		}
+		var buffer = new Point(b,b);
+		var bbox_ll = tmp[0].minus(buffer);
+		var bbox_ru = tmp[1].plus(buffer);
+		mb_calcExtent(mb_wfs_targets[0],bbox_ll, bbox_ru);
+		zoom(mb_wfs_targets[0], 'true', 1.0);
+	}
+}
+
+function get_wfs_str(myconf, d, m, type, fid) {
+	var str = '<wfs:Transaction version="1.0.0" service="WFS" xmlns="http://www.someserver.com/myns" ';
+
+	var ns_gml = false;	var ns_ogc = false;	var ns_xsi = false;	var ns_wfs = false;	var ns_topp = false;
+	
+	for (var q = 0 ; q < myconf['namespaces'].length ; q++) {
+		if (myconf['namespaces'][q]['name'] == "gml") ns_gml = true;
+		else if (myconf['namespaces'][q]['name'] == "ogc") ns_ogc = true;
+		else if (myconf['namespaces'][q]['name'] == "xsi") ns_xsi = true;
+		else if (myconf['namespaces'][q]['name'] == "wfs") ns_wfs = true;
+		else if (myconf['namespaces'][q]['name'] == "topp") ns_topp = true;
+		if (myconf['namespaces'][q]['name'] != 'xmlns') {
+			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
+		}
+	}
+	
+	if (ns_gml == false) str += 'xmlns:gml="http://www.opengis.net/gml" ';
+	if (ns_ogc == false) str += 'xmlns:ogc="http://www.opengis.net/ogc" ';
+	if (ns_xsi == false) str += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';
+	if (ns_topp == false) str += 'xmlns:topp="http://www.someserver.com/topp" ';
+	if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
+	
+	str += 'xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd">';
+
+	
+	//
+	// ---------------------------------------- SAVE -------------------------------------------------
+	//
+	if (type == "save") {
+		str += '<wfs:Insert><'+ myconf['featuretype_name']+'>';
+		for(var i=0; i<d.get(m).e.count(); i++){
+			if(d.get(m).e.getValue(i) != "" && d.get(m).e.getName(i) != "fid"){
+				var tmp = d.get(m).e.getName(i);
+				str += '<' + tmp  + '>' + d.get(m).e.getValue(i) + '</' + tmp  + '>';
+			}
+		}
+		for(var j=0; j<myconf['element'].length; j++){
+			if(myconf['element'][j]['f_geom'] == 1){
+				var el_geom = myconf['element'][j]['element_name'];	
+			}
+		}
+		str += '<' + el_geom + '>';	
+		if(d.get(m).geomType == geomType.point){
+			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '">';
+			str += '<gml:coordinates>';
+			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y; 
+			str += '</gml:coordinates>';
+			str += '</gml:Point>';		
+		}
+		if(d.get(m).geomType == geomType.line){
+			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
+			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
+			for(var k=0; k<d.getGeometry(m,0).count(); k++){
+				if(k>0)	str += " ";	
+				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
+			} 
+			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
+			str += '</gml:MultiLineString>';
+		}
+		if(d.get(m).geomType == geomType.polygon){
+			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
+			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
+
+			for(var k=0; k<d.getGeometry(m,0).count(); k++){
+				if(k>0)	str += " ";	
+				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
+			} 
+			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
+		}
+		str += '</' + el_geom + '></'+ myconf['featuretype_name']+'></wfs:Insert>';		
+	}
+	//
+	// --------------------------------------- UPDATE ------------------------------------------------
+	//
+	else if (type == "update") {
+		str += '<wfs:Update typeName="'+ myconf['featuretype_name']+'">';
+		for(var i=0; i<d.get(m).e.count(); i++){
+			if(d.get(m).e.getValue(i) != "" && d.get(m).e.getName(i) != "fid"){
+				str += '<wfs:Property>';
+				str += '<wfs:Name>'+d.get(m).e.getName(i)+'</wfs:Name>';
+				str += '<wfs:Value>'+d.get(m).e.getValue(i)+'</wfs:Value>';
+				str += '</wfs:Property>';
+			}
+		}
+		for(var j=0; j<myconf['element'].length; j++){
+			if(myconf['element'][j]['f_geom'] == 1){
+				var el_geom = myconf['element'][j]['element_name'];	
+			}
+		}
+		str += '<wfs:Property><wfs:Name>' + el_geom + '</wfs:Name><wfs:Value>';
+		if(d.get(m).geomType == geomType.point){
+			str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '"><gml:coordinates>';
+			str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y; 
+			str += '</gml:coordinates></gml:Point>';		
+		}
+		if(d.get(m).geomType == geomType.line){
+			str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
+			str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
+			for(var k=0; k<d.getGeometry(m,0).count(); k++){
+				if(k>0)	str += " ";	
+				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
+			} 
+			str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
+			str += '</gml:MultiLineString>';
+		}
+		if(d.get(m).geomType == geomType.polygon){
+			str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
+			str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
+			for(var k=0; k<d.getGeometry(m,0).count(); k++){
+				if(k>0)	str += " ";	
+				str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
+			} 
+			str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
+		}
+		str += '</wfs:Value></wfs:Property>';
+		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
+		str += '</wfs:Update>';
+	}
+	//
+	// --------------------------------------- DELETE ------------------------------------------------
+	//
+	else if (type == "delete") {
+		str += '<wfs:Delete typeName="'+ myconf['featuretype_name']+'">';
+		for(var j=0; j<myconf['element'].length; j++){
+			if(myconf['element'][j]['f_geom'] == 1){
+				var el_geom = myconf['element'][j]['element_name'];	
+			}
+		}
+		str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
+		str += '</wfs:Delete>';
+	}
+	
+	str += '</wfs:Transaction>';
+	return str;
+}

Modified: tags/2.4.4_rc1/http/php/mod_renameGUI.php
===================================================================
--- tags/2.4.3/http/php/mod_renameGUI.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/php/mod_renameGUI.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -214,7 +214,7 @@
 echo "<tr><td class='newName_str'>Name: </td><td><input class='newName' type='text' id='newGuiName' name='newGuiName'></td></tr>\n";
 echo "<tr>";
 echo " <td><input class='button_rename' type='button' value='rename' onclick='validate_rename()'></td>";
-echo " <td><input class='button_copy' type='button' value='copy' onclick='validate_copy()'><div  class='button_copy_checkbox'>(<input name='withUsers' type='checkbox' /> copy users)</div></td>";
+echo " <td><input class='button_copy' type='button' value='copy' onclick='validate_copy()'><div  class='button_copy_checkbox'>(<input name='withUsers' type='checkbox' /> copy users and groups)</div></td>";
 echo "</tr>\n";
 echo "</table>";
 }

Modified: tags/2.4.4_rc1/http/php/mod_wfs_result.php
===================================================================
--- tags/2.4.3/http/php/mod_wfs_result.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/php/mod_wfs_result.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -18,7 +18,11 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 $filter = stripslashes($_REQUEST["filter"]);
-$url = stripslashes($_REQUEST['url']);
+$url = stripslashes($_REQUEST["url"]);
+$js_wfs_conf_id = $_REQUEST["js_wfs_conf_id"];
+$db_wfs_conf_id = $_REQUEST["db_wfs_conf_id"];
+$typename = $_REQUEST["typename"];
+
 //echo $filter; die();
 require_once("../../conf/mapbender.conf");
 require_once("../classes/class_stripRequest.php");
@@ -60,7 +64,6 @@
 $el = -1;
 $fid = -1;
 
-$typename = $_REQUEST["typename"];
 $element_str = "";
 $geom_str = "";
 foreach ($values as $element) {
@@ -106,7 +109,7 @@
 		}
 		// TO DO: the following is added twice! Once suffices.
 		$element_str .= "geom.get(" . $member . ").e.setElement('fid', '".$fid."');\n";
-		$element_str .= "geom.get(" . $member . ").wfs_conf = ".$_REQUEST['wfs_conf_id'].";\n";
+		$element_str .= "geom.get(" . $member . ").wfs_conf = ".$js_wfs_conf_id.";\n";
 	}
 	else if(strtoupper($element[tag]) == strtoupper("gml:coordinates") && $geom == true){
 		$tmp =  str_replace(",,","",str_replace(" ",",",trim($element[value])));

Modified: tags/2.4.4_rc1/http/tools/mapbender_setup.php
===================================================================
--- tags/2.4.3/http/tools/mapbender_setup.php	2007-11-28 18:02:57 UTC (rev 1870)
+++ tags/2.4.4_rc1/http/tools/mapbender_setup.php	2007-11-30 15:25:59 UTC (rev 1879)
@@ -21,7 +21,8 @@
  # along with this program; if not, write to the Free Software
  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  
- include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+include_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+include_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
  
 ?>
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
@@ -31,11 +32,11 @@
 	<meta http-equiv="pragma" content="no-cache">
 	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
 	<meta name="robots" content="noindex,nofollow">
-	<title>Mapbender Setupchecker</title>
+	<title>Mapbender Setup-Checker</title>
 </head>
 <link rel="stylesheet" type="text/css" href="../css/mapbender.css">
 <body>
-<table  BGCOLOR="#ffffff" width="70%" height="70%" ALIGN="top" CELLSPACING="0" CELLPADDING="10" STYLE="-moz-border-radius:8px; border:2px #000000 solid;">
+<table  BGCOLOR="#ffffff" width="95%" height="95%" ALIGN="center" CELLSPACING="0" CELLPADDING="10" STYLE="-moz-border-radius:8px; border:2px #000000 solid;">
 <tr><td VALIGN="center" STYLE="margin-bottom:0px; padding-bottom:0px;">
 <H1 style="padding:0px; margin:0px; font:32px/32px bold Arial,Helvetica,sans-serif; font-stretch:extra-expanded;font-weight:bold">
 <font align="left"" style="font-weight:bold" color="#000000">&nbsp;Ma</font><font color="#0000CE" style="font-weight:bold">p</font><font color="#C00000">b</font><font color="#000000" style="font-weight:bold">ender</font>
@@ -53,11 +54,11 @@
 ###########################################
 #phpversion
 	$check ="<tr ><td  width=\"25%\">php Version</td>";
-	if (phpversion()>'4.3.0'){
-		if (phpversion()<'5.1.0') $check .="<td width=\"10\"></td><td><font color=#0000FF>Version: " . phpversion() . "! you should think about upgrade to >=php5.1!</td></tr>";
+	if (phpversion()>='5.1.0'){
+		if (phpversion()<'5.2.0') $check .="<td width=\"10\"></td><td><font color=#0000FF>Version: " . phpversion() . "! You should think about upgrade to the current php version (get it <a href='http://www.php.net/downloads.php' target='_blank'>here</a>)</td></tr>";
 		else $check .="<td width=\"10\">X</td><td><font color=#00D000>Version: " . phpversion() . "</td></tr>";
 	}
-	else $check .="<td width=\"10\"></td><td><font color=#FF0000>Version: " . phpversion() . "! your PHP is very old, think about upgrade to >=php5.1!</td></tr>";
+	else $check .="<td width=\"10\"></td><td><font color=#FF0000>Version: " . phpversion() . "! Your PHP Version is very old, please upgrade to version >=5.1.0 to use full mapbender functionality and reduce problems!</td></tr>";
 #php-schnittstelle 
 	if(php_sapi_name() == 'cgi') $check.="<tr><td >interface</td><td>X</td><td><font color=#00D000>CGI-PHP</td></tr>";
 	else $check.="<tr><td >interface</td><td>X</td><td><font color=#00D000>Modul-PHP</td></tr>";
@@ -74,9 +75,14 @@
 	if (get_cfg_var('memory_limit')) $check .="<tr ><td>memory Limit</td><td>X</td><td><font color=#00D000>" . get_cfg_var('memory_limit') . "</font><font color='#0000FF'> (running in memory-trouble with printing? Perhaps raise your memory limit)</font></td></tr>";
 	else $check .="<tr ><td>memory Limit</td><td></td><td><font color=#FF0000>memory_limit must be set (30M will be enough for the moment)</font></td></tr>";
 # error_reporting
+#Error Reporting: 6135 =>error_reporting  =  E_ALL & ~E_NOTICE (6135-8(E_NOTICE))
+#Error Reporting: 1 => error_reporting  =  E_ERROR
+#Error Reporting: 6143 => error_reporting  =  E_ALL
 	$check .="<tr ><td>error-reporting</td>";
-	 if (get_cfg_var('error_reporting')!=2039) $check .="<td></td><td><font color=#FF0000>please set error_reporting to 'E_ALL & ~E_NOTICE' except for testing</td></tr>";
-	 else $check .="<td>X</td><td><font color=#00D000>ok, error_reporting = E_ALL & ~E_NOTICE </td></tr>";
+	 if (get_cfg_var('error_reporting')==6143||get_cfg_var('error_reporting')==8) $check .="<td></td><td><font color=#FF0000>please set error_reporting to 'E_ALL & ~E_NOTICE' or 'E_ERROR' except for debugging</td></tr>";
+	elseif  (get_cfg_var('error_reporting')==6135)$check .="<td>X</td><td><font color=#00D000>ok, error_reporting = E_ALL & ~E_NOTICE</td></tr>";
+	elseif  (get_cfg_var('error_reporting')==1)$check .="<td>X</td><td><font color=#00D000>ok, error_reporting = E_ERROR</td></tr>";
+	else $check .="<td></td><td><font color=#0000FF>(Your error_reporting configuration is not implementet into this test yet. You shoul know what you are doing or set it to E_ALL & ~E_NOTICE)</td></tr>";
 # session.save_handler
 	if (!get_cfg_var('session.save_handler')||get_cfg_var('session.save_handler')!='files') $check .="<tr ><td>session.save_handler</td><td></td><td><font color=#FF0000>session.save_handler must be set to 'session.save_handler = files'!</font></td></tr>";
 	else $check .="<tr ><td>session.save_handler</td><td>X</td><td><font color=#00D000>session.save_handler = " . get_cfg_var('session.save_handler') . "</font></td></tr>"; 
@@ -88,17 +94,18 @@
 	$check .="<tr ><td>allow_url_fopen</td>"; 
 	if (get_cfg_var('allow_url_fopen')=='1') $check .= "<td>X</td><td><font color=#00D000>On</font></td></tr>";
 	else $check .= "<td></td><td><font color=#FF0000>Off =>allow_url_fopen must be on read <a href='http://www.mapbender.org/index.php/Allow_url_fopen' target=_blank>this</a></font></td></tr>";
+# short_open_tag 
+	$check .="<tr ><td>short_open_tag</td>"; 
+	if (get_cfg_var('short_open_tag')!='1') $check .= "<td>X</td><td><font color=#00D000>Off</font></td></tr>";
+	else $check .= "<td></td><td><font color=#FF0000>On => Displaying XML files will not work properly</font></td></tr>";
 	echo $check;
 #################################################
 #PHP Extensioncheck
 #################################################
-#MYSQL
 	?>
-	</table>
-	<br><br>
-	<table style="border: 2px solid rgb(128, 128, 128); -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -moz-border-radius-bottomright: 8px; -moz-border-radius-bottomleft: 8px;" bgcolor=#dddddd cellspacing=0 cellpadding=0 width="95%">
 	<th colspan="3" bgcolor=#F0F0F0>PHP Extensioncheck</th>
 	<?php
+#MYSQL	
 	if(!extension_loaded('mysql')) $check="<tr ><td width=\"25%\">MySQL check</td><td width=\"10\"></td><td><font color=#FF0000 >MySQL not installed! (You have to include mysql-extension if you want to use MySQL as MB-Database!)</font></td></tr>";
 	else $check="<tr ><td width=\"25%\">MySQL check</td><td width=\"10\">X</td><td><font color=#00D000 >MySQL installed</font></td></tr>";
 #PGSQL
@@ -107,7 +114,16 @@
 #GD
 	if(extension_loaded('gd')) $check.="<tr ><td>GD2 check</td><td>X</td><td><font color=#00D000>GD installed</font></td></tr>";
 	else $check.="<tr ><td>GD2 check</td><td></td><td><font color=#FF0000>GD not installed (no printing possible)</font></td></tr>";
-	echo $check;
+
+#mbstring
+	if(extension_loaded('mbstring')) $check.="<tr ><td>mbstring check</td><td>X</td><td><font color=#00D000>mbstring installed</font></td></tr>";
+	else $check.="<tr ><td>mbstring check</td><td></td><td><font color=#FF0000>PHP extension mbstring is not installed</font></td></tr>";
+
+#gettext
+	if(extension_loaded('gettext')) $check.="<tr ><td>gettext check</td><td>X</td><td><font color=#00D000>gettext installed</font></td></tr>";
+	else $check.="<tr ><td>gettext check</td><td></td><td><font color=#FF0000>PHP extension gettext is not installed</font></td></tr>";
+
+echo $check;	    
 ####################################
 # Database check
 ####################################
@@ -130,22 +146,22 @@
 			$con_postgis = pg_connect($con_string);
 			$sql = "Select postgis_full_version();";
 			$res = pg_query($con_postgis,$sql);
-			if(!$res) $check .="<tr width=\"20%\><td>PostGIS support</td><td></td><td><font color=#FF0000>no PostGIS function available</tr>";
+			if(!$res) $check .="<tr width=\"20%\><td>PostGIS support</td><td></td><td><font color=#FF0000>no PostGIS function available</td></tr>";
 			else{
 				$cnt=0;
 				while(pg_fetch_row($res)){
-					$check .="<tr><td>PostGIS support</td><td>X</td><td><font color=#00D000>PostGIS function available</tr>";
+					$check .="<tr><td>PostGIS support</td><td>X</td><td><font color=#00D000>PostGIS function available</td></tr>";
 					$check .="<tr><td>Version</td><td>X</td><td><font color=#00D000>" . pg_fetch_result($res,$cnt,0). "</td></tr>";
 		  		  	$cnt++;
 		  		}
-				if ($cnt==0) $check .="<tr><td>PostGIS support</td><td></td><td><font color=#FF0000>no PostGIS function available</tr>";
+				if ($cnt==0) $check .="<tr><td>PostGIS support</td><td></td><td><font color=#FF0000>no PostGIS function available</td></tr>";
 			}
 		}
-		else $check .="<tr><td>Postgis support</td><td></td><td><font color=#FF0000>no PostGIS function available</font></tr>";
+		else $check .="<tr><td>Postgis support</td><td></td><td><font color=#FF0000>no PostGIS function available</font></td></tr>";
 		echo $check;
 	}
 	else{
-		$check = "<tr><td width=\"25%\">Administration Database</td><td>X</td><td><font color=#00D000>PostgreSQL</td><tr>";
+		$check = "<tr><td width=\"25%\">Administration Database</td><td>X</td><td><font color=#00D000>PostgreSQL</td></tr>";
 		$check .= "<tr><td>Connect to Database</td>";
 		if($con) $check .="<td width=\"10\">X</td><td><font color=#00D000>connected</font></td></tr>";
 		else $check .="<td width=\"10\"></td><td><font color=#FF0000>not connected</font></td></tr>";
@@ -163,9 +179,6 @@
 # PostGIS check
 ######################################	
 	?>
-	</table>
-	<br><br>
-	<table style="border: 2px solid rgb(128, 128, 128); -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -moz-border-radius-bottomright: 8px; -moz-border-radius-bottomleft: 8px;" bgcolor=#dddddd cellspacing=0 cellpadding=0 width="95%">
 	<th colspan="3" bgcolor=#F0F0F0>PostGIS check</th>
 	<?php
 		$check ="";
@@ -173,18 +186,18 @@
 			$sql = "select postgis_full_version();";
 			if (pg_query($con,$sql))$res = pg_query($con,$sql);
 			else echo "<tr><td><font>pg_query($con,$sql)";
-			if(!$res) $check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</tr>";
+			if(!$res) $check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</td></tr>";
 			else{
 				$cnt=0;
 				while(pg_fetch_row($res)){
-					$check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\">X</td><td><font color=#00D000>PostGIS function available</tr>";
+					$check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\">X</td><td><font color=#00D000>PostGIS function available</td></tr>";
 					$check .="<tr><td>Version</td><td width=\"10\">X</td><td><font color=#00D000>" . pg_fetch_result($res,$cnt,0). "</td></tr>";
 		  		  	$cnt++; 	
 		  		}
-				if ($cnt==0) $check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</tr>";
+				if ($cnt==0) $check .="<tr><td width=\"25%\">PostGIS support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</td></tr>";
 			}
 		}
-		else $check .="<tr><td width=\"25%\">Postgis support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</font></tr>";
+		else $check .="<tr><td width=\"25%\">Postgis support</td><td width=\"10\"></td><td><font color=#FF0000>no PostGIS function available</font></td></tr>";
 		echo $check;
 	} 
 #################################
@@ -194,7 +207,7 @@
 	</table>
 	<br><br>
 	<table style="border: 2px solid rgb(128, 128, 128); -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; -moz-border-radius-bottomright: 8px; -moz-border-radius-bottomleft: 8px;" bgcolor=#dddddd cellspacing=0 cellpadding=0 width="95%">
-	<th colspan="3" bgcolor=#F0F0F0>mapbender.conf check</th>
+	<th colspan="4" bgcolor=#F0F0F0>Mapbender Configuration Check</th>
 	<?php 
 # SYS_DBTYPE
 	if ((SYS_DBTYPE == 'mysql' || SYS_DBTYPE == 'pgsql') && defined('SYS_DBTYPE')) $check ="<tr><td>Administration Database</td><td >X</td><td><font color=#00D000>" . SYS_DBTYPE . "</font></td></tr>";
@@ -211,29 +224,64 @@
 # PREPAREDSTATEMENTS
 	if (defined('PREPAREDSTATEMENTS')){
 		if (PREPAREDSTATEMENTS == true){
-			if (phpversion()<'5.1.0') $check.="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\"></td><td><font color=\"#ff0000\">PREPAREDSTATEMENTS =set to 'true' and php version " . phpversion() . " is incompatible<br>set PREPAREDSTATEMENTS to false or update php to >=5.1</td></tr>";
-			else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'true' and php " . phpversion() . " should work</td><tr/>";
+			if (phpversion()<'5.1.0') $check.="<tr><td width=\"25%\">PREPAREDSTATEMENTS</td><td width=\"10\"></td><td><font color=\"#ff0000\">PREPAREDSTATEMENTS =set to 'true' and php version " . phpversion() . " is incompatible<br>set PREPAREDSTATEMENTS to false or update php to >=5.1</td></tr>";
+			else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS</td><td width=\"10\">X</td><td><font color=#00D000>set to 'true' and php " . phpversion() . " should work</td></tr>";
 		}
 		else{
-			if (phpversion()<'5.1.0') $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'false' and php " . phpversion() . " should work </font><font color='#0000FF'> (but think about upgrading to php 5.1)</td><tr/>";
-			else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'false' and php " . phpversion() . " should work <font color=#0000FF>(but you can set PREPAREDSTATEMENTS to 'true')</font></td><tr/>";
+			if (phpversion()<'5.1.0') $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'false' and php " . phpversion() . " should work </font><font color='#0000FF'> (but think about upgrading to php 5.1)</td></tr>";
+			else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\">X</td><td><font color=#00D000>set to 'false' and php " . phpversion() . " should work <font color=#0000FF>(but you can set PREPAREDSTATEMENTS to 'true')</font></td></tr>";
 		}
 	}
-    else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\"></td><td><font color=#FF0000>PREPAREDSTATEMENTS is not defined</td><tr/>";
+    else $check .="<tr><td width=\"25%\">PREPAREDSTATEMENTS-<br>compatibility</td><td width=\"10\"></td><td><font color=#FF0000>PREPAREDSTATEMENTS is not defined</td></tr>";
 # CHARSET
 	if (CHARSET != "" && defined('CHARSET')) $check .="<tr><td>CHARSET</td><td>X</td><td><font color=#00D000>" . CHARSET . "</font><font color='#0000FF'></font></td></tr>";
 	else $check .="<tr><td>CHARSET</td><td></td><td><font color=#FF0000>CHARSET is not defined</font></td></tr>";
 # TMPDIR
 	if (TMPDIR != "" && defined('TMPDIR')) $check .="<tr><td>TMPDIR</td><td>X</td><td><font color=#00D000>" . TMPDIR . "</font><font color='#0000FF'></font></td></tr>";
 	else $check .="<tr><td>TMPDIR</td><td></td><td><font color=#FF0000>TMPDIR is not defined</font></td></tr>";
+# OWSPROXY
+	if (OWSPROXY != "" && defined('OWSPROXY')) $check .="<tr><td>OWSPROXY</td><td>X</td><td><font color=#00D000>" . OWSPROXY . "</font><font color=#0000FF> (Is this the right URL to your OWSPROXY?)</font></td></tr>";
+	else $check .="<tr><td>OWSPROXY</td><td></td><td><font color=#FF0000>OWSPROXY not defined</font><font color=#0000FF>(if you want to camouflage your WMS, you should think about OWSPROXY!)</font></td></tr>";
+#AUTO_UPDATE
+	if (AUTO_UPDATE != "" && defined('AUTO_UPDATE')){
+		if (AUTO_UPDATE == '1'){ 
+			$check .="<tr><td>AUTO_UPDATE</td><td>X</td><td>set to 1: will update all out-of-date WMS automatically<td></tr>";
+			if (!TIME_LIMIT || TIME_LIMIT == "")$check .="<tr><td>TIME_LIMIT</td><td></td><td><font color=#FF0000>you should define a TIME_LIMIT for the AUTO_UPDATE funtionallity</font><td></tr>";
+		}
+		elseif (AUTO_UPDATE == '0') $check .="<tr><td>AUTO_UPDATE</td><td>X</td><td><font color=#00D000>set to 0:</font> <font color=#0000FF>(see the result of the test and update WMS manually)</font></td></tr>";
+		else $check .="<tr><td>AUTO_UPDATE</td><td></td><td><font color=#FF0000>set to " . AUTO_UPDATE . ": this configuration value is not supported(as yet!)</td></tr>";
+	} 			    	
+	else $check .="<tr><td>AUTO_UPDATE</td><td></td><td><font color=#FF0000>AUTO_UPDATE not defined </font><font color=#0000FF>(for the wms monitoring 	functionality you have to define this constant)</font></td></tr>";
+# ERROR LOGGING
+	$testLog = new mb_notice("This is a test run by the Mapbender setup script.");
+	if ($testLog->result) {
+		$check .="<tr><td>ERROR LOGGING</td><td>X</td><td><font color=#00D000>" . $testLog->message . "</font></td></tr>";		
+	}
+	else {
+		$check .="<tr><td>ERROR LOGGING</td><td></td><td><font color=#FF0000>" . $testLog->message . "</font></td></tr>";		
+	}
+#LOG_LEVEL (off,error,warning,all)
+	if (LOG_LEVEL !="" && defined('LOG_LEVEL')){
+		if (LOG_LEVEL =='off') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td>switched off: <font color=#FF0000>-no Mapbender-errors logging</font><td></tr>"; 
+		elseif (LOG_LEVEL =='error') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'error': </font><font color=#0000FF>-Mapbender-errors will be logged</font><td></tr>";
+		elseif (LOG_LEVEL =='warning') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'warning: </font><font color=#0000FF>- Mapbender-errors and -warnings will be logged</font><td></tr>";
+		elseif (LOG_LEVEL =='all') $check .="<tr><td>LOG_LEVEL</td><td>X</td><td><font color=#00D000>set to 'all': </font><font color=#0000FF>-really every little notice will be logged!!</font><td></tr>";
+		else $check .="<tr><td>LOG_LEVEL</td><td></td><td><font color=#FF0000>set to " . LOG_LEVEL . ": this configuration value is not supported (as yet!)</font></td></tr>";		
+	}	
+# PORTAL
+	if (defined('PORTAL')){
+		if (PORTAL == true) $check .="<tr><td width=\"25%\">PORTAL</td><td width=\"10\">X</td><td><font color=#00D000>true</font><font color='#0000FF'> (Users can create theirs own accounts)</font></td></tr>";
+		else $check .="<tr><td width=\"25%\">PORTAL</td><td width=\"10\">X</td><td><font color=#00D000>false<font color=#0000FF> (Users can't create their own accounts at the moment)</font></td></tr>";
+	}
+    else $check .="<tr><td width=\"25%\">PORTAL</td><td width=\"10\"></td><td><font color=#FF0000>PORTAL is not defined<font color=#0000FF>(Maybe an old configuration file?)</font></td></tr>";
 # MAXLOGIN
 	if (MAXLOGIN != "" && defined('MAXLOGIN')) $check .="<tr><td>MAXLOGIN</td><td>X</td><td><font color=#00D000>" . MAXLOGIN . "</font><font color='#0000FF'></font></td></tr>";
-	else $check .="<tr><td>MAXLOGIN</td><td></td><td><font color=#FF0000>MAXLOGIN is not defined</font></td></tr>";		    	
+	else $check .="<tr><td>MAXLOGIN</td><td></td><td><font color=#0000FF>MAXLOGIN is not defined</font></td></tr>";		    	
 # LOGIN
-	if (defined('LOGIN')) $check .= "<tr height=10/><tr><td>Login-Path</td><td colspan=2><a href='" . LOGIN . "' target='_blank'>" . LOGIN . "</a><br><font color=#0000FF> (if this link doesn't work, check out your 'URL to Login' in your mapbender.conf<br>Perhaps an alias in your httpd.conf will solve the prob')</td>";
+	if (defined('LOGIN')) $check .= "<tr height=10/><tr><td>Login-Path</td><td colspan=2><a href='" . LOGIN . "' target='_blank'>" . LOGIN . "</a><br><font color=#0000FF> (If this link doesn't work, check your url to 'Login' in your mapbender.conf<br>Perhaps an alias in your httpd.conf will solve the problem, too)</td>";
 	else $check .= "<tr height=10/><tr><td>Login-Path</td><td colspan=2><font color=#FF0000>LOGIN is not defined</font></td>";
 	echo $check;	
-	echo "<tr height=10/><tr bgcolor=#F0F0F0><td colspan=3>Legend:<br><font color=#FF0000>red = maybe your Mapbender will run into trouble</font><br><font color=#0000FF>blue = just a tip</font><br><font color=#00D000>green = seems to be alright</font></td></tr>";
+	echo "<tr height=10/><tr bgcolor=#F0F0F0><td colspan=4>Legend:<br><font color=#FF0000>red = maybe your Mapbender will run into trouble</font><br><font color=#0000FF>blue = just a tip</font><br><font color=#00D000>green = seems to be alright</font></td></tr>";
 	echo "</table>";
 	echo "<tr><td colspan=3 align=right>for further informations visit <a href=\"http://www.mapbender.org/index.php/Installation_en\" target=\"_blank\"><font align=\"left\" style=\"font-weight:bold\" color=\"#000000\">&nbsp;Ma</font><font color=\"#0000CE\" style=\"font-weight:bold\">p</font><font color=\"#C00000\" style=\"font-weight:bold\">b</font><font color=\"#000000\" style=\"font-weight:bold\">ender</font> installation instructions</a></td></tr>";
 	?>



More information about the Mapbender_commits mailing list