[Mapbender-commits] r4088 - in branches/print_dev: . conf core http http/classes http/css http/html http/javascripts http/php lib resources/db/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jun 23 06:57:59 EDT 2009


Author: mschulz
Date: 2009-06-23 06:57:59 -0400 (Tue, 23 Jun 2009)
New Revision: 4088

Modified:
   branches/print_dev/Changes.txt
   branches/print_dev/conf/wfs_additional_spatial_search.conf
   branches/print_dev/core/system.php
   branches/print_dev/http/classes/class_user.php
   branches/print_dev/http/classes/class_wfs_configuration.php
   branches/print_dev/http/css/tablesorter.css
   branches/print_dev/http/html/mod_treefolderPlain.php
   branches/print_dev/http/index.php
   branches/print_dev/http/javascripts/initWms.php
   branches/print_dev/http/javascripts/jsTree.js
   branches/print_dev/http/javascripts/map.js
   branches/print_dev/http/javascripts/map.php
   branches/print_dev/http/javascripts/map_obj.js
   branches/print_dev/http/javascripts/mapnf.php
   branches/print_dev/http/javascripts/mod_addWMS.php
   branches/print_dev/http/javascripts/mod_addWMSfromfilteredList.php
   branches/print_dev/http/javascripts/mod_add_SLD.php
   branches/print_dev/http/javascripts/mod_add_vendorspecific.php
   branches/print_dev/http/javascripts/mod_adminNavigation.js
   branches/print_dev/http/javascripts/mod_copyright.php
   branches/print_dev/http/javascripts/mod_digitize_tab.php
   branches/print_dev/http/javascripts/mod_featureInfoTunnel.php
   branches/print_dev/http/javascripts/mod_gazetteerSQL_client.php
   branches/print_dev/http/javascripts/mod_home.php
   branches/print_dev/http/javascripts/mod_initWmc.php
   branches/print_dev/http/javascripts/mod_insertKmlIntoDb.php
   branches/print_dev/http/javascripts/mod_insertLayerPreviewIntoDb.php
   branches/print_dev/http/javascripts/mod_loadwmc.js
   branches/print_dev/http/javascripts/mod_loadwmc.php
   branches/print_dev/http/javascripts/mod_perimeter.php
   branches/print_dev/http/javascripts/mod_poi.php
   branches/print_dev/http/javascripts/mod_reload.php
   branches/print_dev/http/javascripts/mod_renderGML.php
   branches/print_dev/http/javascripts/mod_resize_mapsize.php
   branches/print_dev/http/javascripts/mod_sandclock.php
   branches/print_dev/http/javascripts/mod_saveLayerPreview.php
   branches/print_dev/http/javascripts/mod_saveWmcKml.php
   branches/print_dev/http/javascripts/mod_savewmc.php
   branches/print_dev/http/javascripts/mod_scaleSel.php
   branches/print_dev/http/javascripts/mod_setPOI2Scale.php
   branches/print_dev/http/javascripts/mod_setTimeout.php
   branches/print_dev/http/javascripts/mod_switchLocale_noreload.php
   branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php
   branches/print_dev/http/javascripts/mod_zoomFull.php
   branches/print_dev/http/javascripts/mod_zoomIn1.php
   branches/print_dev/http/javascripts/mod_zoomOut1.php
   branches/print_dev/http/javascripts/ovnf.php
   branches/print_dev/http/javascripts/requestGeometryConstructor.js
   branches/print_dev/http/javascripts/wfs_obj.js
   branches/print_dev/http/php/createImageFromText.php
   branches/print_dev/http/php/mb_listGUIs.php
   branches/print_dev/http/php/mod_SelectKeyword.php
   branches/print_dev/http/php/mod_WMSpreferences.php
   branches/print_dev/http/php/mod_addWmsFromFeatureInfo.php
   branches/print_dev/http/php/mod_category_filteredGUI.php
   branches/print_dev/http/php/mod_createJSObjFromDBByWMS.php
   branches/print_dev/http/php/mod_createJSObjFromXML.php
   branches/print_dev/http/php/mod_deleteWFS.php
   branches/print_dev/http/php/mod_editApplication_server.php
   branches/print_dev/http/php/mod_editElements.php
   branches/print_dev/http/php/mod_editWMS_Metadata.php
   branches/print_dev/http/php/mod_exportMapImage_server.php
   branches/print_dev/http/php/mod_featuretypeMetadata.php
   branches/print_dev/http/php/mod_gazetteerMetadata.php
   branches/print_dev/http/php/mod_gazetteerMetadata_search.php
   branches/print_dev/http/php/mod_gazetteerSQL_server.php
   branches/print_dev/http/php/mod_layerMetadata.php
   branches/print_dev/http/php/mod_loadCapabilitiesList.php
   branches/print_dev/http/php/mod_loadwfs.php
   branches/print_dev/http/php/mod_log.php
   branches/print_dev/http/php/mod_owsproxy_conf.php
   branches/print_dev/http/php/mod_wfs.php
   branches/print_dev/http/php/mod_wfsSpatialRequest_messages.php
   branches/print_dev/http/php/mod_wfs_gazetteer_server.php
   branches/print_dev/http/php/mod_wfs_result.php
   branches/print_dev/http/php/mod_zoomCoords.php
   branches/print_dev/lib/buttonNew.js
   branches/print_dev/lib/core.js
   branches/print_dev/lib/exception.js
   branches/print_dev/lib/point.js
   branches/print_dev/lib/style.js
   branches/print_dev/resources/db/update/update_2.7.sql
Log:
merged from trunk

Modified: branches/print_dev/Changes.txt
===================================================================
--- branches/print_dev/Changes.txt	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/Changes.txt	2009-06-23 10:57:59 UTC (rev 4088)
@@ -2,418 +2,51 @@
 
 http://www.mapbender.org/index.php/Version_History
 
-------------------------
+Also have a look in the trac for detailed informations:
+http://trac.osgeo.org/mapbender/query?status=closed&milestone=2.5.1+release
 
-Changelog 2.4.2
+Changelog 2.6
 
-  english
+see
 
-    bug fixes: see http://trac.osgeo.org/mapbender/report/9
+http://trac.osgeo.org/mapbender/query?status=closed&group=type&milestone=2.6+release&order=priority
 
-    new features
 
-    * set WMS opacity in treeGDE2
-    * Bulgarian translation of the introduction to Mapbender
-    * improved module Add WMS from filtered list: loading a configured WMS from a GUI is now possible
-    * updated Meetingpoint / Treffpunkt: new image, some bugfixes
-    * improved exception handling / log levels (see mapbender.conf#Mapbender_error_logging)
-    * poi (not included in a GUI yet)
-    * JavaScript compression; Mapbender will load faster
-    * dynamic overview - integration in the rc1 an testing gui2
-    * treeGDE2 replaces treeGDE
-    * different configurations of treeGDE2
-    * first draft of an API documentation for JavaScript classes
-    * print temporary objects (lines and polygons) which where drawn with the measure element 
 
-  deutsch
+------------------------
+Changelog 2.5.1
 
-    behobene Fehler: siehe http://trac.osgeo.org/mapbender/report/9
-
-    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
-    * 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
-    * 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 
-
-
-Changelog 2.4.1
-
-english
-
-
-
-new features
-
-bug fixes
-
-    * 1658777 Export GUI SQL unsorted
-    * 1634035 Wfs geometry name not sorted by position
-    * 1647206 sort order of modules in gui element list
-    * 1635839 JS error: document.form1.newGuiName has no properties
-    * 1589764 wms loading problems when abstract contain linebreak
-    * 1653348 mod_filteredGroup_filteredGui.php
-    * 1653160 Metadata: Undefined variable: wms_id
-    * 3 Online resource incorrect in monitoring module 
-    * 11 wrong sort order in edit_gui_wms
-
-
-database changes
-
-see latest database changes.
-
-deutsch
-
-Changelog Mapbender 2.4.1 rc1
-
-english
-
-    * changes in database architecture: For update have a look in the wiki at dbchanges or Database_Changes_2.4.1. The update sqls you find in the download package in the folder mapbender/resources/db/update/
-    * WFS_gazetteer possibility to handle several wfs_confs and choose from a select-box - thanx to User:Verena Diewald
-    * new treeGDE - thanx to User:Melchior Moos
-    * new element setPOI2Scale mod_setPoi2Scale to open a GUI at a special coordinate and scale - have a look Mod_setPoi2Scale
-    * extended ResizeMapsize functionality - Modul can act automatically or by button click. 3 element vars are added.
-    * new administration functionality OrphanWMS to find information about orphaned WMS and to fix them.
-    * new functionality meetingPoint to generate meeting points and export them as text or via email. The url can be displayed by highlightPOI
-    * pdf-Print now with Din-A2 support
-    * new element highlightPOI (mod_highlightPOI.php) to open a gui and set poi points with text
-    * metadata handling
-    * new admin guis
-    * wfs bug fix for digitize modul
-    * featureinfo tunnel closes empty result windows automatically 
-
-
-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
-    * 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 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.
-    * Metadaten handling.
-    * Featureinfotunnel schlie�t leere Fenster ohne Ergebnis gleich wieder. 
-
-
-Changelog Mapbender 2.4
-
-english
-
-    * bugs in loadWMC are fixed
-    * new module resizeMapsize to resize the Mapsize depending on the size of the browser window
-    * new module monitorCapabilities: periodically checks all WMS and gathers data in the new table mb_monitor (see Database_Changes_2.4)
-    * new module initWMC: starts the client with a wmc.
-    * wms_extent - WMS representing the EXTENTs of the WMS loaded in Mapbender 
-
-
-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 initWMC: startet den Client mit einem WMS.
-    * wms_extent - WMS, der die Ausdehnungen (Extent) der in Mapbender geladenen WMSe anzeigt. 
-
-
-Changelog 2.4 rc2
-
-english
-
-    * mapbender changed to Subversion (svn), big effort is done in code cleaning
-    * owsproxy is implemented
-    * treeGDE improved, now there is the possibility to handle the layers of a wms with one click (all layer on / all layer off). new element var switchwms
-    * bugs in legend solved
-    * changes in database architecture: new table wfs_featuretype_namespace, new column wms_owsproxy in table wms, new column wms_upload_url in table wms. For update have a look at dbchanges or Database Changes 2.4
-    * perpared statements for PHP > 5.1.x, PostgreSQL > 7.4
-    * new gui_digitize in the installation package. Read more about Digitizing
-    * new gui2 in the installation package with new buttons (button_blue), new tree-style (tree_blue) and more color.
-    * default md5-encryption for the passwords in MySQL and PostgreSQL. Mapbender is doing the md5-encryption.
-    * extended mapbender_setup.php with more information (Thanks to Marko Samson)
-    * new element deleteWFS in GUI admin1
-    * printPDF: highquality print and matching for the overview image
-    * new help: every element in the gui refers to a page in the Mapbender wiki. The link is saved in the table gui_element column e_url and can be changed individual. 
-
-
-deutsch
-
-    * 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.
-    * 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
-    * 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.
-    * 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. 
-
-
-Changelog 2.2.3
-
-english
-
-    * print: now with overview window with position rectangle and scalebar 
-
-    * gui_de and gui1_de are no longer part of the standard installation of mapbender, as it is too much work to handle 4 guis. If you want a german gui, you have to change the tool tip texts. In the next versions we want to handle the language differences with element vars. 
-
-    * WMC handling: includes DisplayWMC, loadWMC, saveWMC and listWMC. 
-
-    * element logout: now with element_var logout_location to define the webside to show after logout 
-
-    * the overview window of the pdf-print is now displayed in highquality, if you use highquality = true in your print-configuration 
-
-    * there has been some rework done at the AddWMS functions. Now the mod_addWMSgeneralFunctions.js offers the functions mod_addWMS_load and mod_addWMS_refresh to the elements addWMSfromfilteredList and addWMSfromList IMPORTANT: JS has to be added as modul in the element-definition 
-
-    * element tabs (mod_tab.php) now with element_var open_tab to decide which tab should be opened at the beginning 
-
-    * print : there where errors in the generation of the legend especially with grouped layers 
-
-    * legend : new element_var checkbox_on_off to decide wether you want to show or hide the on/off checkbox - there where errors in the generation of the legend especially with grouped layers 
-
-    * legend: new element var : stickylegend to decide wether the legend should stick at the mapframe1 
-
-    * connection to GEOS function for mysql users: mapbender.conf / mod_changeEPSG.php / mod_evalArea.php - database parameters where added to the mapbender.conf to enable Mapbender user with mysql-Administration to transform and change the projection 
-
-    * encoding of Mapbender: now UTF-8 or ISO-8859-1 can be choosed as the encoding for the database (have a look in the mapbender.conf CHARSET) 
-
-    * fixed: WFS configuration caused errors with postgresql database 
-
-    * copyright now works with element var for the copyright text: define the JavaScript Variable mod_copyright_text with a text you want as value 
-
-    * fixed: there was an error in class_log, now the printed maprequests should be logged 
-
-    * database changes 
-
-
-deutsch
-
-    * 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. 
-
-    * 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. 
-
-    * 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. 
-
-    * 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. 
-
-    * legend: Neue element_var: checkbox_on_off zur Steuerung der on/off checkbox. 
-
-    * 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. 
-
-    * 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. 
-
-    * fixed: Fehler in class_log behoben. 
-
-    * Datenbank�nderungen 
-
-
-Changelog 2.2.2
-
-english
-
-    * Unfortunately there was a bug left in the PostgreSQL database-module. In the edit gui-menu no templates from other guis were shown so that it was impossible to modify guis. 
-
-To fix this, minor changes in the PostgreSQL database-structure were necessary. If you are updating, please do not use an already existing V. 2.2.1-database and create the database with the SQL-dumps attached to this version instead.
-
-
-
-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. 
-
-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
-
-english
-
-We have been a bit quick with the release 2.2 and didn't put the focus on documentation and debugging. But with the help of the users of Mapbender we fixed the bugs and now there is the next Mapbender version for download.
-
-    * There where some bugs when you run Mapbender with PostgreSQL. Hope they are fixed. Have a look at the Installation to find out about how to configure Mapbender (configuration files have been consolidated into ./conf/mapbender.conf) 
-
-    * the name of two columns had to be changed:
-          o mb_log.session changes to mb_log.mb_session (session is a reserved name in postgresql)
-          o gui_element.e_closeTag changed to gui_element.e_closetag (all table- and columnnames are handled in lower case) 
-
-    * Sequences in PostgreSQL: if you use postgresql you have to set sequences for the serial columns so that the next value for the serial is fixed. user mapbender/resources/db/pgsql_serial_set_sequences.sql to set the sequences 
-
-    * changeEPSG and calculating areas at the moment is only possible for user with PostgreSQL/PostGIS database 
-
-
-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.
-
-    * 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)
-
-    * 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 
-
-    * changeEPSG und Fl�chenberechnung steht derzeit nur Benutzern mit einer PostgreSQL-Datenbank zur Verf�gung 
-
-
-Changelog 2.2.0
-[edit]
-english
-
-Here you find a list with the changes in Mapbender 2.2.0:
-
-    * The configuration files have been consolidated into one single mapbender.conf
-    * Now Mapbender 2.2.0 is able to work with MySQL- or PostgreSQL-database. Configure the settings in the mapbender.conf.
-    * You can edit the single elements of a GUI with the Mapbender-Administration (table element_vars/ css-files/ var).
-    * WFS
-    * Proxy
-    * PrintPDF. This module enables you to configure the PrintPDF containing an overview, legend, northarrow and your logo.
-    * Click on a Layer refers to the WMS METADATAURL - new column layer_metadataurl.
-    * The legend is displayed by the LEGENDURL.
-    * New Wiki: To edit the new wiki you have to ask for an account at mailto:info at mapbender.org.
-    * ToggleModule to define a function to be active when the gui is opened 
-
-Here you already find a list with the changes in Mapbender 2.2:
-
-    * Mapbender for MySQL or PostgreSQL
-    * You can edit the single elements of a GUI with the Mapbender-Administration (table element_vars/ css-files/ var)
-    * click on a Layer refers to the WMS METADATAURLD - new column layer_metadataurl
-    * the legend is displayed by the LEGENDURL 
-
-
-deutsch
-
-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).
-    * 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.
-    * 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.
-    * 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:
-
-    * Mapbender f�r MySQL oder PostgreSQL
-    * Anpassung der einzelnen Elemente einer GUI �ber die Mapbender-Administration (element_vars)
-    * Metadataurl
-    * Legendurl 
-
-
-Changelog 2.1.0
-
-english
-
-    * communication by email mail.conf
-    * new button myGUIlist in the administration-guis to go back to the list of myGUIs
-    * New table mb_log
-    * New column in table wms wms_getCapabilities_doc
-    * ChangeEpsg_dynamic
-    * Edit gui shows the images of a gui as little pictures (better orientation)
-    * sql to update the mapbender standard guis Update Mapbender
-    * mapbender/http/tools/validate_db.php - php to update the database and add new columns and tables if necessary
-    * New column layer_dataurl in table layer
-    * New columns legendurl and legendurlformat in table layer_style
-    * New table wms_srs
-    * Security update in Edit GUI Elements 
-
-
-deutsch
-
-    * 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.
-    * 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.
-    * Neue Tabelle wms_srs 
-
-
-Changelog 2.1.0 rc1
-
-english
-
-    * Print with Mapbender Version 2.1.0 pdf-print is used as standard. You have the possibility to choose A4 or A3 and landscape or portrait. The printframe can be styled to your own design by editing a configuration file.
-    * GUIOwner a new parameter <owner> has been added to the user management. This allows a distinction between reading/using a GUI and being allowed to change it ( edit GUI elements). This feature is necessary as a preliminary step to open Mapbender as a portal with anonymous access which is needed to implement Wikimaps functionality. Additionally this enables setting up a hierarchical administration.
-    * Overview The overview map should be addressed with the module Overview, (<Overview0>, <Overview1>, <Overview2>, ... are deprecated). The module can be parameterized with the field "wms". It contains the index of the WMS which should be displayed in the overview map. (starting at 0).
-    * showCoords_div On button click the coordinate of the mouseposition will be displayed below the target (e.g. mapframe1)
-    * Detailed metadatainformation for a GUI. Also information about the last requests as a link.
-    * Additional default GUIs are added to the Mapbender database.
-    * After installing Mapbender a set of worldwide WMS are already contained in several GUIs.
-    * Copy a GUI copyGUI / rename a GUI RenameGUI.
-    * AddWMS Add a new web map service dynamically by entering the URL to an OGC WMS Capabilities document. Current extent, layers and settings are not affected.
-    * Add WMS from list Dynamically add WMS from a list of all OGC WMS contained in the Mapbender database to the current GUI.
-    * Add WMS from filtered list Dynamically add WMS from a list (filtered by group or gui) to a GUI.
-    * setBackground Define several WMS to be displayed in the background.
-    * setBackground_all You can define one or more WMS to be displayed in the background.
-    * DeleteGUI Delete a selected GUI.
-    * DeleteWMS Delete a selected WMS.
-    * Edit GUI Elements - added: GUI description editable.
-    * Edit GUI WMS - added: show WMS ID.
-    * showCoords_div - shows the coordinate below the target (i.e. mapframe1).
-    * setScaleHint - set scale hints for mapframes.
-    * tabs_vertical - handle iframes with vertical tabs.
-    * WMS_preferences - edit service settings of the loaded WMS, change order, remove wms, change settings. 
-
-
-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. 
-
-    * 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.
-    * 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 .
-    * 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.
-    * showCoords_div - Anzeige der Koordinaten unter dem Ziel (target, z.B. mapframe1).
-    * 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
+374	WFS tables column size is too small
+380	missing trsid in data SQL
+28	"change personal settings" cannot be de-activated
+341	add email field to forgotten password dialogue
+364	Overview is not displayed correctly after Load WMC
+64	Digitize Problem with 3 buttons (Stützpunkte) caused by z-index
+304	Cannot load WMS with empty style name
+310	Mapbender.po files contain errors
+311	wrong Sonderzeichen (Encoding) in update_guis_2.4.5_to_2.5_pgsql_UTF-8.sql
+312	i18n Translation does not work on all server class_locale.php
+317	Layer with named styles: gui_layer_style set to null
+320	treeConfGDE does not work, iframe is empty	
+321	Faulty character encoding when loading WMC	
+326	mapbender_setup.php - set php Version to => 5.2.0
+328	Rechtswert/Hochwert mix up in print	
+329	WFS spatial request: Duplicate search results
+330	Spatial Request fails if layer not querylayer
+331	activate element setBBOX in gui (it is needed for modul meeting point)
+333	mod_exportMapImage: class_stripRequest.php => function missing
+349	Add Dokumentation_mapbender25_de.pdf to folder documents
+353	treeGDE2 - element_var switchwms=false shows NULL
+358	treeConfGDE: mb_mapObj[ind] is not defined	
+359	missing and incorrect locales in class_locale.php
+361	PHP Warning: missing parameter 4 for class_bbox, class_point
+362	DB connection for sld-editor in file sld_function_getusersld.php
+373	featureTypeArray is not defined	
+378	Missing line break in map.php causes JS bugs
+295	Change personal settings	
+309	After zoom to digitized geometry, highlight is not updated
+325	Layer style without name: cannot display legend icon
+332	element_var and line-break leads to errors
+346	mod_editGuiWms.php - getCapabilities Request Link
+356	"update" and "delete" button after a digitize error
+313	'ZoomFull' has CloseTag img
\ No newline at end of file

Modified: branches/print_dev/conf/wfs_additional_spatial_search.conf
===================================================================
--- branches/print_dev/conf/wfs_additional_spatial_search.conf	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/conf/wfs_additional_spatial_search.conf	2009-06-23 10:57:59 UTC (rev 4088)
@@ -30,6 +30,11 @@
  */
 var buttonWfs_zIndex = 10;
 
+/**
+ * Displays the icons for wfsInfo, wfsRemove and wfsGeomType 
+ */
+var showWfsIcons = true;
+
 // --------------------------------------------------------
 //
 // General WFS request settings
@@ -42,8 +47,9 @@
 var mb_wfs_tolerance = 8;
 
 /**
- * If spatialRequest is set, show this message
+ * If spatialRequest is set, show this image and this message
  */
+var spatialRequestIsSetImg = '../img/exclamation.png';
 var spatialRequestIsSetMessage = '<?php echo _mb("Spatial filter is set.");?>';
 
 /**
@@ -69,6 +75,28 @@
 
 // --------------------------------------------------------
 //
+// General Form settings
+//
+// --------------------------------------------------------
+
+/**
+ * If the WFS Request is started, show this image while waiting for results
+ */
+var progressIndicatorImg = '../img/indicator_wheel.gif';
+
+/**
+ * If the WFS Request is started, show this text while waiting for results
+ */
+var progressIndicatorText = '<?php echo _mb("Searching...");?>';
+
+/**
+ * If the WFS Request is finished and search results are arranged, show this text while waiting
+ */
+var arrangeResultsText = '<?php echo _mb("Arranging search results...");?>';
+
+
+// --------------------------------------------------------
+//
 // Result geometry highlight settings
 //
 // --------------------------------------------------------

Modified: branches/print_dev/core/system.php
===================================================================
--- branches/print_dev/core/system.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/core/system.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,6 +1,6 @@
 <?php
 # $Id$
-# Copyright (C) 2002 CCGIS 
+# 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
@@ -30,10 +30,15 @@
 define("MB_FEATURE_COUNT", "100");
 define("MB_SECURITY_PROXY", "http://wms1.ccgis.de/mapbender/tools/security_proxy.php?mb_ows_security_proxy=");
 #
-# available log levels 
+# available log levels
 #
 define("LOG_LEVEL_LIST", "off,error,warning,notice,all");
 
 define("ZOOM_MOUSEWHEEL", "1.1");
 
-define("MODULES_NOT_RELYING_ON_GLOBALS", "featureInfo1,gazetteerWFS,back,forward,zoomIn1,zoomOut1,selArea1,pan1,copyright,dependentDiv,dragMapSize,dynamicOverview,FeatureInfoRedirect,highlightPOI,navFrame,sandclock,scaleBar,scaleSel,setBBOX,setPOI2Scale");
+define("MODULES_NOT_RELYING_ON_GLOBALS", 
+	"mapframe1,featureInfo1,gazetteerWFS,back,forward,zoomFull,zoomIn1," . 
+	"zoomOut1,selArea1,pan1,copyright,dependentDiv,dragMapSize," . 
+	"dynamicOverview,FeatureInfoRedirect,highlightPOI,navFrame,sandclock," . 
+	"scaleBar,scaleSelect,setBBOX,setPOI2Scale,reload"
+);

Modified: branches/print_dev/http/classes/class_user.php
===================================================================
--- branches/print_dev/http/classes/class_user.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/classes/class_user.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -99,17 +99,69 @@
 		return $arrayGuis;
 	}	
 	
+	public function getWfsByPermission () {
+		$wfsArray = array();
+		$appArray = $this->getApplicationsByPermission();
+		if (is_array($appArray) && count($appArray) > 0) {
+			$v = array();
+			$t = array();
+			$sql = "SELECT DISTINCT fkey_wfs_id FROM gui_wfs WHERE fkey_gui_id IN (";
+			for ($i = 0; $i < count($appArray); $i++) {
+				if($i > 0) { 
+					$sql .= ",";
+				}
+				$sql .= "$".strval($i+1);
+				
+				array_push($v, $appArray[$i]);
+				array_push($t, "s");
+			}
+			$sql .= ") ORDER BY fkey_wfs_id";
+			
+			$res = db_prep_query($sql,$v,$t);
+			while($row = db_fetch_array($res)){
+				$wfsArray[]= intval($row['fkey_wfs_id']);
+			}			
+		}
+		return $wfsArray;
+	}
+	
+	public function getWfsConfByWfsOwner () {
+		$wfsConfIdArray = array();
+
+		$sql = "SELECT * FROM wfs_conf, wfs WHERE wfs.wfs_owner = $1 AND " . 
+			"wfs_conf.fkey_wfs_id = wfs.wfs_id ORDER BY wfs_conf.wfs_conf_id";
+		$v = array($this->id);
+		$t = array('i');
+		$res = db_prep_query($sql,$v,$t);
+		while($row = db_fetch_array($res)){
+			$wfsConfIdArray[]= $row["wfs_conf_id"];
+		}
+		return $wfsConfIdArray;
+	}
+	
 	/** identifies the IDs of WFS confs where the user is owner
 	 * 
-	 * @param integer userid the user-ID of the current user
+	 * @param Array appIdArray [optional] restrict to certain applications
 	 * @return integer[] the IDs of the wfs_conf-table
 	 */
-	public function getWfsConfByPermission(){
+	public function getWfsConfByPermission () {
 		$userid = $this->id;
 	 	$guisByPer = array();
 //	 	1.
 		$adm = new administration();
 	 	$guisByPer = $adm->getGuisByPermission($userid, true);
+		
+		if (func_num_args() === 1) {
+			$arg1 = func_get_arg(0);
+			if (is_array($arg1)) {
+				$appIdArray = $arg1;
+				
+				$guisByPer = array_intersect($guisByPer, $appIdArray);
+			}
+		}
+		
+//		$e = new mb_exception(serialize($guisByPer));
+		
 //	 	2. 
 		$ownWFSconfs = array();
 		if(count($guisByPer)>0){
@@ -130,7 +182,7 @@
 			$res = db_prep_query($sql,$v,$t);
 			$i=0;
 			while($row = db_fetch_array($res)){
-				$ownWFSconfs[$i] = $row['wfs_conf_id'];
+				$ownWFSconfs[$i] = intval($row['wfs_conf_id']);
 				$i++;
 			}
 		}

Modified: branches/print_dev/http/classes/class_wfs_configuration.php
===================================================================
--- branches/print_dev/http/classes/class_wfs_configuration.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/classes/class_wfs_configuration.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -22,7 +22,12 @@
 require_once(dirname(__FILE__)."/../classes/class_administration.php");
 require_once(dirname(__FILE__)."/../classes/class_json.php");
 
+/**
+ * This is the configuration of a WFS featuretype element. It belongs
+ * to a configuration of a WFS featuretype.
+ */
 class WfsConfigurationElement {
+	var $id;
 	var $name;
 	var $type;
 	var $search;
@@ -39,13 +44,117 @@
 	var $authVarname;
 	var $detailPos;
 	var $operator;
-	var $showDetail;
+	var $showDetail;
+	var $helptext;
+	var $category;
+	
+	/**
+	 * Creates a WFS featuretype element configuration from an object.
+	 * The object presumably comes from a client-side JSON.
+	 * 
+	 * @return WfsConfigurationElement the WFS featuretype element configuration
+	 * @param $obj Object
+	 */
+	public static function createFromObject ($obj) {
+		$element = new WfsConfigurationElement();
+		$element->id = intval($obj->id);
+		$element->name = $obj->name;
+		$element->type = $obj->type;
+		$element->search = intval($obj->search);
+		$element->pos = intval($obj->pos);
+		$element->styleId = $obj->styleId;
+		$element->toUpper = intval($obj->toUpper);
+		$element->edit = intval($obj->edit);
+		$element->label = $obj->label;
+		$element->labelId = $obj->labelId;
+		$element->geom = intval($obj->geom);
+		$element->show = intval($obj->show);
+		$element->mandatory = intval($obj->mandatory);
+		$element->respos = intval($obj->respos);
+		$element->minInput = intval($obj->minInput);
+//		$element->formElementHtmlTemplate = $row["f_html_template"];
+		$element->formElementHtml = $obj->formElementHtml;
+		$element->authVarname = $obj->authVarname;
+		$element->detailPos = intval($obj->detailPos);
+		$element->operator = $obj->operator;
+		$element->showDetail = intval($obj->showDetail);
+		$element->helptext = $obj->helptext;
+		$element->category = $obj->category;
+		return $element;
+	}
+
+	/**
+	 * Inserts a new WFS featuretype element configuration into the database.
+	 * 
+	 * @return Integer the ID of the new row
+	 * @param $wfsConfId Integer The WFS featuretype configuration ID
+	 * @param $el WfsConfigurationElement
+	 */
+	public static function insertIntoDb ($wfsConfId, $el) {
+		$sql = file_get_contents("../../sql/insert_wfs_conf_element.sql");
+		$v = array(
+			$wfsConfId,	$el->id, $el->geom,	$el->search, $el->pos,
+			$el->styleId, $el->toUpper,	$el->label,	$el->labelId,
+			$el->show, $el->respos, $el->formElementHtml, $el->edit,
+			$el->mandatory,	$el->authVarname, $el->operator,
+			$el->showDetail, $el->detailPos, $el->minInput, $el->helptext, $el->category
+		);
+		$t = array(
+			"i", "i", "i", "i", "i", "s", "i", "s", "s", "i", 
+			"i", "s", "i", "i", "s", "s", "i", "i", "i", "s", "s"
+		);
+		
+		$res = db_prep_query($sql, $v, $t);
+		if (!$res) {
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Updates a WFS featuretype element configuration in the database.
+	 * 
+	 * @return Boolean true if succeeded; else false
+	 * @param $el WfsConfigurationElement
+	 */
+	public static function updateInDb ($wfsConfId, $el) {
+		$sql = file_get_contents("../../sql/update_wfs_conf_element.sql");
+		$v = array(
+			$el->geom, $el->search, $el->pos, $el->styleId, $el->toUpper,
+			$el->label,	$el->labelId, $el->show, $el->respos, 
+			$el->formElementHtml, $el->edit, $el->mandatory,
+			$el->authVarname, $el->operator, $el->showDetail, $el->detailPos,  
+			$el->minInput, $el->helptext, $el->category, $el->id, $wfsConfId
+		);
+		$t = array(
+			"i", "i", "i", "s", "i", "s", "s", "i", "i", 
+			"s", "i", "i", "s", "s", "i", "i", "i", "s", "s", "i", "i"
+		);
+		
+		$res = db_prep_query($sql, $v, $t);
+		if (!$res) {
+			return false;
+		}
+		return true;
+	}
 }	
 
 
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+
+
+/**
+ * The configuration of a WFS featuretype.
+ */
 class WfsConfiguration {
 	
 	var $id;
+	var $type;
 	var $wfsId;
 	var $featureTypeId;
 	var $label; 
@@ -101,7 +210,7 @@
 		if ($_SESSION["mb_user_id"]) {
 			$user = new User($_SESSION["mb_user_id"]);
 
-			$allowedWfsConfIds = $user->getWfsConfByPermission();
+			$allowedWfsConfIds = $user->getWfsConfByWfsOwner();
 
 			$idArray = array_intersect(array($this->id), $allowedWfsConfIds);
 
@@ -109,10 +218,168 @@
 				return true;
 			}
 		}
+		$e = new mb_exception("User '" . $_SESSION["mb_user_id"] . "' is not allowed to access Wfs conf " . $this->id . ".");
 		return false;
 	}
 	
 	/**
+	 * Creates a new WFS configuration form an object,
+	 * presumably originating from a client side JSON
+	 * generated from a form.
+	 * 
+	 * @return Integer ID of the new object in the database
+	 * @param $obj Object
+	 */
+	public static function createFromObject ($obj) {		
+		$wfsConf = new WfsConfiguration();
+
+		//
+		// use case: existing WFS conf
+		//
+		if ($obj->id !== null) {
+			$wfsConf->id = intval($obj->id);
+			if (!$wfsConf->accessAllowed()) {
+				return null;
+			}
+		}
+		//
+		// use case: new WFS conf
+		//
+		else {
+			// TO DO: check if access is allowed!
+			// (use the new WFS classes for this)
+			$wfsConf->wfsId = intval($obj->wfsId);
+			$wfsConf->featureTypeId = intval($obj->featuretypeId);
+		}
+	 
+		$wfsConf->type = intval($obj->type);
+		$wfsConf->label = $obj->label;
+		$wfsConf->labelId = $obj->labelId;
+		$wfsConf->button = $obj->button;
+		$wfsConf->buttonId = $obj->buttonId;
+		$wfsConf->style = $obj->style;
+		$wfsConf->buffer = floatval($obj->buffer);
+		$wfsConf->resStyle = $obj->resStyle; 
+		$wfsConf->abstr = $obj->abstr;
+		$wfsConf->description = $obj->description;
+
+		for ($i = 0; $i < count($obj->elementArray); $i++) {
+			$element = WfsConfigurationElement::createFromObject($obj->elementArray[$i]);
+			$wfsConf->elementArray[]= $element;
+		}
+		return $wfsConf;
+	}	
+
+	/**
+	 * Update an existing WFS configuration in the database.
+	 * 
+	 * @return Boolean true if update succeeds; else false
+	 * @param $wfsConf WfsConfiguration the WFS configuration
+	 */
+	public static function updateInDb ($wfsConf) {
+		if (!$wfsConf->accessAllowed()) {
+			return false;
+		}
+		db_begin();
+
+		$sql = file_get_contents("../../sql/update_wfs_conf.sql");
+		$v = array(
+			$wfsConf->abstr, $wfsConf->label, $wfsConf->labelId, 
+			$wfsConf->button, $wfsConf->buttonId, $wfsConf->style, 
+			$wfsConf->buffer, $wfsConf->resStyle, $wfsConf->description, 
+			$wfsConf->type, $wfsConf->id
+		);
+		$t = array(
+			"s", "s", "s", "s", "s", "s", "d", "s", "s", "i", "i"
+		);
+		$res = db_prep_query($sql, $v, $t);
+		if (!$res) {
+			$e = new mb_exception("WFS Conf update failed.");
+			db_rollback();
+			return false;
+		}
+		
+		//
+		// Update WFS featuretype conf elements
+		//
+		for ($i = 0; $i < count($wfsConf->elementArray); $i++) {
+			$el = $wfsConf->elementArray[$i];
+			$success = WfsConfigurationElement::updateInDb($wfsConf->id, $el);
+			if (!$success) {
+				db_rollback();
+				return null;
+			}
+		}		
+
+		db_commit();
+		return true;
+	}
+	
+	/**
+	 * Inserts a new WFS featuretype configuration into the database.
+	 * 
+	 * @return Integer the ID of the new WFS configuration
+	 * @param $wfsConf WfsConfiguration
+	 */
+	public static function insertIntoDb ($wfsConf) {
+		if (!$wfsConf->wfsId || !$wfsConf->featureTypeId) {
+			return null;
+		}
+
+		db_begin();
+		
+		$sql = file_get_contents("../../sql/insert_wfs_conf.sql");
+		$v = array(
+			$wfsConf->abstr, $wfsConf->wfsId, $wfsConf->featureTypeId,
+			$wfsConf->label, $wfsConf->labelId, $wfsConf->button, 
+			$wfsConf->buttonId, $wfsConf->style, $wfsConf->buffer, 
+			$wfsConf->resStyle, $wfsConf->description, $wfsConf->type
+		);
+		$t = array(
+			"s", "i", "i", "s", "s", "s", "s", "s", "d", "s", "s", "i"
+		);
+		$res = db_prep_query($sql, $v, $t);
+		if (!$res) {
+			$e = new mb_exception("WFS Conf insert failed.");
+			db_rollback();
+			return null;
+		}
+		
+		//
+		// get ID of this WFS conf
+		//
+		$sql = "SELECT max(wfs_conf_id) AS max_id FROM wfs_conf";
+		$res = db_query($sql);
+		if (!$res) {
+			db_rollback();
+			return null;
+		}
+		$row = db_fetch_array($res);
+		$id = $row["max_id"];
+		if (!$id) {
+			db_rollback();
+			return null;
+		}
+
+		//
+		// insert WFS conf elements
+		//
+		for ($i = 0; $i < count($wfsConf->elementArray); $i++) {
+			$el = $wfsConf->elementArray[$i];
+			$success = WfsConfigurationElement::insertIntoDb($id, $el);
+			if (!$success) {
+				db_rollback();
+				return null;
+			}
+		}		
+
+		db_commit();
+		return $id;
+	}
+	
+
+	
+	/**
 	 * Creates an object from the database.
 	 * Maybe we could have a factory for this later...let's
 	 * keep it simple for now
@@ -141,6 +408,8 @@
         $res = db_prep_query($sql, $v, $t);
         $row = db_fetch_array($res);
 		
+		$wfsConf->abstr = $row["wfs_conf_abstract"];
+		$wfsConf->description = $row["wfs_conf_description"];
 		$wfsConf->label = $row["g_label"];
 		$wfsConf->labelId = $row["g_label_id"];
 		$wfsConf->style = $row["g_style"];
@@ -148,13 +417,15 @@
 		$wfsConf->buttonId = $row["g_button_id"];
 		$wfsConf->buffer = $row["g_buffer"];
 		$wfsConf->resStyle = $row["g_res_style"];
-		$wfsConf->wfsId = $row["fkey_wfs_id"];
-		$wfsConf->featureTypeId = $row["fkey_featuretype_id"];
+		$wfsConf->wfsId = intval($row["fkey_wfs_id"]);
+		$wfsConf->type = intval($row["wfs_conf_type"]);
+		$wfsConf->featureTypeId = intval($row["fkey_featuretype_id"]);
 
 		$sql = <<<SQL
 SELECT * FROM wfs_conf_element JOIN wfs_element 
 ON wfs_conf_element.f_id = wfs_element.element_id 
-WHERE wfs_conf_element.fkey_wfs_conf_id = $1
+WHERE wfs_conf_element.fkey_wfs_conf_id = $1 
+ORDER BY wfs_conf_element.f_id
 SQL;
 		$v = array($wfsConf->id);
 		$t = array('i');
@@ -164,28 +435,35 @@
 		while ($row = db_fetch_array($res)) {
 			$element = new WfsConfigurationElement();
 
+			$element->id = intval($row["element_id"]);
 			$element->name = $row["element_name"];
 			$element->type = $row["element_type"];
-			$element->search = $row["f_search"];
+			$element->search = intval($row["f_search"]);
+			$element->pos = intval($row["f_pos"]);
+			$element->edit = intval($row["f_edit"]);
 			$element->styleId = $row["f_style_id"];
-			$element->toUpper = $row["f_toupper"];
+			$element->toUpper = intval($row["f_toupper"]);
 			$element->label = $row["f_label"];
 			$element->labelId = $row["f_label_id"];
-			$element->geom = $row["f_geom"];
-			$element->show = $row["f_show"];
-			$element->mandatory = $row["f_mandatory"];
-			$element->respos = $row["f_respos"];
-			$element->minInput = $row["f_min_input"];
-			$element->formElementHtml = $row["f_form_element_html"];
+			$element->geom = intval($row["f_geom"]);
+			$element->show = intval($row["f_show"]);
+			$element->mandatory = intval($row["f_mandatory"]);
+			$element->respos = intval($row["f_respos"]);
+			$element->minInput = intval($row["f_min_input"]);
+//			$element->formElementHtmlTemplate = $row["f_html_template"];
+			$element->formElementHtml = stripslashes($row["f_form_element_html"]);
 			$element->authVarname = stripslashes($row["f_auth_varname"]);
-			$element->detailpos = $row["f_detailpos"];
+			$element->detailPos = intval($row["f_detailpos"]);
 			$element->operator = $row["f_operator"];
-			$element->showDetail = $row["f_show_detail"];
+			$element->showDetail = intval($row["f_show_detail"]);
+			$element->helptext = $row["f_helptext"];
+			$element->category = $row["f_category_name"];
 
-			array_push($wfsConf->elementArray, $element);
+			$wfsConf->elementArray[]= $element;
 		}
-		
+
+		$wfsConf->id = intval($id);
 		return $wfsConf;
 	}
 }
-?>
\ No newline at end of file
+?>

Modified: branches/print_dev/http/css/tablesorter.css
===================================================================
--- branches/print_dev/http/css/tablesorter.css	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/css/tablesorter.css	2009-06-23 10:57:59 UTC (rev 4088)
@@ -26,8 +26,11 @@
 	vertical-align: top;
 }
 table.tablesorter tbody tr.odd td {
-	background-color:#F0F0F6;
+	background-color:#CFD2D4;
 }
+table.tablesorter tbody tr.even td {
+	background-color:#FFFFFF;
+}
 table.tablesorter thead tr .headerSortUp {
 	background-image: url(../img/asc.gif);
 }

Modified: branches/print_dev/http/html/mod_treefolderPlain.php
===================================================================
--- branches/print_dev/http/html/mod_treefolderPlain.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/html/mod_treefolderPlain.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -597,7 +597,7 @@
 								if(menu.indexOf("hide")!=-1)c_menu+="menu_hide";
 								c_menu+="]";
 								controls=null;
-								if(switchwms=='true')controls='<INPUT type="checkbox" title="' + msgObj.tooltipHandleWms + '" checked onclick="handleSelectedWMS(\''+parentNode+'|wms_'+ mb_mapObj[i].wms[ii].wms_id+'\');" />';
+								if(switchwms=='true')controls='<INPUT type="checkbox" title="' + msgObj.tooltipHandleWms + '"  onclick="handleSelectedWMS(\''+parentNode+'|wms_'+ mb_mapObj[i].wms[ii].wms_id+'\');" />';
 								if(wmsbuttons == 'true'&&metadatalink == 'true')controls+='<a href="'+'javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');'+'"><img src="'+imagedir+'/info.png" /></a>';
 								addNode(parentNode,["wms_"+ mb_mapObj[i].wms[ii].wms_id,[temp.layer_title,((metadatalink=='true'&&wmsbuttons != 'true')?('javascript:openwindow(\"'+ defaultMetadataUrl + '&id='+temp.layer_uid+'\");'):"javascript:select("+i+","+ii+","+iii+");"),,,temp.layer_title,eval(c_menu),controls,[i,ii,iii]]],false,false,reverse=="true");
 								parentObj = parentNode+"|wms_"+ mb_mapObj[i].wms[ii].wms_id;              

Modified: branches/print_dev/http/index.php
===================================================================
--- branches/print_dev/http/index.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/index.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -29,6 +29,9 @@
 or:
 mapbender/licence/ 
 -->
+<meta name="author" content="The Mapbender Development Team">
+<meta name="description" content="Initial start page for the geoportal software Mapbender">
+<meta name="keywords" content="Mapbender, Geoportal, GIS, SDI, GDI, OSGeo, Free Software, OGC, WMS, WFS, WFS Transactional, WMS Client, Digitizing"> 
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="expires" content="0">
@@ -71,7 +74,7 @@
 		<br>
 		<a href="http://wms.wheregroup.com/mapbender/frames/login.php?name=mb&password=mb&mb_user_myGui=mapbender_user" target="_blank"><b>Mapbender User Map</b></a><br>
 		<br>
-		<a href="http://mapbender.osgeo.org" target="_blank"><b>Mapbender on OSGeo</b></a><br>		
+		<a href="http://www.osgeo.org/mapbender" target="_blank"><b>OSGeo InfoSheet</b></a><br>		
 		<br>
 		<br>
 		<br>
@@ -92,7 +95,7 @@
 		<br>
 		<a href="http://www.osgeo.org" title="Open Source Geospatial Foundation" alt="Link to the OSGeo Portal" target="_blank">
 		<br>
-		<img  title="OSGeo logo" src = "./img/OSGeo_150pix.png">
+		<img  title="OSGeo logo" src = "./img/OSGeo_logo.png">
 		</a>
 		<br><br>
 		Mapbender is an official OSGeo Project licensed under the <a href="http://www.gnu.org/licenses/licenses.html#GPL" title="GNU GPL license" alt="Link to the GNU license">GNU GPL</a>
@@ -119,7 +122,7 @@
 <table width="93%" cellspacing="1" cellpadding="5" STYLE="-moz-border-radius:8px; border:1px #808080 solid;">
 <tr><td bgcolor="#ffffff">
 <p>
-	<font align="left" color="#000000">Ma</font><font color="#0000CE">p</font><font color="#C00000">b</font><font color="#000000">ender</font> is the geospatial portal site management software for OGC OWS architectures. Mapbender comes with a data model to manage interfaces for displaying, navigating and querying OGC compliant web map and feature services (WMS and transactional WFS). Authentication and authorization are used by the <a href="http://www.mapbender.org/index.php/Mapbender_Security_Proxy" title="Mapbender OWS Security Proxy">OWS Security Proxy</a> and management interfaces for multi client capable user, group and service administration. The embedded metadata component follows ISO 19119 specification.
+	<font align="left" color="#000000">Ma</font><font color="#0000CE">p</font><font color="#C00000">b</font><font color="#000000">ender</font> is the geospatial portal site management software for OGC OWS architectures. Mapbender has a data model to manage, display, navigate, query and catalog OGC compliant web map and feature services (WMS and transactional WFS). The basic authentication module can be connected with existing systems and allows multi client capable user manangement, authorization, group and service administration. <a href="http://www.mapbender.org/index.php/Mapbender_Security_Proxy" title="Mapbender OWS Security Proxy">OWS Security Proxy</a> acts as a facade for OGC services and controls access and logs operations on services and layers on user and group basis.
 </p>
 </td></tr>
 </table>

Modified: branches/print_dev/http/javascripts/initWms.php
===================================================================
--- branches/print_dev/http/javascripts/initWms.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/initWms.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -4,11 +4,15 @@
 // 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 require_once(dirname(__FILE__)."/../classes/class_wms.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
 
 $wmsArray = wms::selectMyWmsByApplication($gui_id);
 
 for ($i = 0; $i < count($wmsArray); $i++) {
 	$currentWms = $wmsArray[$i];
-	$currentWms->createJsObjFromWMS();
+
+	$output = $currentWms->createJsObjFromWMS_();
+	echo administration::convertOutgoingString($output);
+	unset($output);
 }
-?>
\ No newline at end of file
+?>

Modified: branches/print_dev/http/javascripts/jsTree.js
===================================================================
--- branches/print_dev/http/javascripts/jsTree.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/jsTree.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,103 +1,103 @@
-/***************************************************************
-# $Id$
-*  http://www.mapbender.org/index.php/Mod_treefolder2.php
-*
-*  Copyright notice
-*  (c) 2003-2004 Tobias Bender (tobias at phpXplorer.org)
-*  All rights reserved
-*
-*  This script is part of the jsTree project. The jsTree project 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 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt distributed with these scripts.
-*
-*  This script 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.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-var jst_cm
-var jst_cmT
-var jst_activeNode
-var jst_reload_strData = ""
-var jst_reload_ctlImage
-var jst_reload_halt = false
-var jst_any_expanded
-var jst_expandAll_int
-var jst_loaded = false
-var jst_state_paths = new Array()
-
-var jst_delimiter = ["|", "<|>"]
-var jst_id = "jsTree"
-var jst_container = "document.body"
-var jst_data = "arrNodes"
-var jst_expandAll_warning = "Expanding all nodes can take a while depending on your hardware! Continue?"
-var jst_target
+/***************************************************************
+# $Id$
+*  http://www.mapbender.org/index.php/Mod_treefolder2.php
+*
+*  Copyright notice
+*  (c) 2003-2004 Tobias Bender (tobias at phpXplorer.org)
+*  All rights reserved
+*
+*  This script is part of the jsTree project. The jsTree project 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 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt distributed with these scripts.
+*
+*  This script 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.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+var jst_cm
+var jst_cmT
+var jst_activeNode
+var jst_reload_strData = ""
+var jst_reload_ctlImage
+var jst_reload_halt = false
+var jst_any_expanded
+var jst_expandAll_int
+var jst_loaded = false
+var jst_state_paths = new Array()
+
+var jst_delimiter = ["|", "<|>"]
+var jst_id = "jsTree"
+var jst_container = "document.body"
+var jst_data = "arrNodes"
+var jst_expandAll_warning = "Expanding all nodes can take a while depending on your hardware! Continue?"
+var jst_target
 var jst_context_menu
-var jst_display_root = true
-var jst_highlight = true
-var jst_highlight_color = "white"
-var jst_highlight_bg = "navy"
-var jst_highlight_padding = "1px"
-var jst_image_folder = "./images"
-var jst_reloading = false
-var jst_reload_frame = "reLoader"
-var jst_reload_script = "tree_jsTree_reload.php"
-var jst_reloading_status = "loading tree nodes ..."
+var jst_display_root = true
+var jst_highlight = true
+var jst_highlight_color = "white"
+var jst_highlight_bg = "navy"
+var jst_highlight_padding = "1px"
+var jst_image_folder = "./images"
+var jst_reloading = false
+var jst_reload_frame = "reLoader"
+var jst_reload_script = "tree_jsTree_reload.php"
+var jst_reloading_status = "loading tree nodes ..."
+
+function absTop(nd){
+	return nd.offsetParent ? nd.offsetTop + absTop(nd.offsetParent) : nd.offsetTop
+}
+
+function nodeClick(nd){
+	if(jst_highlight){
+		if(jst_activeNode){
+			jst_activeNode.style.color = ""
+			jst_activeNode.style.backgroundColor = ""
+			nd.style.padding = ""
+		}
+		nd.style.color = jst_highlight_color
+		nd.style.backgroundColor = jst_highlight_bg
+		nd.style.padding = jst_highlight_padding
+		jst_activeNode = nd
+	}
+//	if(childExists(nd.parentNode.parentNode))
+//		window.scrollTo(0, absTop(nd) - 5)
+}
+
+function _getDefinition(data, depth){
+
+	var d = new Array()
+
+	if(!data)
+		return ""
+
+	var sD = ""
+	for(var i = 0; i < depth; i++)
+		sD += '\t'
+
+	if(data != eval(jst_data))
+		d.push(",")
+
+	d.push("\n" + sD + "[")
+
+	var nodes = new Array()
+
+	for(var n1 in data){
+
+		var infos = new Array()
+
+		for(var i = 0; i < 5; i++)
+			infos.push(data[n1][1][i] ? "'" + data[n1][1][i].replace(/\n/g, '\\' + 'n') + "'" : null)
 
-function absTop(nd){
-	return nd.offsetParent ? nd.offsetTop + absTop(nd.offsetParent) : nd.offsetTop
-}
-
-function nodeClick(nd){
-	if(jst_highlight){
-		if(jst_activeNode){
-			jst_activeNode.style.color = ""
-			jst_activeNode.style.backgroundColor = ""
-			nd.style.padding = ""
-		}
-		nd.style.color = jst_highlight_color
-		nd.style.backgroundColor = jst_highlight_bg
-		nd.style.padding = jst_highlight_padding
-		jst_activeNode = nd
-	}
-//	if(childExists(nd.parentNode.parentNode))
-//		window.scrollTo(0, absTop(nd) - 5)
-}
-
-function _getDefinition(data, depth){
-
-	var d = new Array()
-
-	if(!data)
-		return ""
-
-	var sD = ""
-	for(var i = 0; i < depth; i++)
-		sD += '\t'
-
-	if(data != eval(jst_data))
-		d.push(",")
-
-	d.push("\n" + sD + "[")
-
-	var nodes = new Array()
-
-	for(var n1 in data){
-
-		var infos = new Array()
-
-		for(var i = 0; i < 5; i++)
-			infos.push(data[n1][1][i] ? "'" + data[n1][1][i].replace(/\n/g, '\\' + 'n') + "'" : null)
-
 		infos.push(null);
 		
 		if(data[n1][1][6]){
@@ -106,194 +106,194 @@
 		}else{
 			infos.push(null);
 		}
-
-		for(var i = 6; i > 0; i--)
-			if(!infos[i]){
-				infos.pop()
-			}else{
-				break
-			}
-
-		nodes.push("\n" + sD + "\t['" + data[n1][0].replace(/\'/g, '\\' + "'") + "', [" + infos.join(",") + "]" + _getDefinition(data[n1][2], depth + 1) + "]")
-	}
-	
-	d.push(nodes.join(",") + "\n" + sD + "]")
-
-	return d.join("")
-}
-
-function getDefinition(){
-	return jst_data + "=" + _getDefinition(eval(jst_data), 0)
-}
-
-function getDomNode(path){
+
+		for(var i = 6; i > 0; i--)
+			if(!infos[i]){
+				infos.pop()
+			}else{
+				break
+			}
+
+		nodes.push("\n" + sD + "\t['" + data[n1][0].replace(/\'/g, '\\' + "'") + "', [" + infos.join(",") + "]" + _getDefinition(data[n1][2], depth + 1) + "]")
+	}
+	
+	d.push(nodes.join(",") + "\n" + sD + "]")
+
+	return d.join("")
+}
+
+function getDefinition(){
+	return jst_data + "=" + _getDefinition(eval(jst_data), 0)
+}
+
+function getDomNode(path){
 	var parts = path.split(jst_delimiter[0]);
 	var tr = document.getElementById(parts[parts.length-1]);	
 	if(tr)
-		return tr;
-	var tBody = get1stTBody()
-	for(var p = 0; p < parts.length; p++){
-		for(var c = 0; c < tBody.childNodes.length; c++){
-			var tr = tBody.childNodes[c]
+		return tr;
+	var tBody = get1stTBody()
+	for(var p = 0; p < parts.length; p++){
+		for(var c = 0; c < tBody.childNodes.length; c++){
+			var tr = tBody.childNodes[c]
 			if(tr.id == parts[p]){
-				if(p == parts.length - 1){
-					return tr
-				}else{
-					if(!childExists(tr))
-						return null;
-					tBody = tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild
+				if(p == parts.length - 1){
+					return tr
+				}else{
+					if(!childExists(tr))
+						return null;
+					tBody = tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild
 
-					if(!tBody)
-						return null
-				}
-				break
+					if(!tBody)
+						return null
+				}
+				break
 			}
-		}
-	}
-	return null
+		}
+	}
+	return null
 }
 
-function delArrItem(a, p){
-	var b = a.slice(0, p)
-	var e = a.slice(p + 1)
-	return b.concat(e)
-}
-function addArrItem(a, p, v){
-	var b = a.slice(0, p)
-	var e=a.slice(p)
-	b[b.length] = v
-	return b.concat(e)
-}
-
+function delArrItem(a, p){
+	var b = a.slice(0, p)
+	var e = a.slice(p + 1)
+	return b.concat(e)
+}
+function addArrItem(a, p, v){
+	var b = a.slice(0, p)
+	var e=a.slice(p)
+	b[b.length] = v
+	return b.concat(e)
+}
+
 function _editDataNode(action, path, nd){
-	var ps = jst_data
-	var parts = path.split(jst_delimiter[0])
-
-	for(var p = 0; p < parts.length; p++){
-		var arrData = eval(ps)
-		
-	  for(var d = 0; d < arrData.length; d++)
-			if(parts[p] == arrData[d][0]){
-
-				if(p == parts.length - 1){
-
-					switch(action){
-						case "d":
-							if(ps != jst_data)
-								eval(ps + "=delArrItem(" + ps + "," + d + ")")
-						break;
+	var ps = jst_data
+	var parts = path.split(jst_delimiter[0])
+
+	for(var p = 0; p < parts.length; p++){
+		var arrData = eval(ps)
+		
+	  for(var d = 0; d < arrData.length; d++)
+			if(parts[p] == arrData[d][0]){
+
+				if(p == parts.length - 1){
+
+					switch(action){
+						case "d":
+							if(ps != jst_data)
+								eval(ps + "=delArrItem(" + ps + "," + d + ")")
+						break;
 						case "a":
-							if(!eval(ps)[d][2])
-								eval(ps)[d].push(new Array())
-							eval(ps)[d][2].push(nd)
-						break;
-						case "u":
-							if(!eval(ps)[d][2])
-								eval(ps)[d].push(new Array())
-							eval(ps)[d][2].unshift(nd)
-						break;
-					}
-					return true
-					
-					
-				}else{
-					ps = ps + "[" + d + "][2]"
-				}
-				break
-
-			}
-	}
-	return false
-}
-
-function addNode(path, nd, sel, refresh, begining){
-	if(_editDataNode((begining?"u":"a"), path, nd)){
+							if(!eval(ps)[d][2])
+								eval(ps)[d].push(new Array())
+							eval(ps)[d][2].push(nd)
+						break;
+						case "u":
+							if(!eval(ps)[d][2])
+								eval(ps)[d].push(new Array())
+							eval(ps)[d][2].unshift(nd)
+						break;
+					}
+					return true
+					
+					
+				}else{
+					ps = ps + "[" + d + "][2]"
+				}
+				break
+
+			}
+	}
+	return false
+}
+
+function addNode(path, nd, sel, refresh, begining){
+	if(_editDataNode((begining?"u":"a"), path, nd)){
 		if(refresh){	
-			rebuildNode(path, true)
+			rebuildNode(path, true)
 			rebuildNode(path)
-		}
+		}
+
+		if(sel)
+			nodeClick(getDomNode(path + jst_delimiter[0] + nd[0]).childNodes[1].childNodes[1])
+	}
+}
 
-		if(sel)
-			nodeClick(getDomNode(path + jst_delimiter[0] + nd[0]).childNodes[1].childNodes[1])
-	}
-}
+
+function deleteNode(path){
+	if(_editDataNode("d", path))
+		rebuildNode(path, true)
+}
+
+function _getState(tBody, path){
+	var hasSub = false
+	
+	for(var c = 0; tBody!=null  && c < tBody.childNodes.length; c++){
+		var tr = tBody.childNodes[c]
+		if(childExists(tr) && isExpanded(tr)){
+			_getState(tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild, path + (path != "" ? jst_delimiter[0] : "") + tr.id)
+			hasSub = true
+		}
+	}
+	if(!hasSub)
+		jst_state_paths.push(path)
+}
+
+function getState(){
+	jst_state_paths = new Array()
+	_getState(get1stTBody(), "")
+	return jst_state_paths.join(jst_delimiter[1])
+}
+
+function setState(data){
+	jst_state_paths = data.split(jst_delimiter[1])
+	for(var p in jst_state_paths){
+		var path="";
+		var pathElements = jst_state_paths[p].split(jst_delimiter[0]);
+		for(i in pathElements){
+			path += pathElements[i];
+			var tr = getDomNode(path)
+			
+			if(tr){
+				var f1 = tr.firstChild
+				if(f1){
+					var f2 = f1.firstChild
+					if(!isExpanded(tr) && f2)
+						if(f2.onclick)
+							f2.onclick()
+				}
+			}
+			path+=jst_delimiter[0];
+		}
+	}
+}
+
+function rebuildNode(path, parent){
+	if(parent){
+		var arrPath = path.split(jst_delimiter[0])
+		arrPath.pop()
+		path = arrPath.join(jst_delimiter[0])
+	}
+	
+	if(path.split(jst_delimiter[0]).length<=1){
+		renderTree()
+	}else{
+	
+		var nd = getDomNode(path)
+	
+		if(nd){
+			var nn = nd.nextSibling
+
+			if(nn){
+				var nCh = nn.childNodes[1].firstChild
+				if(nCh.nodeName == "TABLE")
+					nd.parentNode.parentNode.deleteRow(nn.rowIndex)
+			}
+			if(nd.firstChild.firstChild.onclick)
+				nd.firstChild.firstChild.onclick()
+		}
+	}
+}
 
-
-function deleteNode(path){
-	if(_editDataNode("d", path))
-		rebuildNode(path, true)
-}
-
-function _getState(tBody, path){
-	var hasSub = false
-	
-	for(var c = 0; tBody!=null  && c < tBody.childNodes.length; c++){
-		var tr = tBody.childNodes[c]
-		if(childExists(tr) && isExpanded(tr)){
-			_getState(tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild, path + (path != "" ? jst_delimiter[0] : "") + tr.id)
-			hasSub = true
-		}
-	}
-	if(!hasSub)
-		jst_state_paths.push(path)
-}
-
-function getState(){
-	jst_state_paths = new Array()
-	_getState(get1stTBody(), "")
-	return jst_state_paths.join(jst_delimiter[1])
-}
-
-function setState(data){
-	jst_state_paths = data.split(jst_delimiter[1])
-	for(var p in jst_state_paths){
-		var path="";
-		var pathElements = jst_state_paths[p].split(jst_delimiter[0]);
-		for(i in pathElements){
-			path += pathElements[i];
-			var tr = getDomNode(path)
-			
-			if(tr){
-				var f1 = tr.firstChild
-				if(f1){
-					var f2 = f1.firstChild
-					if(!isExpanded(tr) && f2)
-						if(f2.onclick)
-							f2.onclick()
-				}
-			}
-			path+=jst_delimiter[0];
-		}
-	}
-}
-
-function rebuildNode(path, parent){
-	if(parent){
-		var arrPath = path.split(jst_delimiter[0])
-		arrPath.pop()
-		path = arrPath.join(jst_delimiter[0])
-	}
-	
-	if(path.split(jst_delimiter[0]).length<=1){
-		renderTree()
-	}else{
-	
-		var nd = getDomNode(path)
-	
-		if(nd){
-			var nn = nd.nextSibling
-
-			if(nn){
-				var nCh = nn.childNodes[1].firstChild
-				if(nCh.nodeName == "TABLE")
-					nd.parentNode.parentNode.deleteRow(nn.rowIndex)
-			}
-			if(nd.firstChild.firstChild.onclick)
-				nd.firstChild.firstChild.onclick()
-		}
-	}
-}
-
 function setNodeColor(path, color){
 	var nd = getDomNode(path)
 	if(nd){
@@ -302,44 +302,44 @@
 }
 
 function setNodeImage(path, Img){
-	var ps = jst_data;
-	var parts = path.split(jst_delimiter[0])
-	var arrData = null;
-
-	var nd = getDomNode(path);
-	if(nd){
-		var cb = nd.childNodes[1].childNodes[0];
-		if(cb && cb.nodeName=="IMG"){
-			if(Img)
-				cb.src=jst_image_folder+"/"+Img;
-			else if(childExists(nd)){
-				var s = nd.nextSibling.style
-				if(s.display == ""){
-					cb.src = jst_image_folder + "/expanded_folder.png";
-				}else{
-					cb.src = jst_image_folder + "/closed_folder.png";
-				}
-			}
-		}
-	}
-	return true
+	var ps = jst_data;
+	var parts = path.split(jst_delimiter[0])
+	var arrData = null;
+
+	var nd = getDomNode(path);
+	if(nd){
+		var cb = nd.childNodes[1].childNodes[0];
+		if(cb && cb.nodeName=="IMG"){
+			if(Img)
+				cb.src=jst_image_folder+"/"+Img;
+			else if(childExists(nd)){
+				var s = nd.nextSibling.style
+				if(s.display == ""){
+					cb.src = jst_image_folder + "/expanded_folder.png";
+				}else{
+					cb.src = jst_image_folder + "/closed_folder.png";
+				}
+			}
+		}
+	}
+	return true
 }
-
-function selectNode(path){
-	var nd = getDomNode(path)
-	if(nd){
-		nodeClick(nd.childNodes[1].childNodes[nd.childNodes[1].childNodes.length-1])
-		return true
-	}else{
-		return false
-	}
+
+function selectNode(path){
+	var nd = getDomNode(path)
+	if(nd){
+		nodeClick(nd.childNodes[1].childNodes[nd.childNodes[1].childNodes.length-1])
+		return true
+	}else{
+		return false
+	}
 }
 
 function IsChecked(path, ctrlNr){
 	var nd = getDomNode(path)
 	if(nd){
-		var fc = nd.childNodes[1].firstChild;
-		if(fc && fc.nodeName=="IMG")ctrlNr++;
+		var fc = nd.childNodes[1].firstChild;
+		if(fc && fc.nodeName=="IMG")ctrlNr++;
 		var cb = nd.childNodes[1].childNodes[ctrlNr];
 		if(cb && cb.nodeName=="INPUT"){
 			return cb.checked;
@@ -353,7 +353,7 @@
 //	0:if none is checked
 // -1:if states are different or ctrlNr is no checkbox or any other error
 function getChildrenCheckState(path, ctrlNr){
-	var state = -1;
+	var state = -1;
 	var plus=0;
 	var nd = getDomNode(path);
 
@@ -361,10 +361,10 @@
 	if(!childExists(nd))return -1;
 	var tBody = nd.nextSibling.childNodes[1].firstChild.firstChild;
 	if(!tBody)return -1;
-	for(var i = 0;i < tBody.childNodes.length; i++){
-		var fc = tBody.childNodes[i].childNodes[1].firstChild;
-		plus=0;
-		if(fc && fc.nodeName=="IMG")plus++;
+	for(var i = 0;i < tBody.childNodes.length; i++){
+		var fc = tBody.childNodes[i].childNodes[1].firstChild;
+		plus=0;
+		if(fc && fc.nodeName=="IMG")plus++;
 		var cb = tBody.childNodes[i].childNodes[1].childNodes[ctrlNr+plus];
 		if(cb && cb.nodeName=="INPUT"){
 			if(state == -1) 
@@ -377,24 +377,24 @@
 		}		
 	}
 	return state;
-}
+}
 
 function checkChildren(path, ctrlNr, bChk){
 	var nd = getDomNode(path);
-	var plus;
+	var plus;
 	
 	if(!nd)return false;
 	if(!childExists(nd))return false;
 	var tBody = nd.nextSibling.childNodes[1].firstChild.firstChild;
 	if(!tBody)return false;
 	for(var i = 0;i < tBody.childNodes.length; i++){
-		var fc = tBody.childNodes[i].childNodes[1].firstChild;
-		plus=0;
-		if(fc && fc.nodeName=="IMG")plus++;
+		var fc = tBody.childNodes[i].childNodes[1].firstChild;
+		plus=0;
+		if(fc && fc.nodeName=="IMG")plus++;
 		var cb = tBody.childNodes[i].childNodes[1].childNodes[ctrlNr+plus];
 		if(cb && cb.nodeName=="INPUT"&&!cb.disabled){
-			cb.checked = bChk;	
-			if(cb.onclick){cb.onclick();}
+			cb.checked = bChk;	
+			if(cb.onclick){cb.onclick();}
 		}		
 	}
 	return true;
@@ -402,11 +402,11 @@
 
 function checkNode(path, ctrlNr, bChk, triggerOnclick){
 	var nd = getDomNode(path)
-	if(typeof(triggerOnclick)=='undefined')
+	if(typeof(triggerOnclick)=='undefined')
 		triggerOnclick = true;
 	if(nd){
-		var fc = nd.childNodes[1].firstChild;
-		if(fc && fc.nodeName=="IMG")ctrlNr++;
+		var fc = nd.childNodes[1].firstChild;
+		if(fc && fc.nodeName=="IMG")ctrlNr++;
 		var cb = nd.childNodes[1].childNodes[ctrlNr];
 		if(cb && cb.nodeName=="INPUT"){
 			cb.checked = bChk;
@@ -420,11 +420,11 @@
 function enableCheckbox(path, ctrlNr, pEnabled){
 	var nd = getDomNode(path)
 	if(nd){
-		var fc = nd.childNodes[1].firstChild;
-		if(fc && fc.nodeName=="IMG")ctrlNr++;
+		var fc = nd.childNodes[1].firstChild;
+		if(fc && fc.nodeName=="IMG")ctrlNr++;
 		var cb = nd.childNodes[1].childNodes[ctrlNr];
 		if(cb && cb.nodeName=="INPUT"){
-			cb.disabled = !pEnabled;
+			cb.disabled = !pEnabled;
 			return true;
 		}
 	}
@@ -432,251 +432,251 @@
 }
 
 
-
-function get1stTBody(){
-	return eval(jst_container).firstChild.firstChild.childNodes[1].childNodes[1].firstChild.firstChild
-}
-
-function __switchAll(tBody, expand){
-	if(!tBody)
-		return false
-
-	for(var c = 0; c < tBody.childNodes.length; c++){
-		var tr = tBody.childNodes[c]
-		var img = tr.firstChild.firstChild
-
-		if(img)
-			if(img.onclick){
-				if((expand && !childExists(tr)) || ((expand && !isExpanded(tr)) || (!expand && isExpanded(tr)))){
-					if(img.id != "rootImage")
-						img.onclick()
-						
-					jst_any_expanded = true
-				}
-				
-				if(tBody.childNodes[c + 1])
-					__switchAll(tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild, expand)
-			}
-	}
-}
-
-function _switchAll(expand){
-	if(jst_reload_halt)
-		return
-
-	__switchAll(get1stTBody(), expand)
-	
-	if(jst_reloading){
-		if(!jst_any_expanded)
-			cancelExpandAll()
-
-		jst_any_expanded = null
-	}
-}
-
-function expandAll(){
-	if(jst_expandAll_warning ? confirm(jst_expandAll_warning) : true)	
-		if(jst_reloading){
-			jst_expandAll_int = window.setInterval("if(!jst_reload_halt)_switchAll(true)", 100)
-		}else{
-			_switchAll(true)
-		}
-}
-
-function cancelExpandAll(){
-	if(jst_expandAll_int)
-		window.clearInterval(jst_expandAll_int)
-}
-
-function closeAll(){
-	_switchAll(false)
-}
-
-function isExpanded(tr){
-	return childExists(tr) ? tr.nextSibling.style.display != "none" : false
-}
-
-function childExists(tr){
-	var n = tr.nextSibling;
-	if(!n||n.childNodes.length<2)return false;
-	n=n.childNodes[1].firstChild;
-	if(!n)return false;
-	return n.nodeName == "TABLE";
-}
-
-function getPath(strData){
-	if(strData.indexOf("[") > 0){
-		
-		var sub3 = strData.substr(0, strData.lastIndexOf("["))
-		var sub6 = sub3.substr(0, sub3.lastIndexOf("["))
-		
-		return (getPath(sub6) != "" ? getPath(sub6) + jst_delimiter[0] : "") + eval(sub3 + "[0]")
-	}else{
-		return ""
-	}
-}
-
-function reloadCallback(){
-
-	eval(jst_reload_strData + "=window.frames['" + jst_reload_frame + "']." + jst_data)
-	
-	renderNode(jst_reload_strData, jst_reload_ctlImage, null, true)
-	
-	window.status = ""
-	
-	jst_reload_halt = false
-	jst_reload_strData = ""
-	jst_reload_ctlImage = null
-}
-
+
+function get1stTBody(){
+	return eval(jst_container).firstChild.firstChild.childNodes[1].childNodes[1].firstChild.firstChild
+}
+
+function __switchAll(tBody, expand){
+	if(!tBody)
+		return false
+
+	for(var c = 0; c < tBody.childNodes.length; c++){
+		var tr = tBody.childNodes[c]
+		var img = tr.firstChild.firstChild
+
+		if(img)
+			if(img.onclick){
+				if((expand && !childExists(tr)) || ((expand && !isExpanded(tr)) || (!expand && isExpanded(tr)))){
+					if(img.id != "rootImage")
+						img.onclick()
+						
+					jst_any_expanded = true
+				}
+				
+				if(tBody.childNodes[c + 1])
+					__switchAll(tBody.childNodes[c + 1].childNodes[1].firstChild.firstChild, expand)
+			}
+	}
+}
+
+function _switchAll(expand){
+	if(jst_reload_halt)
+		return
+
+	__switchAll(get1stTBody(), expand)
+	
+	if(jst_reloading){
+		if(!jst_any_expanded)
+			cancelExpandAll()
+
+		jst_any_expanded = null
+	}
+}
+
+function expandAll(){
+	if(jst_expandAll_warning ? confirm(jst_expandAll_warning) : true)	
+		if(jst_reloading){
+			jst_expandAll_int = window.setInterval("if(!jst_reload_halt)_switchAll(true)", 100)
+		}else{
+			_switchAll(true)
+		}
+}
+
+function cancelExpandAll(){
+	if(jst_expandAll_int)
+		window.clearInterval(jst_expandAll_int)
+}
+
+function closeAll(){
+	_switchAll(false)
+}
+
+function isExpanded(tr){
+	return childExists(tr) ? tr.nextSibling.style.display != "none" : false
+}
+
+function childExists(tr){
+	var n = tr.nextSibling;
+	if(!n||n.childNodes.length<2)return false;
+	n=n.childNodes[1].firstChild;
+	if(!n)return false;
+	return n.nodeName == "TABLE";
+}
+
+function getPath(strData){
+	if(strData.indexOf("[") > 0){
+		
+		var sub3 = strData.substr(0, strData.lastIndexOf("["))
+		var sub6 = sub3.substr(0, sub3.lastIndexOf("["))
+		
+		return (getPath(sub6) != "" ? getPath(sub6) + jst_delimiter[0] : "") + eval(sub3 + "[0]")
+	}else{
+		return ""
+	}
+}
+
+function reloadCallback(){
+
+	eval(jst_reload_strData + "=window.frames['" + jst_reload_frame + "']." + jst_data)
+	
+	renderNode(jst_reload_strData, jst_reload_ctlImage, null, true)
+	
+	window.status = ""
+	
+	jst_reload_halt = false
+	jst_reload_strData = ""
+	jst_reload_ctlImage = null
+}
+
 function renderNode(strData, ctlImg, event, reload){
-
-	if(event)
-		event.cancelBubble = true
-
-	if(jst_reload_halt && !reload)
-		return
-
-	jst_loaded = false
-
-	if(jst_reloading && !reload && eval(strData).length == 0){
-		jst_reload_strData = strData
-		jst_reload_ctlImage = ctlImg
-		jst_reload_halt = true
-		if(jst_reloading_status)
-			window.status = jst_reloading_status
-
-		window.frames[jst_reload_frame].document.location.href = "./" + jst_reload_script + (jst_reload_script.indexOf("?") > -1 ? "&" : "?") + "path=" + getPath(strData)
-		return
-	}
-
-	var tr = ctlImg.parentNode.parentNode
-
-	if(ctlImg.id != "rootFolder"){
-		var fldImg = tr.childNodes[1].firstChild
-
-		if(childExists(tr)){
-			var s = tr.nextSibling.style
-			var img1 = jst_image_folder + "/" + (tr.nextSibling.nextSibling ? "" : "last_")
-
-			if(s.display == ""){
-				s.display = "none"
+
+	if(event)
+		event.cancelBubble = true
+
+	if(jst_reload_halt && !reload)
+		return
+
+	jst_loaded = false
+
+	if(jst_reloading && !reload && eval(strData).length == 0){
+		jst_reload_strData = strData
+		jst_reload_ctlImage = ctlImg
+		jst_reload_halt = true
+		if(jst_reloading_status)
+			window.status = jst_reloading_status
+
+		window.frames[jst_reload_frame].document.location.href = "./" + jst_reload_script + (jst_reload_script.indexOf("?") > -1 ? "&" : "?") + "path=" + getPath(strData)
+		return
+	}
+
+	var tr = ctlImg.parentNode.parentNode
+
+	if(ctlImg.id != "rootFolder"){
+		var fldImg = tr.childNodes[1].firstChild
+
+		if(childExists(tr)){
+			var s = tr.nextSibling.style
+			var img1 = jst_image_folder + "/" + (tr.nextSibling.nextSibling ? "" : "last_")
+
+			if(s.display == ""){
+				s.display = "none"
 				ctlImg.src = img1 + "closed.png"
 				if(String(fldImg.src).indexOf("expanded")!=-1)
-					fldImg.src = jst_image_folder + "/closed_folder.png";
-			}else{
-				s.display = ""
+					fldImg.src = jst_image_folder + "/closed_folder.png";
+			}else{
+				s.display = ""
 				ctlImg.src = img1 + "expanded.png"
-				if(String(fldImg.src).indexOf("closed")!=-1)
-					fldImg.src = jst_image_folder + "/expanded_folder.png";
-			}
-			return
-		}else{
-			ctlImg.src = jst_image_folder + "/" + (tr.nextSibling ? "" : "last_") + "closed.png"
+				if(String(fldImg.src).indexOf("closed")!=-1)
+					fldImg.src = jst_image_folder + "/expanded_folder.png";
+			}
+			return
+		}else{
+			ctlImg.src = jst_image_folder + "/" + (tr.nextSibling ? "" : "last_") + "closed.png"
 			if(eval(strData.substr(0, strData.length-3)+"[1][3]"))
-				fldImg.src = jst_image_folder + "/" + eval(strData.substr(0, strData.length-3)+"[1][3]");
+				fldImg.src = jst_image_folder + "/" + eval(strData.substr(0, strData.length-3)+"[1][3]");
 			else
-				fldImg.src = jst_image_folder + "/closed_folder.png";
-		}
-	}
-
-	var newTr = tr.parentNode.insertRow((tr.rowIndex?tr.rowIndex:0) + 1)
-
-	if(ctlImg.id != "rootFolder"){
-		newTr.style.display = "none";
-	}
-
-	newTr.appendChild(document.createElement('td'))
-	newTr.appendChild(document.createElement('td'))
-		
-	if(newTr.nextSibling)
-		newTr.firstChild.setAttribute("background", jst_image_folder + "/branch.png", "false")
-	
-	newTr.childNodes[1].innerHTML = renderChildren(strData)
-	
-	var nodes = eval(strData)
-
-	var ndWithChildren = 0;
-	for(var n in nodes){
-		var n0 = nodes[n]
-		var n1 = n0[2]
-
-		if(n1){
-			renderNode(strData + "[" + n + "][2]" ,newTr.childNodes[1].firstChild.firstChild.childNodes[parseInt(n)+ndWithChildren].firstChild.firstChild);
-			ndWithChildren++;
-		}
-	}
-	
-	jst_loaded = true
-}
-
-function renderChildren(strData, tblCls, menu){
-
-	var code = Array()
-
-	code.push('<table cellspacing="0" cellpadding="0" border="0" class="' + tblCls + '">')
-	
-	var nodes = eval(strData)
-
-	for(var n in nodes){
-		var n0 = nodes[n]
-		var n1 = n0[2]
-
-		code.push('<tr id="' + n0[0] + '"><td><img' + (strData == jst_data ? ' style="display:none" id="rootImage"' : '') + ' src="' + jst_image_folder + '/')
-
-		if(n1){
-			code.push((n == nodes.length - 1 ? "last_closed" : "closed") + '.png" onClick="renderNode(' + "'" + strData + "[" + n + "][2]" + "'" + ',this,event)" class="action"')
-		}else{
-			code.push((n == nodes.length - 1 ? "last_leaf" : "leaf") + '.png"')
-		}
-		
-		if(jst_context_menu && !n0[1][5] && !menu)
+				fldImg.src = jst_image_folder + "/closed_folder.png";
+		}
+	}
+
+	var newTr = tr.parentNode.insertRow((tr.rowIndex?tr.rowIndex:0) + 1)
+
+	if(ctlImg.id != "rootFolder"){
+		newTr.style.display = "none";
+	}
+
+	newTr.appendChild(document.createElement('td'))
+	newTr.appendChild(document.createElement('td'))
+		
+	if(newTr.nextSibling)
+		newTr.firstChild.setAttribute("background", jst_image_folder + "/branch.png", "false")
+	
+	newTr.childNodes[1].innerHTML = renderChildren(strData)
+	
+	var nodes = eval(strData)
+
+	var ndWithChildren = 0;
+	for(var n in nodes){
+		var n0 = nodes[n]
+		var n1 = n0[2]
+
+		if(n1){
+			renderNode(strData + "[" + n + "][2]" ,newTr.childNodes[1].firstChild.firstChild.childNodes[parseInt(n)+ndWithChildren].firstChild.firstChild);
+			ndWithChildren++;
+		}
+	}
+	
+	jst_loaded = true
+}
+
+function renderChildren(strData, tblCls, menu){
+
+	var code = Array()
+
+	code.push('<table cellspacing="0" cellpadding="0" border="0" class="' + tblCls + '">')
+	
+	var nodes = eval(strData)
+
+	for(var n in nodes){
+		var n0 = nodes[n]
+		var n1 = n0[2]
+
+		code.push('<tr id="' + n0[0] + '"><td><img' + (strData == jst_data ? ' style="display:none" id="rootImage"' : '') + ' src="' + jst_image_folder + '/')
+
+		if(n1){
+			code.push((n == nodes.length - 1 ? "last_closed" : "closed") + '.png" onClick="renderNode(' + "'" + strData + "[" + n + "][2]" + "'" + ',this,event)" class="action"')
+		}else{
+			code.push((n == nodes.length - 1 ? "last_leaf" : "leaf") + '.png"')
+		}
+		
+		if(jst_context_menu && !n0[1][5] && !menu)
 			n0[1][5] = jst_context_menu
 	
-		code.push(' alt=""></td><td nowrap>'+((n1||n0[1][3])?'<img'  + (((strData == jst_data)&&!jst_display_root) ? ' style="display:none"' : '') +  (n0[1][5] ? ' class="action" onClick="showMenu(\'' + strData + '[' + n + ']\', this, event)"' : '') + ' src="' + jst_image_folder + '/' + (n1 ? (n0[1][3]?n0[1][3]:"closed_folder.png") : n0[1][3] ? n0[1][3] : "node.png") + '" alt="">':'')+((n0[1][6]&&((strData != jst_data)||jst_display_root))?n0[1][6]:'')+'<a class="node"'  + (((strData == jst_data)&&!jst_display_root) ? ' style="display:none"' : '')+ (n0[1][4] ? ' title="' + n0[1][4] + '"' : '') + ' onClick="nodeClick(this)" href=' + "'" + (menu ? String(n0[1][1]).replace(/{@strData}/g, strData) : n0[1][1] ) + "'" + (n0[1][2] ? ' target="' + n0[1][2] + '"' : jst_target ? ' target="' + jst_target + '"' : '') + '>' + n0[1][0]  + '</a></td></tr>')			
-	}
-	code.push('</table>')
-	
-	return code.join("")
-}
-
-function showMenu(strData, img, event){
-	var o = window.pageYOffset
-	var offY = o ? o : document.body.scrollTop
-	var offX = o ? window.pageXOffset : document.body.scrollLeft
-	
-	jst_cm.innerHTML = renderChildren(strData + "[1][5]", "menu", true)
-	
-	//TODO find a proper solution for this
-	var treeGDE = jst_cm.parentNode.parentNode;
-	if(treeGDE.id=="treeGDE"){
-		offX -= parseInt(treeGDE.style.left);
-		offY -= parseInt(treeGDE.style.top);
-		if(treeGDE.scrollTop)
-			offY += treeGDE.scrollTop;
-		if(treeGDE.scrollLeft)
-			offX += treeGDE.scrollLeft;
-	}
-	
-	jst_cm.style.top = offY + event.clientY
-	jst_cm.style.left = offX + event.clientX
-	jst_cm.style.visibility = ""
-	
-	event.cancelBubble = true
-}
-
-function hideMenu(){
-	jst_cm.style.visibility = "hidden"
-}
-
-function renderTree(){
-//	TestDate = new Date();TestStartZeit=TestDate.getTime();
-	eval(jst_container).innerHTML = '<table cellspacing="0" cellpadding="0" border="0"><tr id="'+eval(jst_data + "[0][0]")+'"><td colspan="2"><span id="rootFolder"></span></td></tr></table><div style="position:absolute;top:-100;left:-100" id="contextMenu"></div>'
-	renderNode(jst_data, document.getElementById("rootFolder"))
-	renderNode(jst_data + "[0][2]", document.getElementById("rootImage"))
-	
-	jst_cm = document.getElementById("contextMenu")
-	document.body.onclick = hideMenu
-	jst_loaded = true
-//	TestDate=new Date();TestStopZeit=TestDate.getTime();alert(TestStopZeit-TestStartZeit);
-}
+		code.push(' alt=""></td><td nowrap>'+((n1||n0[1][3])?'<img'  + (((strData == jst_data)&&!jst_display_root) ? ' style="display:none"' : '') +  (n0[1][5] ? ' class="action" onClick="showMenu(\'' + strData + '[' + n + ']\', this, event)"' : '') + ' src="' + jst_image_folder + '/' + (n1 ? (n0[1][3]?n0[1][3]:"closed_folder.png") : n0[1][3] ? n0[1][3] : "node.png") + '" alt="">':'')+((n0[1][6]&&((strData != jst_data)||jst_display_root))?n0[1][6]:'')+'<a class="node"'  + (((strData == jst_data)&&!jst_display_root) ? ' style="display:none"' : '')+ (n0[1][4] ? ' title="' + n0[1][4] + '"' : '') + ' onClick="nodeClick(this)" href=' + "'" + (menu ? String(n0[1][1]).replace(/{@strData}/g, strData) : n0[1][1] ) + "'" + (n0[1][2] ? ' target="' + n0[1][2] + '"' : jst_target ? ' target="' + jst_target + '"' : '') + '>' + n0[1][0]  + '</a></td></tr>')			
+	}
+	code.push('</table>')
+	
+	return code.join("")
+}
+
+function showMenu(strData, img, event){
+	var o = window.pageYOffset
+	var offY = o ? o : document.body.scrollTop
+	var offX = o ? window.pageXOffset : document.body.scrollLeft
+	
+	jst_cm.innerHTML = renderChildren(strData + "[1][5]", "menu", true)
+	
+	//TODO find a proper solution for this
+	var treeGDE = jst_cm.parentNode.parentNode;
+	if(treeGDE.id=="treeGDE"){
+		offX -= parseInt(treeGDE.style.left);
+		offY -= parseInt(treeGDE.style.top);
+		if(treeGDE.scrollTop)
+			offY += treeGDE.scrollTop;
+		if(treeGDE.scrollLeft)
+			offX += treeGDE.scrollLeft;
+	}
+	
+	jst_cm.style.top = offY + event.clientY
+	jst_cm.style.left = offX + event.clientX
+	jst_cm.style.visibility = ""
+	
+	event.cancelBubble = true
+}
+
+function hideMenu(){
+	jst_cm.style.visibility = "hidden"
+}
+
+function renderTree(){
+//	TestDate = new Date();TestStartZeit=TestDate.getTime();
+	eval(jst_container).innerHTML = '<table cellspacing="0" cellpadding="0" border="0"><tr id="'+eval(jst_data + "[0][0]")+'"><td colspan="2"><span id="rootFolder"></span></td></tr></table><div style="position:absolute;top:-100;left:-100" id="contextMenu"></div>'
+	renderNode(jst_data, document.getElementById("rootFolder"))
+	renderNode(jst_data + "[0][2]", document.getElementById("rootImage"))
+	
+	jst_cm = document.getElementById("contextMenu")
+	document.body.onclick = hideMenu
+	jst_loaded = true
+//	TestDate=new Date();TestStopZeit=TestDate.getTime();alert(TestStopZeit-TestStartZeit);
+}

Modified: branches/print_dev/http/javascripts/map.js
===================================================================
--- branches/print_dev/http/javascripts/map.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/map.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -72,8 +72,13 @@
 	}      	
 });
 
+/**
+ * @deprecated
+ */
 function mb_registerMapObj(frameName, elementName,wms_index,width, height){
-	mb_mapObj.push(new mb_mapObj_const(frameName, elementName, width, height, wms_index));    
+	var newMapObj = new Map(frameName, elementName, width, height, wms_index);
+	mb_mapObj.push(newMapObj);    
+	return newMapObj;
 }
 
 /**
@@ -373,7 +378,7 @@
 }
 
 /**
- * converts the extent of the mapobject so that the maximum	extent will be displayed {@link mb_mapObj_const#calculateExtent}
+ * converts the extent of the mapobject so that the maximum	extent will be displayed {@link Map#calculateExtent}
  * use: mb_mapObj.calculateExtent
  * @deprecated
  * 

Modified: branches/print_dev/http/javascripts/map.php
===================================================================
--- branches/print_dev/http/javascripts/map.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/map.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -18,7 +18,10 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_json.php");
 
+$json = new Mapbender_JSON();
+
 // see http://trac.osgeo.org/mapbender/ticket/79
 ini_set('session.bug_compat_42',0); 
 ini_set('session.bug_compat_warn',0);
@@ -47,7 +50,6 @@
 
 ob_start();
 header('Content-type: application/x-javascript');
-
 //
 // Define global variables (TODO: move to mapbender object later on)
 //
@@ -56,7 +58,6 @@
 echo "var mb_myLogin = '".$_SESSION["mb_login"]."';";
 echo "var mb_styleID = '".md5($_SESSION["mb_user_name"])."';";
 echo "var mb_myBBOX = '".$_SESSION["mb_myBBOX"]."';";
-echo "var Mapbender = {};";
 echo "Mapbender.locale = '" . $_SESSION["mb_locale"] . "';";
 echo "Mapbender.languageId = '" . $_SESSION["mb_lang"] . "';";
 echo "Mapbender.versionNumber = '" . MB_VERSION_NUMBER . "';";
@@ -92,6 +93,20 @@
 	}
 }
 
+?>
+$(function () {
+	new Mb_notice("new jquery init function");
+	// creates the map objects (mapframe1, overview...)
+	eventInitMap.trigger();
+
+	eventBeforeInit.trigger();
+
+	// initialisation
+	eventInit.trigger();
+	
+	eventAfterInit.trigger();
+});
+<?php
 //
 // Load internal JavaScript libraries
 //
@@ -148,8 +163,18 @@
 //
 
 $modulesNotRelyingOnGlobalsArray = explode(",", MODULES_NOT_RELYING_ON_GLOBALS);
+?>
+Mapbender.Modules = {};
+Mapbender.addModule = function (name, obj) {
+	if (name && !Mapbender.Modules[name]) {	
+		Mapbender.Modules[name] = obj;
+		return true;
+	}
+	return false;
+};
+<?php
+$executeJsPluginsArray = array();
 
-echo "\nMapbender.Modules = {};\n";
 $mb_sql = "SELECT DISTINCT e_js_file, e_id, e_src, e_target, e_pos, " .
 		"e_url, e_left, e_top, e_width, e_height, e_requires FROM gui_element WHERE e_public = 1 AND " .
 		"fkey_gui_id = $1 ORDER BY e_pos";
@@ -160,14 +185,53 @@
 	if($row_js["e_js_file"] != ""){
 		$jsArray = explode(",", $row_js["e_js_file"]);
 		for ($i = 0; $i < count($jsArray); $i++) {
-			$e_id = $row_js["e_id"];
+			$e_id = isset($row_js["e_id"]) ? $row_js["e_id"] : "";
 			$e_src = $row_js["e_src"];
 			$e_require = $row_js["e_requires"];
 			$e_target = explode(",",$row_js["e_target"]);
 			$e_width = intval($row_js["e_width"]);
 			$e_height = intval($row_js["e_height"]);
+			$e_top = intval($row_js["e_top"]);
+			$e_left = intval($row_js["e_left"]);
 			$currentFile = trim($jsArray[$i]);
-			if (file_exists($currentFile)) {
+			if (!file_exists($currentFile)) {
+				$e = new mb_exception("Javascript not found: " . $currentFile);
+				echo "var e = new Mb_exception('Javascript not found: " . $currentFile . "');";
+				die;
+			}
+			if (in_array($e_id, $modulesNotRelyingOnGlobalsArray)) {
+				ob_start();
+				echo "var options = {" . 
+					"id:'$e_id'," . 
+					"target:" . ($e_target[0] != "" ? $json->encode($e_target) : "[]") . "," .
+					"top:$e_top," . 
+					"left:$e_left," . 
+					"width:$e_width," . 
+					"height:$e_height," . 
+					"src:'$e_src'" . 
+					"};";
+
+				include "../include/dyn_js_object.php";
+				echo <<<JS
+				
+$.fn.$e_id = function (options) {
+	return this.each(function () {
+
+JS;
+				require($currentFile);
+				echo <<<JS
+
+	});
+}
+
+JS;
+				echo "$('#$e_id').$e_id(options);";
+				$executeJsPluginsArray[] = ob_get_contents();
+				ob_end_clean();
+				echo "Mapbender.Modules.$e_id = {};\n";
+				
+			}
+			else {
 				echo "Mapbender.Modules." . $e_id . " = {\n";
 				echo "id:'".$row_js["e_id"]."',";
 				echo "url:'".$row_js["e_url"]."',";
@@ -175,31 +239,11 @@
 				echo "left:'".$row_js["e_left"]."',";
 				echo "width:'".$row_js["e_width"]."',";
 				echo "height:'".$row_js["e_height"]."'";
-				if (in_array($e_id, $modulesNotRelyingOnGlobalsArray)) {
-					echo ",\ninit : function () {\n";
-					require($currentFile);
-					echo "}\n";
-					echo "};\n";
-				}
-				else {
-					echo "};\n";
-					require($currentFile);
-				}
+				echo "};\n";
+				require($currentFile);
 			}
-			else {
-				$e = new mb_exception("Javascript not found: " . $currentFile);
-				echo "var e = new Mb_exception('Javascript not found: " . $currentFile . "');";
-				die;
-			}
 		}
 	}
 }
-?>
-eventBeforeInit.register(function () {
-	for (var module in Mapbender.Modules) {
-		var initFunction = Mapbender.Modules[module].init;
-		if (typeof(initFunction) == "function") {
-			Mapbender.Modules[module].init();
-		}
-	}
-});
+echo implode("\n", $executeJsPluginsArray);
+?>
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/map_obj.js
===================================================================
--- branches/print_dev/http/javascripts/map_obj.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/map_obj.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -5,7 +5,7 @@
 */
 var mb_mapObj = [];
 
-function mb_mapObj_const(frameName, elementName, width, height, wms_index){
+function Map (frameName, elementName, width, height, wms_index){
 
 	/**
 	 * set the extent of the wms
@@ -13,15 +13,16 @@
 	this.setExtent = function(minx, miny, maxx, maxy){
 		this.extent = String(minx) + "," + String(miny) + "," + String(maxx) + "," + String(maxy);
 	};
-	
+
+/*	
 	this.restrictedExtent = function (extent) {
 		this.restrictedExtent = extent;
 	};
-	
+*/	
 	/**
 	 * get the width of the mapObj
 	 *
-	 * @member mb_mapObj_const
+	 * @member Map
 	 * @return width of the mapObj
 	 * @type integer
 	 */
@@ -48,7 +49,7 @@
 	/**
 	 * get the height of the mapObj
 	 *
-	 * @member mb_mapObj_const
+	 * @member Map
 	 * @return width of the mapObj
 	 * @type integer
 	 */
@@ -160,8 +161,8 @@
 		this.setExtent(ext.minx, ext.miny, ext.maxx, ext.maxy);
 		return ext;
 	};
-	
-	
+
+
 	this.width = width;
 	this.height = height;
 	this.frameName = frameName;
@@ -173,10 +174,10 @@
 	this.geom = "";
 	this.gml = "";
 	this.wms = [];
-	
-	// 
+
+	//
 	// Add pointers to WMS objects which are in this map.
-	// If wms_index is set (=map is overview), only this 
+	// If wms_index is set (=map is overview), only this
 	// WMS is being pointed to.
 	//
 	var index = 0;
@@ -212,7 +213,7 @@
 					layers += ",";
 					styles += ",";
 				}
-				layers += wms[i].objLayer[ii].layer_name;
+				layers += this.wms[i].objLayer[ii].layer_name;
 				styles += "";
 				cnt_layers++;
 			}
@@ -221,7 +222,7 @@
 				if (cnt_querylayers > 0) {
 					querylayers += ",";
 				}
-				querylayers += wms[i].objLayer[ii].layer_name;
+				querylayers += this.wms[i].objLayer[ii].layer_name;
 				cnt_querylayers++;
 			}
 		}
@@ -255,7 +256,7 @@
 	/**
 	 * get the extent of the mapObj
 	 *
-	 * @member mb_mapObj_const
+	 * @member Map
 	 * @return extent of the mapObj as commaseparated minx,minx,maxx,maxy
 	 * @type string
 	 */
@@ -624,7 +625,7 @@
 	/**
 	 * get all featureInfoRequests
 	 *
-	 * @member mb_mapObj_const
+	 * @member Map
 	 * @param float x the x-value of the click position in pixel
 	 * @param float y the y-value of the click position in pixel
 	 * @return array of all featureInfoRequests of this map object
@@ -659,7 +660,7 @@
 	/**
 	 * calculation of the mapscale
 	 *
-	 * @member mb_mapObj_const
+	 * @member Map
 	 * @return scale
 	 * @type integer
 	 */
@@ -1004,10 +1005,10 @@
 	eventAfterMapObjectConstruction.trigger();
 }
 
-mb_mapObj_const.prototype.getWfsConfIds = function (wfs_config) {
+Map.prototype.getWfsConfIds = function (wfs_config) {
 	var db_wfs_conf_id = [];
 	var js_wfs_conf_id = [];
-	
+
 	//search configurations that are selected (and in scale)
 	for (var i=0; i < this.wms.length; i++){
 		for(var ii=0; ii < this.wms[i].objLayer.length; ii++){
@@ -1025,6 +1026,6 @@
 				break;
 			}
 		}
-	}	
+	}
 	return js_wfs_conf_id;
 };
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mapnf.php
===================================================================
--- branches/print_dev/http/javascripts/mapnf.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mapnf.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -16,27 +16,19 @@
 # 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(dirname(__FILE__)."/../php/mb_validateSession.php");
 ?>
-
-(function () {
-
-<?php
-include(dirname(__FILE__) . "/../include/dyn_js.php");
-?>
-
 	var mapTimeout;
 	var	sum_delta = 0;
 	var lastTimestamp;
 	var lastScrollPosition;
-	var mapObject;
-	
-	eventInitMap.register(function init_mod_map1(){
-			
-		mapObject = mb_registerMapObj('', '<?php echo $e_id; ?>', null,<?php echo $e_width; ?>, <?php echo $e_height; ?>);
 		
+	Mapbender.Modules[options.id] = new Map('', options.id, options.width, options.height, null); 
+
+	eventInitMap.register(function () {
 		
+		var mapObject = Mapbender.Modules[options.id];
+		mb_mapObj.push(mapObject);
+		
 		try {
 			if (restrictedExtent !== '') {
 				mapObject.setRestrictedExtent(restrictedExtent);
@@ -94,4 +86,3 @@
 			);
 		}
 	}
-})();
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_addWMS.php
===================================================================
--- branches/print_dev/http/javascripts/mod_addWMS.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_addWMS.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,32 +1,32 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_addWMS.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(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-echo "var mod_addWMS_data = '".$e_require."';";
-echo "var mod_addWMS_target1 = '".trim($e_target[0])."';";
-echo "var mod_addWMS_target2 = '".trim($e_target[1])."';";
-?>
-
-function mod_addWMS(){
-   var load = prompt("Capabilities - URL:","");
-   if(load){
-      mod_addWMS_load(load);    
-   }
-}
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_addWMS.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(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+echo "var mod_addWMS_data = '".$e_require."';";
+echo "var mod_addWMS_target1 = '".trim($e_target[0])."';";
+echo "var mod_addWMS_target2 = '".trim($e_target[1])."';";
+?>
+
+function mod_addWMS(){
+   var load = prompt("Capabilities - URL:","");
+   if(load){
+      mod_addWMS_load(load);    
+   }
+}

Modified: branches/print_dev/http/javascripts/mod_addWMSfromfilteredList.php
===================================================================
--- branches/print_dev/http/javascripts/mod_addWMSfromfilteredList.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_addWMSfromfilteredList.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,751 +1,751 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_addWMSfromfilteredList.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(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-include '../include/dyn_css.php';
-?>
-<title>Add WMS from Filtered Catalog</title>
-<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
-
-<STYLE TYPE="text/css">
-<!--
-body{
-	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
-	font-size:10pt
-}    
-   
-table{
-	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
-	font-size:11;
-}   
-
-.wms_button{
-	color: black;
-	border: solid thin;
-	height:22px;
-	width:60px;
-}
-
--->
-</STYLE>
-
-
-<script type="text/javascript">
-<!--
-function mod_addWMSfromDB(gui_id, wms_id) {
-	//alert("1/3 mod_addWMSfromDB: GUI ID = " + gui_id + ", WMS ID = " + wms_id);
-	window.opener.mod_addWMSById_load(gui_id, wms_id);
-}
-function mod_addWMSfromfilteredList(pointer_name,version){
-
-	pointer_name=pointer_name + window.opener.mb_getConjunctionCharacter(pointer_name);
-	
-	if (version == '1.0.0'){
-		var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
-		var load = cap;
-	}
-	else if (version == '1.1.0'){
-		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
-		var load = cap;
-	}
-	else if (version == '1.1.1'){
-		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
-		var load = cap;
-	}  
-	//alert (load);
-
-	if(load){
-		if(load.charAt(0) == '/' && load.charAt(1) == 'c'){
-			window.opener.mod_addWMS_load('http://localhost' + load);
-		}
-		else{
-			window.opener.mod_addWMS_load(load);
-		}  
-	}
-}
-
-function mod_show_group_wms(wert){
-	document.form1.show_group_wms.value = wert;
-	document.form1.submit();
-}
-
-function mod_show_gui_wms(wert2){
-	document.form1.show_gui_wms.value = wert2;
-	document.form1.submit();
-}
-			
-function mod_show_gui_configured_wms(wert2){
-	document.form1.show_gui_configured_wms.value = wert2;
-	document.form1.submit();
-}
-			
-function mod_show_wms(wert3){
-
-	document.form1.wms_show.value = wert3;
-   if (wert3 == 4) {
-		document.form1.wmsSource.nodeValue = "db";
-   }
-	else {
-		document.form1.wmsSource.nodeValue = "capabilities";
-	}
-	document.form1.submit();
-}			
-
-function setButtons(wms_option, wms_option2, wms_option3, wms_option4) {
-	if (typeof(option_all) == "undefined") {
-		option_all = '<?php echo $set_option_all;?>';
-	}
-	document.getElementById("set_option_all").value = option_all;
-	if (typeof(option_group) == "undefined") {
-		option_group = '<?php echo $set_option_group;?>';
-	}
-	document.getElementById("set_option_group").value = option_group;
-	if (typeof(option_gui) == "undefined") {
-		option_gui = '<?php echo $set_option_gui;?>';
-	}
-	document.getElementById("set_option_gui").value = option_gui;
-	if (typeof(option_db) == "undefined") {
-		option_db = '<?php echo $set_option_db;?>';
-	}
-	document.getElementById("set_option_db").value = option_db;
-
-	if (wms_option == '' && wms_option2 == '' && wms_option3 == '' && wms_option4 == '') {
-		if (option_all == '1') {
-			mod_show_wms(1);
-		}
-		else if (option_group == '1') {
-			mod_show_wms(2);
-		}
-		else if (option_gui == '1') {
-			mod_show_wms(3);
-		}
-		else if (option_db == '1') {
-			mod_show_wms(4);
-		}
-	}
-	else {
-		if (option_all == '0') {
-			var aNode = document.getElementById("_option_all");
-			if (aNode != null) removeChildNodes(aNode);
-		}
-		if (option_group == '0') {
-			var aNode = document.getElementById("_option_group");
-			if (aNode != null) removeChildNodes(aNode);
-		}
-		if (option_gui == '0') {
-			var aNode = document.getElementById("_option_gui");
-			if (aNode != null) removeChildNodes(aNode);
-		}
-		if (option_db == '0') {
-			var aNode = document.getElementById("_option_db");
-			if (aNode != null) removeChildNodes(aNode);
-		}
-	}
-}
-
-function removeChildNodes(node) {
-	while (node.childNodes.length > 0) {
-		var childNode = node.firstChild;
-		node.removeChild(childNode);
-	}
-}
-// -->
-</script>
-
-</head>
-<body onLoad="window.focus();setButtons('<?php echo $wms_show;?>','<?php echo $show_gui_configured_wms;?>','<?php echo $show_group_wms;?>','<?php echo $show_gui_wms;?>')">
-
-<?php
-require_once(dirname(__FILE__)."/../classes/class_wms.php"); 
-require_once(dirname(__FILE__)."/../php/mb_getGUIs.php");
-
-$fieldHeight = 20;
-$cnt_gui = 0;
-$cnt_gui_wms = 0;
-$cnt_wms = 0;
-$cnt_user_group = 0;
-$cnt_group = 0;
-$cnt_gui_mb_group = 0;
-$cnt_group_gui_wms = 0;
-$cnt_fkey_group_gui_wms = 0;
-$cnt_fkey_show_gui_wms = 0;
-$cnt_show_gui_wms = 0;
-$cnt_group_name = 0;
-$cnt_gui_table = 0;
-$exists = false;
-$logged_user_name=$_SESSION["mb_user_name"];
-$logged_user_id=$_SESSION["mb_user_id"];
-$logged_gui_id=$_SESSION["mb_user_gui"];
-
-######   SQL   #####################################################################################
-
-/*get infos from gui_element ********************************************************/
-
-/*get group from logged user  *******************************************************/
-$sql_user_group = "SELECT * FROM mb_user_mb_group WHERE fkey_mb_user_id= $1 ";
-$array_values = array($logged_user_id);
-$array_types = array('s');
-$res_user_group = db_prep_query($sql_user_group, $array_values, $array_types);
-while($row = db_fetch_array($res_user_group)){
-	$user_id[$cnt_user_group] = $row["fkey_mb_user_id"];
-	$group_id[$cnt_user_group] = $row["fkey_mb_group_id"];
-	$cnt_user_group++;
-}
-/*get group from logged user  ************************************************************/
-
-# Thekla, please recheck
-/*get group name  ********************************************************************************************/								 
-if(count($group_id) > 0){
-	$v = array();
-	$t = array();
-	$sql_group = "SELECT mb_group_id, mb_group_name, mb_group_description FROM mb_group WHERE mb_group_id IN (";	
-	for($i=0; $i < count($group_id); $i++){
-		if($i>0){ $sql_group .= ",";}
-		$sql_group .= "$".strval($i + 1);
-		array_push($v,$group_id[$i]);
-		array_push($t,"i");
-	}		
-	$sql_group.= ") ORDER BY mb_group_name";	
-	$res_group = db_prep_query($sql_group,$v,$t);	
-	while($row = db_fetch_array($res_group)){
-		$mb_group_description[$cnt_group] = $row["mb_group_description"];
-		$my_group_name[$cnt_group] = $row["mb_group_name"];
-		$my_group_id[$cnt_group] = $row["mb_group_id"];
-		$cnt_group++;
-	}				 
-}
-/*get group name  ********************************************************************************************/							 
-
-/*get allocated gui  ********************************************************************************************/
-
-$arrayGuis=mb_getGUIs($logged_user_id);
-$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
-$v = $arrayGuis;
-$t = array();
-
-for ($i = 1; $i <= count($arrayGuis); $i++){
-	if ($i > 1) { 
-		$sql_gui .= ",";
-	}
-	$sql_gui .= "$" . $i;
-	array_push($t, "s");
-}
-$sql_gui.= ") ORDER BY gui_name";
-
-
-$res_gui = db_prep_query($sql_gui, $v, $t);
-				while($row = db_fetch_array($res_gui)){
-					$gui_id[$cnt_gui] = $row["gui_id"];
-					$gui_name[$cnt_gui] = $row["gui_name"];
-					$gui_description[$cnt_gui] = $row["gui_description"];	
-					#echo"$gui_name[$cnt_gui]";							
-					$cnt_gui++;
-				}
-/*get allocated gui  ********************************************************************************************/
-				 
-/*get allocated wms from allocated gui  ********************************************************************************************/								 
-$sql_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id IN (";
-$v = $arrayGuis;
-$t = array();
-for ($i = 1; $i <= count($arrayGuis); $i++){
-	if ($i > 1) { 
-		$sql_gui_wms .= ",";
-	}
-	$sql_gui_wms .= "$".$i;
-	array_push($t, "s");
-}
-$sql_gui_wms.= ") ORDER BY fkey_wms_id";
-
-$res_gui_wms = db_prep_query($sql_gui_wms, $v, $t);
-while($row = db_fetch_array($res_gui_wms)){
-				$fkey_gui_id[$cnt_gui_wms] = $row["fkey_gui_id"];
-	$fkey_wms_id[$cnt_gui_wms] = $row["fkey_wms_id"];
-	$cnt_gui_wms++;
-}
-/*get allocated wms from allocated gui  ********************************************************************************************/							 
-
-/*get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/								 
-$sql_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_version FROM wms WHERE wms_id IN (";
-$v = $fkey_wms_id;
-$t = array();
-for ($i = 1; $i <= count($fkey_wms_id); $i++){
-	if ($i > 1) { 
-		$sql_wms .= ",";
-	}
-	$sql_wms .= "$".$i;
-	array_push($t, "s");
-}
-$sql_wms.= ") ORDER BY wms_title";
-
-$res_wms = db_prep_query($sql_wms, $v, $t);
-				while($row = db_fetch_array($res_wms)){
-					$wms_title[$cnt_wms] = $row["wms_title"];
-					$wms_abstract[$cnt_wms] = $row["wms_abstract"];
-					$wms_getcapabilities[$cnt_wms] = $row["wms_getcapabilities"];
-					$wms_version[$cnt_wms] = $row["wms_version"];
-					$cnt_wms++;
-				}							 
-/*get allocated wms-Abstract and wms-Capabilities from allocated gui   ********************************************************************************************/							 
-
-
-/*INSERT HTML*/
-echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
-# Button
-echo "<table border='0' cellpadding='3'  rules='rows'>";
-echo "<tr>";
-if (!empty($wms_show) || !empty($show_gui_configured_wms) || !empty($show_group_wms) || !empty($show_gui_wms)){
-	echo "<td id='_option_all'><input type='button' class='wms_button' name='wms1' value='all wms' onclick='mod_show_wms(1)'></td>";
-	echo "<td id='_option_group'><input type='button' class='wms_button' name='wms2' value='group' onclick = 'mod_show_wms(2)'></td>";	
-	echo "<td id='_option_gui'><input type='button' class='wms_button' name='wms3' value='gui' onclick = 'mod_show_wms(3)'></td>";
-	echo "<td id='_option_db'><input type='button' class='wms_button' name='wms4' value='db' onclick = 'mod_show_wms(4)'></td>";
-	echo "</tr>";
-	echo "</table>";
-
-
-######   SQL   #####################################################################################
-
-
-######   SHOW GUI WMS OR GROUP WMS   #####################################################################################
-
-/*show goup wms  ********************************************************************************************/
-#if (isset($show_group_wms))
-if (!empty($show_group_wms)){
-	/*get gui goup   ********************************************************************************************/
-	$sql_gui_mb_group = "SELECT fkey_gui_id, fkey_mb_group_id FROM gui_mb_group WHERE fkey_mb_group_id=$1";
-	$v = array($show_group_wms);
-	$t = array("s");
-	$res_gui_mb_group = db_prep_query($sql_gui_mb_group, $v, $t);
-
-				while($row = db_fetch_array($res_gui_mb_group)){
-					$group_gui_id[$cnt_gui_mb_group] = $row["fkey_gui_id"];
-					$fkey_mb_group_id[$cnt_gui_mb_group] = $row["fkey_mb_group_id"];
-					#echo"$group_gui_id[$cnt_gui_mb_group]";  
-					$cnt_gui_mb_group++;
-				}
-								 
-  /*get gui goup   ********************************************************************************************/			
-
-	/*get group gui WMS  ********************************************************************************************/
-	if(count($group_gui_id)>0)	{								 
-		$sql_fkey_group_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id IN (";
-		$v = $group_gui_id;
-		$t = array();
-		for ($i = 1; $i <= count($group_gui_id); $i++){
-			if ($i > 1) { 
-				$sql_fkey_group_gui_wms .= ",";
-			}
-			$sql_fkey_group_gui_wms .= "$".$i;
-			array_push($t, "s");
-		}
-		$sql_fkey_group_gui_wms.=  ") ORDER BY fkey_wms_id";
-		
-		$res_fkey_group_gui_wms = db_prep_query($sql_fkey_group_gui_wms, $v, $t);
-		while($row = db_fetch_array($res_fkey_group_gui_wms)){
-			$fkey_group_gui_gui_id[$cnt_fkey_group_gui_wms] = $row["fkey_gui_id"];
-			$fkey_group_gui_wms_id[$cnt_fkey_group_gui_wms] = $row["fkey_wms_id"];
-			#echo"$fkey_group_gui_wms_id[$cnt_fkey_group_gui_wms]";
-			$cnt_fkey_group_gui_wms++;
-		}	
-
-		/*get group gui WMS  ********************************************************************************************/		
-
-		/*group: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/								 
-		if(count($fkey_group_gui_wms_id)>0){
-			$sql_group_gui_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_version FROM wms WHERE wms_id IN (";
-			$v = $fkey_group_gui_wms_id;
-			$t = array();
-			for ($i = 1; $i <= count($fkey_group_gui_wms_id); $i++){
-				if ($i > 1) { 
-					$sql_group_gui_wms .= ",";
-				}
-				$sql_group_gui_wms .= "$".$i;
-				array_push($t, "s");
-			}
-			$sql_group_gui_wms.= ") ORDER BY wms_title";
-		  
-			$res_group_gui_wms = db_prep_query($sql_group_gui_wms, $v, $t);
-			while($row = db_fetch_array($res_group_gui_wms)){
-				$group_wms_title[$cnt_group_gui_wms] = $row["wms_title"];
-				$group_wms_abstract[$cnt_group_gui_wms] = $row["wms_abstract"];
-				$group_wms_getcapabilities[$cnt_group_gui_wms] = $row["wms_getcapabilities"];
-				$group_wms_version[$cnt_group_gui_wms] = $row["wms_version"];
-				#echo"$group_wms_title[$cnt_group_gui_wms]";
-				$cnt_group_gui_wms++;
-			}
-		}         	
-	}		
-					 
-	/*group: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
-
-	/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
-	#if ($show_group_wms > 0)
-	if ($cnt_group_gui_wms > 0){
-		/*get goup name for showing in the table ********************************************************************************************/								 
-		$sql_group_name = "SELECT mb_group_id, mb_group_name FROM mb_group WHERE mb_group_id = $1";   
-		$v = array($show_group_wms);
-		$t = array("s");
-		$res_group_name = db_prep_query($sql_group_name, $v, $t);
-		while($row = db_fetch_array($res_group_name)){
-			$group_name_table[$cnt_group_name] = $row["mb_group_name"];
-			$my_group_id_table[$cnt_group_name] = $row["mb_group_id"];
-			$cnt_group_name++;
-		}
-					 
-	/*get goup name  ********************************************************************************************/
-
-	echo"<br>";
-	echo"<br>";
-		echo"wms from group: $group_name_table[0]";
-		echo"<br>";
-		echo"<br>";	
-	echo "<table border='1' width ='98%' cellpadding='3' rules='rows'>";
-	echo " <thead bgcolor = '#FAEBD7' >";
-	echo "<tr><td width='200' height='10'>WMS-Title</td><td  align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
-	echo " </thead>";
-	echo " <tbody >";
-		for($i=0; $i<$cnt_group_gui_wms; $i++){
-			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
-			
-			echo "<td><div id ='id_".$group_wms_title[$i]."' class='even' name ='name_".$group_wms_title[$i]."'  style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$group_wms_getcapabilities[$i]."\",\"".$group_wms_version[$i]."\")'>".$group_wms_title[$i]."</div></td>";
-			echo "<td><div id ='id_".$group_wms_abstract[$i]."' class='even' name ='name_".$group_wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$group_wms_getcapabilities[$i]."\",\"".$group_wms_version[$i]."\")'>".$group_wms_abstract[$i]."</div></td>";
-			echo "</tr>";		
-		}		
-		echo "  </tbody>";							 						 
-		echo "</table>";
-		}  
-		else{
-			echo"<br>";
-			echo"<br>";
-			echo "no wms in this group";
-		}/*End: if ($show_group_wms > 0)   *********/
-		/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/	
-
-
-	}/*End: if (!empty($show_group_wms))   *********/
-
-/*show gui wms  ********************************************************************************************/
-if (!empty($show_gui_wms)){
-	/*get group gui WMS  ********************************************************************************************/								 
-	$sql_fkey_show_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id = $1";
-	$v = array($show_gui_wms);
-	$t = array("s");
-	#$sql_fkey_show_gui_wms.= ") ORDER BY fkey_wms_id";
-
-	$res_fkey_show_gui_wms = db_prep_query($sql_fkey_show_gui_wms, $v, $t);
-	while($row = db_fetch_array($res_fkey_show_gui_wms)){
-		$fkey_show_gui_gui_id[$cnt_fkey_show_gui_wms] = $row["fkey_gui_id"];
-		$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms] = $row["fkey_wms_id"];
-		#echo"$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms]";
-		$cnt_fkey_show_gui_wms++;
-	}								 
-	/*get group gui WMS  ********************************************************************************************/		
-
-	/*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/								 
-	if(count($fkey_show_gui_wms_id)>0){
-		$sql_show_gui_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_id, wms_version FROM wms WHERE wms_id IN (";
-		$v = $fkey_show_gui_wms_id;
-		$t = array();
-		for ($i = 1; $i <= count($fkey_show_gui_wms_id); $i++){
-			if ($i > 1) { 
-				$sql_show_gui_wms .= ",";
-			}
-			$sql_show_gui_wms .= "$".$i;
-			array_push($t, "s");
-		}
-		$sql_show_gui_wms.= ") ORDER BY wms_title";
-
-		$res_show_gui_wms = db_prep_query($sql_show_gui_wms, $v, $t);
-		while($row = db_fetch_array($res_show_gui_wms)){
-			$gui_wms_id[$cnt_show_gui_wms] = $row["wms_id"];
-			$gui_wms_title[$cnt_show_gui_wms] = $row["wms_title"];
-			$gui_wms_abstract[$cnt_show_gui_wms] = $row["wms_abstract"];
-			$gui_wms_getcapabilities[$cnt_show_gui_wms] = $row["wms_getcapabilities"];
-			$gui_wms_version[$cnt_show_gui_wms] = $row["wms_version"];
-			#echo"$gui_wms_title[$cnt_show_gui_wms]";
-			$cnt_show_gui_wms++;
-		}							 
-		/*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
-
-		/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
-		#if (isset($cnt_show_gui_wms > 0))
-	}
-
-	if ($cnt_show_gui_wms > 0){
-	/*get selected gui name for table caption ********************************************************************************************/  
-	$sql_gui_table = "SELECT * FROM gui WHERE gui_id = $1";       
-	$v = array($show_gui_wms);
-	$t = array("s");
-	$res_gui_table = db_prep_query($sql_gui_table, $v, $t);
-		while($row = db_fetch_array($res_gui_table)){
-			$gui_id_table[$cnt_gui_table] = $row["gui_id"];
-			$gui_name_table[$cnt_gui_table] = $row["gui_name"];							
-			$cnt_gui_table++;
-			#echo"$gui_id_table[0]";
-		}
-
-		/*get selected gui name for table caption ********************************************************************************************/
-
-		echo"<br>";
-		echo"<br>";
-			echo"wms from gui: $gui_name_table[0]";
-			echo"<br>";
-			echo"<br>";
-		echo "<table border='1'  width ='98%'   cellpadding='3' rules='rows'>";
-		echo " <thead bgcolor = '#FAEBD7' >";
-		echo "<tr><td width='200' height='10'>WMS-Title</td><td  align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
-		echo " </thead>";
-		echo " <tbody >";
-		for($i=0; $i<$cnt_show_gui_wms; $i++){
-			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
-			echo "<td><div id ='id_".$gui_wms_title[$i]."' class='even' name ='name_".$gui_wms_title[$i]."'  style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$gui_wms_getcapabilities[$i]."\",\"".$gui_wms_version[$i]."\")'>".$gui_wms_title[$i]."</div></td>";
-			echo "<td><div  id ='id_".$gui_wms_abstract[$i]."' class='even' name ='name_".$gui_wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$gui_wms_getcapabilities[$i]."\",\"".$gui_wms_version[$i]."\")'>".$gui_wms_abstract[$i]."</div></td>";
-			echo "</tr>";	
-		}	
-		echo "  </tbody>";							 						 
-		echo "</table>";
-	}
-	else{
-		echo"<br>";
-		echo"<br>";
-		echo"<br>";
-
-		echo "no wms in this gui";
-  	}  /*End: if ($cnt_show_gui_wms > 0)  *********/
-	/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/	
-
-
-} /*End: if(isset($show_gui_wms))   *********/
-
-
-
-/*show gui wms  ********************************************************************************************/
-if (!empty($show_gui_configured_wms)){
-	/*get group gui WMS  ********************************************************************************************/								 
-	$sql_fkey_show_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id = $1";
-	#$sql_fkey_show_gui_wms.= ") ORDER BY fkey_wms_id";
-	$v = array($show_gui_configured_wms);
-	$t = array("s");
-	$res_fkey_show_gui_wms = db_prep_query($sql_fkey_show_gui_wms, $v, $t);
-	while($row = db_fetch_array($res_fkey_show_gui_wms)){
-		$fkey_show_gui_gui_id[$cnt_fkey_show_gui_wms] = $row["fkey_gui_id"];
-		$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms] = $row["fkey_wms_id"];
-		#echo"$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms]";
-		$cnt_fkey_show_gui_wms++;
-	}								 
-	/*get group gui WMS  ********************************************************************************************/		
-
-	/*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/								 
-	if(count($fkey_show_gui_wms_id)>0){
-		$sql_show_gui_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_id, wms_version FROM wms WHERE wms_id IN (";
-		$v = $fkey_show_gui_wms_id;
-		$t = array();
-		for ($i = 1; $i <= count($fkey_show_gui_wms_id); $i++){
-			if ($i > 1) { 
-				$sql_show_gui_wms .= ",";
-			}
-			$sql_show_gui_wms .= "$".$i;
-			array_push($t, "s");
-		}
-		$sql_show_gui_wms.= ") ORDER BY wms_title";
-
-		$res_show_gui_wms = db_prep_query($sql_show_gui_wms, $v, $t);
-		while($row = db_fetch_array($res_show_gui_wms)){
-			$gui_wms_id[$cnt_show_gui_wms] = $row["wms_id"];
-			$gui_wms_title[$cnt_show_gui_wms] = $row["wms_title"];
-			$gui_wms_abstract[$cnt_show_gui_wms] = $row["wms_abstract"];
-			$gui_wms_getcapabilities[$cnt_show_gui_wms] = $row["wms_getcapabilities"];
-			$gui_wms_version[$cnt_show_gui_wms] = $row["wms_version"];
-			#echo"$gui_wms_title[$cnt_show_gui_wms]";
-			$cnt_show_gui_wms++;
-		}							 
-		/*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
-
-		/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
-		#if (isset($cnt_show_gui_wms > 0))
-	}
-
-	if ($cnt_show_gui_wms > 0){
-	/*get selected gui name for table caption ********************************************************************************************/  
-	$sql_gui_table = "SELECT * FROM gui WHERE gui_id = $1";
-	$v = array($show_gui_configured_wms);
-	$t = array("s");       
-	$res_gui_table = db_prep_query($sql_gui_table, $v, $t);
-		while($row = db_fetch_array($res_gui_table)){
-			$gui_id_table[$cnt_gui_table] = $row["gui_id"];
-			$gui_name_table[$cnt_gui_table] = $row["gui_name"];							
-			$cnt_gui_table++;
-			#echo"$gui_id_table[0]";
-		}
-
-		/*get selected gui name for table caption ********************************************************************************************/
-
-		echo"<br>";
-		echo"<br>";
-			echo"wms from gui: $gui_name_table[0]";
-			echo"<br>";
-			echo"<br>";
-		echo "<table border='1'  width ='98%'   cellpadding='3' rules='rows'>";
-		echo " <thead bgcolor = '#FAEBD7' >";
-		echo "<tr><td width='200' height='10'>WMS-Title</td><td  align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
-		echo " </thead>";
-		echo " <tbody >";
-		for($i=0; $i<$cnt_show_gui_wms; $i++){
-			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
-			echo "<td><div id ='id_".$gui_wms_title[$i]."' class='even' name ='name_".$gui_wms_title[$i]."'  style='cursor:pointer' onclick = 'mod_addWMSfromDB(\"".$show_gui_configured_wms."\",\"".$gui_wms_id[$i]."\")'>".$gui_wms_title[$i]."</div></td>";
-			echo "<td><div  id ='id_".$gui_wms_abstract[$i]."' class='even' name ='name_".$gui_wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromDB(\"".$show_gui_configured_wms."\",\"".$gui_wms_id[$i]."\")'>".$gui_wms_abstract[$i]."</div></td>";
-			echo "</tr>";	
-		}	
-		echo "  </tbody>";							 						 
-		echo "</table>";
-	}
-	else{
-		echo"<br>";
-		echo"<br>";
-		echo"<br>";
-
-		echo "no wms in this gui";
-  	}  /*End: if ($cnt_show_gui_wms > 0)  *********/
-	/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/	
-
-
-} /*End: if(isset($show_gui_configured_wms))   *********/
-
-######   SHOW GUI WMS OR GROUP WMS   #####################################################################################
-
-######   SHOW GUI OR GROUP OR ALL WMS   #####################################################################################
-
-	if ($wms_show == 4){ #gui
-		echo"<br>";
-		echo"<br>";
-		echo"Please select a gui:";
-		echo"<br>";
-		echo"<br>";	
-		echo "<table border='1' width='98%' cellpadding='3' rules='rows'>";
-		echo " <thead bgcolor = 'lightgrey' >";
-		echo "<tr><td width='200' height='10'>gui name</td><td  align = 'left' class='fieldnames_s'>description</td>";
-		echo " </thead>";
-		echo " <tbody >";
-		for($i=0; $i<$cnt_gui; $i++){
-			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
-			echo "<td><div id ='id_".$gui_name[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_name[$i]."'  style='cursor:pointer'  onclick = 'mod_show_gui_configured_wms(\"".$gui_id[$i]."\")'>".$gui_name[$i]."</div></td>";
-			echo "<td><div id ='id_".$gui_description[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_description[$i]."' style='cursor:pointer' onclick = 'mod_show_gui_configured_wms(\"".$gui_id[$i]."\")'>".$gui_description[$i]."</div></td>";
-			echo "</tr>";
-		}		
-		echo "  </tbody>";							 						 
-		echo "</table>";		
-
-	}
-	if ($wms_show == 3){ #gui
-		echo"<br>";
-		echo"<br>";
-		echo"Please select a gui:";
-		echo"<br>";
-		echo"<br>";	
-		echo "<table border='1' width='98%' cellpadding='3' rules='rows'>";
-		echo " <thead bgcolor = 'lightgrey' >";
-		echo "<tr><td width='200' height='10'>gui name</td><td  align = 'left' class='fieldnames_s'>description</td>";
-		echo " </thead>";
-		echo " <tbody >";
-		for($i=0; $i<$cnt_gui; $i++){
-			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
-			echo "<td><div id ='id_".$gui_name[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_name[$i]."'  style='cursor:pointer'  onclick = 'mod_show_gui_wms(\"".$gui_id[$i]."\")'>".$gui_name[$i]."</div></td>";
-			echo "<td><div id ='id_".$gui_description[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_description[$i]."' style='cursor:pointer' onclick = 'mod_show_gui_wms(\"".$gui_id[$i]."\")'>".$gui_description[$i]."</div></td>";
-			echo "</tr>";
-		}		
-		echo "  </tbody>";							 						 
-		echo "</table>";		
-
-	}
-	elseif  ($wms_show== 2){  # group
-		echo"<br>";
-		echo"<br>";
-  
-		if($cnt_group>0){
-			echo "Please select a group:";
-			echo"<br>";
-			echo"<br>";
-			echo "<table border='1' width='98%' cellpadding='3' rules='rows'>";
-			echo " <thead bgcolor = 'lightgrey' >";
-			echo "<tr><td  width='200' height='10'>group name</td><td  align = 'left' class='fieldnames_s'>description</td>";
-			echo " </thead>";
-			echo " <tbody >";
-			for($i=0; $i<$cnt_group; $i++){
-				echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";  				
-				echo "<td><div id ='id_".$my_group_name[$i]."' value='".$my_group_id[$i]."' class='even' name ='".$my_group_name[$i]."'  style='cursor:pointer'  onclick = 'mod_show_group_wms(\"".$my_group_id[$i]."\")'>".$my_group_name[$i]."</div></td>";
-				echo "<td><div id ='id_".$mb_group_description[$i]."' value='".$my_group_id[$i]."' class='even' name ='".$mb_group_description[$i]."' style='cursor:pointer' onclick = 'mod_show_group_wms(\"".$my_group_id[$i]."\")'>".$mb_group_description[$i]."</div></td>";
-				echo "</tr>";
-			}		
-			echo "  </tbody>";							 						 
-			echo "</table>";
-		}
-		else{
-			echo"no group for this user";
-		}
-	
-	}
-	elseif  ($wms_show== 1){  # all wms
-		echo"<br>";
-		echo"<br>";
-
-		echo "<table border='1'  width ='98%'   cellpadding='3' rules='rows'>";
-		echo " <thead bgcolor = '#FAEBD7' >";
-		echo "<tr><td width='200' height='10'>WMS-Title</td><td  align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
-		echo " </thead>";
-		echo " <tbody >";
-		for($i=0; $i<$cnt_wms; $i++){
-        	echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
-			echo "<td><div id ='id_".$wms_title[$i]."' class='even' name ='name_".$wms_title[$i]."'  style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_title[$i]."</div></td>";
-			echo "<td><div  id ='id_".$wms_abstract[$i]."' class='even' name ='name_".$wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_abstract[$i]."</div></td>";
-			echo "</tr>"; 					 					
-		}		
-		echo "  </tbody>";							 						 
-		echo "</table>";
-	}
-}
-
-
-######   SHOW GUI OR GROUP OR ALL WMS   #####################################################################################
-
-
-/*show group wms  ********************************************************************************************/
-echo "<input type='hidden' name='show_group_wms'>";
-/*show gui wms  ********************************************************************************************/
-echo "<input type='hidden' name='show_gui_wms'>";
-echo "<input type='hidden' name='show_gui_configured_wms'>";
-/*show button  ********************************************************************************************/
-echo "<input type='hidden' name='wms_show'>";
-echo "<input id='wmsSource' type='hidden' name='wmsSource'>";
-echo "<input name ='set_option_all' id='set_option_all' type='hidden'>";
-echo "<input name='set_option_group' id='set_option_group' type='hidden'>";
-echo "<input name='set_option_gui' id='set_option_gui' type='hidden'>";
-echo "<input name='set_option_db' id='set_option_db' type='hidden'>";
-echo "</form>";
-?>
-<script type="text/javascript">
-
-// -->
-</script>
-</body>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_addWMSfromfilteredList.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(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+include '../include/dyn_css.php';
+?>
+<title>Add WMS from Filtered Catalog</title>
+<link rel="stylesheet" type="text/css" href="../css/administration_alloc.css">
+
+<STYLE TYPE="text/css">
+<!--
+body{
+	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+	font-size:10pt
+}    
+   
+table{
+	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+	font-size:11;
+}   
+
+.wms_button{
+	color: black;
+	border: solid thin;
+	height:22px;
+	width:60px;
+}
+
+-->
+</STYLE>
+
+
+<script type="text/javascript">
+<!--
+function mod_addWMSfromDB(gui_id, wms_id) {
+	//alert("1/3 mod_addWMSfromDB: GUI ID = " + gui_id + ", WMS ID = " + wms_id);
+	window.opener.mod_addWMSById_load(gui_id, wms_id);
+}
+function mod_addWMSfromfilteredList(pointer_name,version){
+
+	pointer_name=pointer_name + window.opener.mb_getConjunctionCharacter(pointer_name);
+	
+	if (version == '1.0.0'){
+		var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
+		var load = cap;
+	}
+	else if (version == '1.1.0'){
+		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
+		var load = cap;
+	}
+	else if (version == '1.1.1'){
+		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
+		var load = cap;
+	}  
+	//alert (load);
+
+	if(load){
+		if(load.charAt(0) == '/' && load.charAt(1) == 'c'){
+			window.opener.mod_addWMS_load('http://localhost' + load);
+		}
+		else{
+			window.opener.mod_addWMS_load(load);
+		}  
+	}
+}
+
+function mod_show_group_wms(wert){
+	document.form1.show_group_wms.value = wert;
+	document.form1.submit();
+}
+
+function mod_show_gui_wms(wert2){
+	document.form1.show_gui_wms.value = wert2;
+	document.form1.submit();
+}
+			
+function mod_show_gui_configured_wms(wert2){
+	document.form1.show_gui_configured_wms.value = wert2;
+	document.form1.submit();
+}
+			
+function mod_show_wms(wert3){
+
+	document.form1.wms_show.value = wert3;
+   if (wert3 == 4) {
+		document.form1.wmsSource.nodeValue = "db";
+   }
+	else {
+		document.form1.wmsSource.nodeValue = "capabilities";
+	}
+	document.form1.submit();
+}			
+
+function setButtons(wms_option, wms_option2, wms_option3, wms_option4) {
+	if (typeof(option_all) == "undefined") {
+		option_all = '<?php echo $set_option_all;?>';
+	}
+	document.getElementById("set_option_all").value = option_all;
+	if (typeof(option_group) == "undefined") {
+		option_group = '<?php echo $set_option_group;?>';
+	}
+	document.getElementById("set_option_group").value = option_group;
+	if (typeof(option_gui) == "undefined") {
+		option_gui = '<?php echo $set_option_gui;?>';
+	}
+	document.getElementById("set_option_gui").value = option_gui;
+	if (typeof(option_db) == "undefined") {
+		option_db = '<?php echo $set_option_db;?>';
+	}
+	document.getElementById("set_option_db").value = option_db;
+
+	if (wms_option == '' && wms_option2 == '' && wms_option3 == '' && wms_option4 == '') {
+		if (option_all == '1') {
+			mod_show_wms(1);
+		}
+		else if (option_group == '1') {
+			mod_show_wms(2);
+		}
+		else if (option_gui == '1') {
+			mod_show_wms(3);
+		}
+		else if (option_db == '1') {
+			mod_show_wms(4);
+		}
+	}
+	else {
+		if (option_all == '0') {
+			var aNode = document.getElementById("_option_all");
+			if (aNode != null) removeChildNodes(aNode);
+		}
+		if (option_group == '0') {
+			var aNode = document.getElementById("_option_group");
+			if (aNode != null) removeChildNodes(aNode);
+		}
+		if (option_gui == '0') {
+			var aNode = document.getElementById("_option_gui");
+			if (aNode != null) removeChildNodes(aNode);
+		}
+		if (option_db == '0') {
+			var aNode = document.getElementById("_option_db");
+			if (aNode != null) removeChildNodes(aNode);
+		}
+	}
+}
+
+function removeChildNodes(node) {
+	while (node.childNodes.length > 0) {
+		var childNode = node.firstChild;
+		node.removeChild(childNode);
+	}
+}
+// -->
+</script>
+
+</head>
+<body onLoad="window.focus();setButtons('<?php echo $wms_show;?>','<?php echo $show_gui_configured_wms;?>','<?php echo $show_group_wms;?>','<?php echo $show_gui_wms;?>')">
+
+<?php
+require_once(dirname(__FILE__)."/../classes/class_wms.php"); 
+require_once(dirname(__FILE__)."/../php/mb_getGUIs.php");
+
+$fieldHeight = 20;
+$cnt_gui = 0;
+$cnt_gui_wms = 0;
+$cnt_wms = 0;
+$cnt_user_group = 0;
+$cnt_group = 0;
+$cnt_gui_mb_group = 0;
+$cnt_group_gui_wms = 0;
+$cnt_fkey_group_gui_wms = 0;
+$cnt_fkey_show_gui_wms = 0;
+$cnt_show_gui_wms = 0;
+$cnt_group_name = 0;
+$cnt_gui_table = 0;
+$exists = false;
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+$logged_gui_id=$_SESSION["mb_user_gui"];
+
+######   SQL   #####################################################################################
+
+/*get infos from gui_element ********************************************************/
+
+/*get group from logged user  *******************************************************/
+$sql_user_group = "SELECT * FROM mb_user_mb_group WHERE fkey_mb_user_id= $1 ";
+$array_values = array($logged_user_id);
+$array_types = array('s');
+$res_user_group = db_prep_query($sql_user_group, $array_values, $array_types);
+while($row = db_fetch_array($res_user_group)){
+	$user_id[$cnt_user_group] = $row["fkey_mb_user_id"];
+	$group_id[$cnt_user_group] = $row["fkey_mb_group_id"];
+	$cnt_user_group++;
+}
+/*get group from logged user  ************************************************************/
+
+# Thekla, please recheck
+/*get group name  ********************************************************************************************/								 
+if(count($group_id) > 0){
+	$v = array();
+	$t = array();
+	$sql_group = "SELECT mb_group_id, mb_group_name, mb_group_description FROM mb_group WHERE mb_group_id IN (";	
+	for($i=0; $i < count($group_id); $i++){
+		if($i>0){ $sql_group .= ",";}
+		$sql_group .= "$".strval($i + 1);
+		array_push($v,$group_id[$i]);
+		array_push($t,"i");
+	}		
+	$sql_group.= ") ORDER BY mb_group_name";	
+	$res_group = db_prep_query($sql_group,$v,$t);	
+	while($row = db_fetch_array($res_group)){
+		$mb_group_description[$cnt_group] = $row["mb_group_description"];
+		$my_group_name[$cnt_group] = $row["mb_group_name"];
+		$my_group_id[$cnt_group] = $row["mb_group_id"];
+		$cnt_group++;
+	}				 
+}
+/*get group name  ********************************************************************************************/							 
+
+/*get allocated gui  ********************************************************************************************/
+
+$arrayGuis=mb_getGUIs($logged_user_id);
+$sql_gui = "SELECT * FROM gui WHERE gui_id IN (";
+$v = $arrayGuis;
+$t = array();
+
+for ($i = 1; $i <= count($arrayGuis); $i++){
+	if ($i > 1) { 
+		$sql_gui .= ",";
+	}
+	$sql_gui .= "$" . $i;
+	array_push($t, "s");
+}
+$sql_gui.= ") ORDER BY gui_name";
+
+
+$res_gui = db_prep_query($sql_gui, $v, $t);
+				while($row = db_fetch_array($res_gui)){
+					$gui_id[$cnt_gui] = $row["gui_id"];
+					$gui_name[$cnt_gui] = $row["gui_name"];
+					$gui_description[$cnt_gui] = $row["gui_description"];	
+					#echo"$gui_name[$cnt_gui]";							
+					$cnt_gui++;
+				}
+/*get allocated gui  ********************************************************************************************/
+				 
+/*get allocated wms from allocated gui  ********************************************************************************************/								 
+$sql_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id IN (";
+$v = $arrayGuis;
+$t = array();
+for ($i = 1; $i <= count($arrayGuis); $i++){
+	if ($i > 1) { 
+		$sql_gui_wms .= ",";
+	}
+	$sql_gui_wms .= "$".$i;
+	array_push($t, "s");
+}
+$sql_gui_wms.= ") ORDER BY fkey_wms_id";
+
+$res_gui_wms = db_prep_query($sql_gui_wms, $v, $t);
+while($row = db_fetch_array($res_gui_wms)){
+				$fkey_gui_id[$cnt_gui_wms] = $row["fkey_gui_id"];
+	$fkey_wms_id[$cnt_gui_wms] = $row["fkey_wms_id"];
+	$cnt_gui_wms++;
+}
+/*get allocated wms from allocated gui  ********************************************************************************************/							 
+
+/*get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/								 
+$sql_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_version FROM wms WHERE wms_id IN (";
+$v = $fkey_wms_id;
+$t = array();
+for ($i = 1; $i <= count($fkey_wms_id); $i++){
+	if ($i > 1) { 
+		$sql_wms .= ",";
+	}
+	$sql_wms .= "$".$i;
+	array_push($t, "s");
+}
+$sql_wms.= ") ORDER BY wms_title";
+
+$res_wms = db_prep_query($sql_wms, $v, $t);
+				while($row = db_fetch_array($res_wms)){
+					$wms_title[$cnt_wms] = $row["wms_title"];
+					$wms_abstract[$cnt_wms] = $row["wms_abstract"];
+					$wms_getcapabilities[$cnt_wms] = $row["wms_getcapabilities"];
+					$wms_version[$cnt_wms] = $row["wms_version"];
+					$cnt_wms++;
+				}							 
+/*get allocated wms-Abstract and wms-Capabilities from allocated gui   ********************************************************************************************/							 
+
+
+/*INSERT HTML*/
+echo "<form name='form1' action='" . $PHP_SELF . "?".SID."' method='post'>";
+# Button
+echo "<table border='0' cellpadding='3'  rules='rows'>";
+echo "<tr>";
+if (!empty($wms_show) || !empty($show_gui_configured_wms) || !empty($show_group_wms) || !empty($show_gui_wms)){
+	echo "<td id='_option_all'><input type='button' class='wms_button' name='wms1' value='all wms' onclick='mod_show_wms(1)'></td>";
+	echo "<td id='_option_group'><input type='button' class='wms_button' name='wms2' value='group' onclick = 'mod_show_wms(2)'></td>";	
+	echo "<td id='_option_gui'><input type='button' class='wms_button' name='wms3' value='gui' onclick = 'mod_show_wms(3)'></td>";
+	echo "<td id='_option_db'><input type='button' class='wms_button' name='wms4' value='db' onclick = 'mod_show_wms(4)'></td>";
+	echo "</tr>";
+	echo "</table>";
+
+
+######   SQL   #####################################################################################
+
+
+######   SHOW GUI WMS OR GROUP WMS   #####################################################################################
+
+/*show goup wms  ********************************************************************************************/
+#if (isset($show_group_wms))
+if (!empty($show_group_wms)){
+	/*get gui goup   ********************************************************************************************/
+	$sql_gui_mb_group = "SELECT fkey_gui_id, fkey_mb_group_id FROM gui_mb_group WHERE fkey_mb_group_id=$1";
+	$v = array($show_group_wms);
+	$t = array("s");
+	$res_gui_mb_group = db_prep_query($sql_gui_mb_group, $v, $t);
+
+				while($row = db_fetch_array($res_gui_mb_group)){
+					$group_gui_id[$cnt_gui_mb_group] = $row["fkey_gui_id"];
+					$fkey_mb_group_id[$cnt_gui_mb_group] = $row["fkey_mb_group_id"];
+					#echo"$group_gui_id[$cnt_gui_mb_group]";  
+					$cnt_gui_mb_group++;
+				}
+								 
+  /*get gui goup   ********************************************************************************************/			
+
+	/*get group gui WMS  ********************************************************************************************/
+	if(count($group_gui_id)>0)	{								 
+		$sql_fkey_group_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id IN (";
+		$v = $group_gui_id;
+		$t = array();
+		for ($i = 1; $i <= count($group_gui_id); $i++){
+			if ($i > 1) { 
+				$sql_fkey_group_gui_wms .= ",";
+			}
+			$sql_fkey_group_gui_wms .= "$".$i;
+			array_push($t, "s");
+		}
+		$sql_fkey_group_gui_wms.=  ") ORDER BY fkey_wms_id";
+		
+		$res_fkey_group_gui_wms = db_prep_query($sql_fkey_group_gui_wms, $v, $t);
+		while($row = db_fetch_array($res_fkey_group_gui_wms)){
+			$fkey_group_gui_gui_id[$cnt_fkey_group_gui_wms] = $row["fkey_gui_id"];
+			$fkey_group_gui_wms_id[$cnt_fkey_group_gui_wms] = $row["fkey_wms_id"];
+			#echo"$fkey_group_gui_wms_id[$cnt_fkey_group_gui_wms]";
+			$cnt_fkey_group_gui_wms++;
+		}	
+
+		/*get group gui WMS  ********************************************************************************************/		
+
+		/*group: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/								 
+		if(count($fkey_group_gui_wms_id)>0){
+			$sql_group_gui_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_version FROM wms WHERE wms_id IN (";
+			$v = $fkey_group_gui_wms_id;
+			$t = array();
+			for ($i = 1; $i <= count($fkey_group_gui_wms_id); $i++){
+				if ($i > 1) { 
+					$sql_group_gui_wms .= ",";
+				}
+				$sql_group_gui_wms .= "$".$i;
+				array_push($t, "s");
+			}
+			$sql_group_gui_wms.= ") ORDER BY wms_title";
+		  
+			$res_group_gui_wms = db_prep_query($sql_group_gui_wms, $v, $t);
+			while($row = db_fetch_array($res_group_gui_wms)){
+				$group_wms_title[$cnt_group_gui_wms] = $row["wms_title"];
+				$group_wms_abstract[$cnt_group_gui_wms] = $row["wms_abstract"];
+				$group_wms_getcapabilities[$cnt_group_gui_wms] = $row["wms_getcapabilities"];
+				$group_wms_version[$cnt_group_gui_wms] = $row["wms_version"];
+				#echo"$group_wms_title[$cnt_group_gui_wms]";
+				$cnt_group_gui_wms++;
+			}
+		}         	
+	}		
+					 
+	/*group: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
+
+	/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
+	#if ($show_group_wms > 0)
+	if ($cnt_group_gui_wms > 0){
+		/*get goup name for showing in the table ********************************************************************************************/								 
+		$sql_group_name = "SELECT mb_group_id, mb_group_name FROM mb_group WHERE mb_group_id = $1";   
+		$v = array($show_group_wms);
+		$t = array("s");
+		$res_group_name = db_prep_query($sql_group_name, $v, $t);
+		while($row = db_fetch_array($res_group_name)){
+			$group_name_table[$cnt_group_name] = $row["mb_group_name"];
+			$my_group_id_table[$cnt_group_name] = $row["mb_group_id"];
+			$cnt_group_name++;
+		}
+					 
+	/*get goup name  ********************************************************************************************/
+
+	echo"<br>";
+	echo"<br>";
+		echo"wms from group: $group_name_table[0]";
+		echo"<br>";
+		echo"<br>";	
+	echo "<table border='1' width ='98%' cellpadding='3' rules='rows'>";
+	echo " <thead bgcolor = '#FAEBD7' >";
+	echo "<tr><td width='200' height='10'>WMS-Title</td><td  align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+	echo " </thead>";
+	echo " <tbody >";
+		for($i=0; $i<$cnt_group_gui_wms; $i++){
+			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+			
+			echo "<td><div id ='id_".$group_wms_title[$i]."' class='even' name ='name_".$group_wms_title[$i]."'  style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$group_wms_getcapabilities[$i]."\",\"".$group_wms_version[$i]."\")'>".$group_wms_title[$i]."</div></td>";
+			echo "<td><div id ='id_".$group_wms_abstract[$i]."' class='even' name ='name_".$group_wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$group_wms_getcapabilities[$i]."\",\"".$group_wms_version[$i]."\")'>".$group_wms_abstract[$i]."</div></td>";
+			echo "</tr>";		
+		}		
+		echo "  </tbody>";							 						 
+		echo "</table>";
+		}  
+		else{
+			echo"<br>";
+			echo"<br>";
+			echo "no wms in this group";
+		}/*End: if ($show_group_wms > 0)   *********/
+		/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/	
+
+
+	}/*End: if (!empty($show_group_wms))   *********/
+
+/*show gui wms  ********************************************************************************************/
+if (!empty($show_gui_wms)){
+	/*get group gui WMS  ********************************************************************************************/								 
+	$sql_fkey_show_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id = $1";
+	$v = array($show_gui_wms);
+	$t = array("s");
+	#$sql_fkey_show_gui_wms.= ") ORDER BY fkey_wms_id";
+
+	$res_fkey_show_gui_wms = db_prep_query($sql_fkey_show_gui_wms, $v, $t);
+	while($row = db_fetch_array($res_fkey_show_gui_wms)){
+		$fkey_show_gui_gui_id[$cnt_fkey_show_gui_wms] = $row["fkey_gui_id"];
+		$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms] = $row["fkey_wms_id"];
+		#echo"$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms]";
+		$cnt_fkey_show_gui_wms++;
+	}								 
+	/*get group gui WMS  ********************************************************************************************/		
+
+	/*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/								 
+	if(count($fkey_show_gui_wms_id)>0){
+		$sql_show_gui_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_id, wms_version FROM wms WHERE wms_id IN (";
+		$v = $fkey_show_gui_wms_id;
+		$t = array();
+		for ($i = 1; $i <= count($fkey_show_gui_wms_id); $i++){
+			if ($i > 1) { 
+				$sql_show_gui_wms .= ",";
+			}
+			$sql_show_gui_wms .= "$".$i;
+			array_push($t, "s");
+		}
+		$sql_show_gui_wms.= ") ORDER BY wms_title";
+
+		$res_show_gui_wms = db_prep_query($sql_show_gui_wms, $v, $t);
+		while($row = db_fetch_array($res_show_gui_wms)){
+			$gui_wms_id[$cnt_show_gui_wms] = $row["wms_id"];
+			$gui_wms_title[$cnt_show_gui_wms] = $row["wms_title"];
+			$gui_wms_abstract[$cnt_show_gui_wms] = $row["wms_abstract"];
+			$gui_wms_getcapabilities[$cnt_show_gui_wms] = $row["wms_getcapabilities"];
+			$gui_wms_version[$cnt_show_gui_wms] = $row["wms_version"];
+			#echo"$gui_wms_title[$cnt_show_gui_wms]";
+			$cnt_show_gui_wms++;
+		}							 
+		/*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
+
+		/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
+		#if (isset($cnt_show_gui_wms > 0))
+	}
+
+	if ($cnt_show_gui_wms > 0){
+	/*get selected gui name for table caption ********************************************************************************************/  
+	$sql_gui_table = "SELECT * FROM gui WHERE gui_id = $1";       
+	$v = array($show_gui_wms);
+	$t = array("s");
+	$res_gui_table = db_prep_query($sql_gui_table, $v, $t);
+		while($row = db_fetch_array($res_gui_table)){
+			$gui_id_table[$cnt_gui_table] = $row["gui_id"];
+			$gui_name_table[$cnt_gui_table] = $row["gui_name"];							
+			$cnt_gui_table++;
+			#echo"$gui_id_table[0]";
+		}
+
+		/*get selected gui name for table caption ********************************************************************************************/
+
+		echo"<br>";
+		echo"<br>";
+			echo"wms from gui: $gui_name_table[0]";
+			echo"<br>";
+			echo"<br>";
+		echo "<table border='1'  width ='98%'   cellpadding='3' rules='rows'>";
+		echo " <thead bgcolor = '#FAEBD7' >";
+		echo "<tr><td width='200' height='10'>WMS-Title</td><td  align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+		echo " </thead>";
+		echo " <tbody >";
+		for($i=0; $i<$cnt_show_gui_wms; $i++){
+			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+			echo "<td><div id ='id_".$gui_wms_title[$i]."' class='even' name ='name_".$gui_wms_title[$i]."'  style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$gui_wms_getcapabilities[$i]."\",\"".$gui_wms_version[$i]."\")'>".$gui_wms_title[$i]."</div></td>";
+			echo "<td><div  id ='id_".$gui_wms_abstract[$i]."' class='even' name ='name_".$gui_wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$gui_wms_getcapabilities[$i]."\",\"".$gui_wms_version[$i]."\")'>".$gui_wms_abstract[$i]."</div></td>";
+			echo "</tr>";	
+		}	
+		echo "  </tbody>";							 						 
+		echo "</table>";
+	}
+	else{
+		echo"<br>";
+		echo"<br>";
+		echo"<br>";
+
+		echo "no wms in this gui";
+  	}  /*End: if ($cnt_show_gui_wms > 0)  *********/
+	/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/	
+
+
+} /*End: if(isset($show_gui_wms))   *********/
+
+
+
+/*show gui wms  ********************************************************************************************/
+if (!empty($show_gui_configured_wms)){
+	/*get group gui WMS  ********************************************************************************************/								 
+	$sql_fkey_show_gui_wms = "SELECT DISTINCT fkey_wms_id, fkey_gui_id FROM gui_wms WHERE fkey_gui_id = $1";
+	#$sql_fkey_show_gui_wms.= ") ORDER BY fkey_wms_id";
+	$v = array($show_gui_configured_wms);
+	$t = array("s");
+	$res_fkey_show_gui_wms = db_prep_query($sql_fkey_show_gui_wms, $v, $t);
+	while($row = db_fetch_array($res_fkey_show_gui_wms)){
+		$fkey_show_gui_gui_id[$cnt_fkey_show_gui_wms] = $row["fkey_gui_id"];
+		$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms] = $row["fkey_wms_id"];
+		#echo"$fkey_show_gui_wms_id[$cnt_fkey_show_gui_wms]";
+		$cnt_fkey_show_gui_wms++;
+	}								 
+	/*get group gui WMS  ********************************************************************************************/		
+
+	/*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/								 
+	if(count($fkey_show_gui_wms_id)>0){
+		$sql_show_gui_wms = "SELECT DISTINCT wms_title, wms_abstract, wms_getcapabilities, wms_id, wms_version FROM wms WHERE wms_id IN (";
+		$v = $fkey_show_gui_wms_id;
+		$t = array();
+		for ($i = 1; $i <= count($fkey_show_gui_wms_id); $i++){
+			if ($i > 1) { 
+				$sql_show_gui_wms .= ",";
+			}
+			$sql_show_gui_wms .= "$".$i;
+			array_push($t, "s");
+		}
+		$sql_show_gui_wms.= ") ORDER BY wms_title";
+
+		$res_show_gui_wms = db_prep_query($sql_show_gui_wms, $v, $t);
+		while($row = db_fetch_array($res_show_gui_wms)){
+			$gui_wms_id[$cnt_show_gui_wms] = $row["wms_id"];
+			$gui_wms_title[$cnt_show_gui_wms] = $row["wms_title"];
+			$gui_wms_abstract[$cnt_show_gui_wms] = $row["wms_abstract"];
+			$gui_wms_getcapabilities[$cnt_show_gui_wms] = $row["wms_getcapabilities"];
+			$gui_wms_version[$cnt_show_gui_wms] = $row["wms_version"];
+			#echo"$gui_wms_title[$cnt_show_gui_wms]";
+			$cnt_show_gui_wms++;
+		}							 
+		/*gui: get allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
+
+		/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/
+		#if (isset($cnt_show_gui_wms > 0))
+	}
+
+	if ($cnt_show_gui_wms > 0){
+	/*get selected gui name for table caption ********************************************************************************************/  
+	$sql_gui_table = "SELECT * FROM gui WHERE gui_id = $1";
+	$v = array($show_gui_configured_wms);
+	$t = array("s");       
+	$res_gui_table = db_prep_query($sql_gui_table, $v, $t);
+		while($row = db_fetch_array($res_gui_table)){
+			$gui_id_table[$cnt_gui_table] = $row["gui_id"];
+			$gui_name_table[$cnt_gui_table] = $row["gui_name"];							
+			$cnt_gui_table++;
+			#echo"$gui_id_table[0]";
+		}
+
+		/*get selected gui name for table caption ********************************************************************************************/
+
+		echo"<br>";
+		echo"<br>";
+			echo"wms from gui: $gui_name_table[0]";
+			echo"<br>";
+			echo"<br>";
+		echo "<table border='1'  width ='98%'   cellpadding='3' rules='rows'>";
+		echo " <thead bgcolor = '#FAEBD7' >";
+		echo "<tr><td width='200' height='10'>WMS-Title</td><td  align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+		echo " </thead>";
+		echo " <tbody >";
+		for($i=0; $i<$cnt_show_gui_wms; $i++){
+			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+			echo "<td><div id ='id_".$gui_wms_title[$i]."' class='even' name ='name_".$gui_wms_title[$i]."'  style='cursor:pointer' onclick = 'mod_addWMSfromDB(\"".$show_gui_configured_wms."\",\"".$gui_wms_id[$i]."\")'>".$gui_wms_title[$i]."</div></td>";
+			echo "<td><div  id ='id_".$gui_wms_abstract[$i]."' class='even' name ='name_".$gui_wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromDB(\"".$show_gui_configured_wms."\",\"".$gui_wms_id[$i]."\")'>".$gui_wms_abstract[$i]."</div></td>";
+			echo "</tr>";	
+		}	
+		echo "  </tbody>";							 						 
+		echo "</table>";
+	}
+	else{
+		echo"<br>";
+		echo"<br>";
+		echo"<br>";
+
+		echo "no wms in this gui";
+  	}  /*End: if ($cnt_show_gui_wms > 0)  *********/
+	/*table with allocated wms-Abstract and wms-Capabilities from allocated gui  ********************************************************************************************/	
+
+
+} /*End: if(isset($show_gui_configured_wms))   *********/
+
+######   SHOW GUI WMS OR GROUP WMS   #####################################################################################
+
+######   SHOW GUI OR GROUP OR ALL WMS   #####################################################################################
+
+	if ($wms_show == 4){ #gui
+		echo"<br>";
+		echo"<br>";
+		echo"Please select a gui:";
+		echo"<br>";
+		echo"<br>";	
+		echo "<table border='1' width='98%' cellpadding='3' rules='rows'>";
+		echo " <thead bgcolor = 'lightgrey' >";
+		echo "<tr><td width='200' height='10'>gui name</td><td  align = 'left' class='fieldnames_s'>description</td>";
+		echo " </thead>";
+		echo " <tbody >";
+		for($i=0; $i<$cnt_gui; $i++){
+			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+			echo "<td><div id ='id_".$gui_name[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_name[$i]."'  style='cursor:pointer'  onclick = 'mod_show_gui_configured_wms(\"".$gui_id[$i]."\")'>".$gui_name[$i]."</div></td>";
+			echo "<td><div id ='id_".$gui_description[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_description[$i]."' style='cursor:pointer' onclick = 'mod_show_gui_configured_wms(\"".$gui_id[$i]."\")'>".$gui_description[$i]."</div></td>";
+			echo "</tr>";
+		}		
+		echo "  </tbody>";							 						 
+		echo "</table>";		
+
+	}
+	if ($wms_show == 3){ #gui
+		echo"<br>";
+		echo"<br>";
+		echo"Please select a gui:";
+		echo"<br>";
+		echo"<br>";	
+		echo "<table border='1' width='98%' cellpadding='3' rules='rows'>";
+		echo " <thead bgcolor = 'lightgrey' >";
+		echo "<tr><td width='200' height='10'>gui name</td><td  align = 'left' class='fieldnames_s'>description</td>";
+		echo " </thead>";
+		echo " <tbody >";
+		for($i=0; $i<$cnt_gui; $i++){
+			echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+			echo "<td><div id ='id_".$gui_name[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_name[$i]."'  style='cursor:pointer'  onclick = 'mod_show_gui_wms(\"".$gui_id[$i]."\")'>".$gui_name[$i]."</div></td>";
+			echo "<td><div id ='id_".$gui_description[$i]."' value='".$gui_id[$i]."' class='even' name ='".$gui_description[$i]."' style='cursor:pointer' onclick = 'mod_show_gui_wms(\"".$gui_id[$i]."\")'>".$gui_description[$i]."</div></td>";
+			echo "</tr>";
+		}		
+		echo "  </tbody>";							 						 
+		echo "</table>";		
+
+	}
+	elseif  ($wms_show== 2){  # group
+		echo"<br>";
+		echo"<br>";
+  
+		if($cnt_group>0){
+			echo "Please select a group:";
+			echo"<br>";
+			echo"<br>";
+			echo "<table border='1' width='98%' cellpadding='3' rules='rows'>";
+			echo " <thead bgcolor = 'lightgrey' >";
+			echo "<tr><td  width='200' height='10'>group name</td><td  align = 'left' class='fieldnames_s'>description</td>";
+			echo " </thead>";
+			echo " <tbody >";
+			for($i=0; $i<$cnt_group; $i++){
+				echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";  				
+				echo "<td><div id ='id_".$my_group_name[$i]."' value='".$my_group_id[$i]."' class='even' name ='".$my_group_name[$i]."'  style='cursor:pointer'  onclick = 'mod_show_group_wms(\"".$my_group_id[$i]."\")'>".$my_group_name[$i]."</div></td>";
+				echo "<td><div id ='id_".$mb_group_description[$i]."' value='".$my_group_id[$i]."' class='even' name ='".$mb_group_description[$i]."' style='cursor:pointer' onclick = 'mod_show_group_wms(\"".$my_group_id[$i]."\")'>".$mb_group_description[$i]."</div></td>";
+				echo "</tr>";
+			}		
+			echo "  </tbody>";							 						 
+			echo "</table>";
+		}
+		else{
+			echo"no group for this user";
+		}
+	
+	}
+	elseif  ($wms_show== 1){  # all wms
+		echo"<br>";
+		echo"<br>";
+
+		echo "<table border='1'  width ='98%'   cellpadding='3' rules='rows'>";
+		echo " <thead bgcolor = '#FAEBD7' >";
+		echo "<tr><td width='200' height='10'>WMS-Title</td><td  align = 'left' class='fieldnames_s'>WMS-Abstract</td>";
+		echo " </thead>";
+		echo " <tbody >";
+		for($i=0; $i<$cnt_wms; $i++){
+        	echo "<tr class='Farbe' onmouseover='this.style.backgroundColor = \"#F08080\"' onmouseout='this.style.backgroundColor = \"#ffffff\"'>";
+			echo "<td><div id ='id_".$wms_title[$i]."' class='even' name ='name_".$wms_title[$i]."'  style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_title[$i]."</div></td>";
+			echo "<td><div  id ='id_".$wms_abstract[$i]."' class='even' name ='name_".$wms_abstract[$i]."' style='cursor:pointer' onclick = 'mod_addWMSfromfilteredList(\"".$wms_getcapabilities[$i]."\",\"".$wms_version[$i]."\")'>".$wms_abstract[$i]."</div></td>";
+			echo "</tr>"; 					 					
+		}		
+		echo "  </tbody>";							 						 
+		echo "</table>";
+	}
+}
+
+
+######   SHOW GUI OR GROUP OR ALL WMS   #####################################################################################
+
+
+/*show group wms  ********************************************************************************************/
+echo "<input type='hidden' name='show_group_wms'>";
+/*show gui wms  ********************************************************************************************/
+echo "<input type='hidden' name='show_gui_wms'>";
+echo "<input type='hidden' name='show_gui_configured_wms'>";
+/*show button  ********************************************************************************************/
+echo "<input type='hidden' name='wms_show'>";
+echo "<input id='wmsSource' type='hidden' name='wmsSource'>";
+echo "<input name ='set_option_all' id='set_option_all' type='hidden'>";
+echo "<input name='set_option_group' id='set_option_group' type='hidden'>";
+echo "<input name='set_option_gui' id='set_option_gui' type='hidden'>";
+echo "<input name='set_option_db' id='set_option_db' type='hidden'>";
+echo "</form>";
+?>
+<script type="text/javascript">
+
+// -->
+</script>
+</body>
 </html>
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_add_SLD.php
===================================================================
--- branches/print_dev/http/javascripts/mod_add_SLD.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_add_SLD.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,64 +1,63 @@
-<?php
-# $Id$
-# add SLD-Parameter parameters to MapRequest
-# http://www.mapbender.org/index.php/mod_add_vendorspecific.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.
-
-?>
-var sldURL = "";
-var mod_remove_layer_and_styles = "";
-var removeLayerAndStylesAffectedWMSTitle = "deegree wms";
-//var addSldAffectedWMSTitle = "deegree wms";
-//var sldLocationUrl = "http://wms1.ccgis.de/mapbender_dev/tmp/";
-
-var addSldAffectedWMSTitle = "Bonn Ergebnisse"; 
-var sldLocationUrl = "http://localhost/bonn_orlando_svn/http/tmp/"; 
-
-mod_remove_layer_and_styles += "if (sldURL != '' && (functionName == 'setMapRequest' || functionName == 'setSingleMapRequest') && mb_mapObj[i].wms[ii].wms_title == removeLayerAndStylesAffectedWMSTitle){";
-mod_remove_layer_and_styles += "newMapURL = newMapURL.replace(/LAYERS=[^&]*&/, '');";
-mod_remove_layer_and_styles += "newMapURL = newMapURL.replace(/STYLES=[^&]*&/, '');";
-mod_remove_layer_and_styles += "}";
-
-function mod_sld_init(wmsTitle, functionName) {
-		//alert(sldURL + ' ' + functionName );
-	if (sldURL != ''){
-		if (functionName == 'setMapRequest' || functionName == 'setSingleMapRequest') {
-			//Stadt Bonn: if (wmsTitle == 'deegree wms'){	
-					
-			if (wmsTitle == addSldAffectedWMSTitle){
-				return 'SLD=' + sldURL;
-			}
-		}
-	}
-
-	return "";
-}
-
-
-mb_registerVendorSpecific(mod_remove_layer_and_styles);
-mb_registerVendorSpecific("mod_sld_init(mb_mapObj[i].wms[ii].wms_title, functionName);");
-
-
-function mod_set_sld(sldString){ 
-	//console.debug("%s",sldString);  
-	mb_ajax_post("../orlando/saveSLD.php", {'sld':sldString}, function (json, status) {
-	var result = eval('('+json+')');
-	sldURL = sldLocationUrl + result.filename;
-	zoom("mapframe1", true,0.9999);
-	});
-
-}
+<?php
+# $Id$
+# add SLD-Parameter parameters to MapRequest
+# http://www.mapbender.org/index.php/mod_add_vendorspecific.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.
+
+?>
+var sldURL = "";
+var mod_remove_layer_and_styles = "";
+var removeLayerAndStylesAffectedWMSTitle = "deegree wms";
+//var addSldAffectedWMSTitle = "deegree wms";
+//var sldLocationUrl = "http://wms1.ccgis.de/mapbender_dev/tmp/";
+
+var addSldAffectedWMSTitle = "Bonn Ergebnisse"; 
+var sldLocationUrl = "http://localhost/bonn_orlando_svn/http/tmp/"; 
+
+mod_remove_layer_and_styles += "if (sldURL != '' && (functionName == 'setMapRequest' || functionName == 'setSingleMapRequest') && mb_mapObj[i].wms[ii].wms_title == removeLayerAndStylesAffectedWMSTitle){";
+mod_remove_layer_and_styles += "newMapURL = newMapURL.replace(/LAYERS=[^&]*&/, '');";
+mod_remove_layer_and_styles += "newMapURL = newMapURL.replace(/STYLES=[^&]*&/, '');";
+mod_remove_layer_and_styles += "}";
+
+function mod_sld_init(wmsTitle, functionName) {
+		//alert(sldURL + ' ' + functionName );
+	if (sldURL != ''){
+		if (functionName == 'setMapRequest' || functionName == 'setSingleMapRequest') {
+			//Stadt Bonn: if (wmsTitle == 'deegree wms'){	
+					
+			if (wmsTitle == addSldAffectedWMSTitle){
+				return 'SLD=' + sldURL;
+			}
+		}
+	}
+
+	return "";
+}
+
+
+mb_registerVendorSpecific(mod_remove_layer_and_styles);
+mb_registerVendorSpecific("mod_sld_init(mb_mapObj[i].wms[ii].wms_title, functionName);");
+
+
+function mod_set_sld(sldString){ 
+	mb_ajax_post("../orlando/saveSLD.php", {'sld':sldString}, function (json, status) {
+	var result = eval('('+json+')');
+	sldURL = sldLocationUrl + result.filename;
+	zoom("mapframe1", true,0.9999);
+	});
+
+}

Modified: branches/print_dev/http/javascripts/mod_add_vendorspecific.php
===================================================================
--- branches/print_dev/http/javascripts/mod_add_vendorspecific.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_add_vendorspecific.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,28 +1,28 @@
-<?php
-# $Id:
-# add vendor-specific parameters to MapRequest and FeatureInfoRequests
-# http://www.mapbender.org/index.php/mod_add_vendorspecific.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(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-mb_registerVendorSpecific("mod_vs_init()");
-function mod_vs_init(){   
-   var re = "vendorspecific=<?php echo $_SESSION['mb_user_name'] ?>";
-   return re;
-}
-
+<?php
+# $Id:
+# add vendor-specific parameters to MapRequest and FeatureInfoRequests
+# http://www.mapbender.org/index.php/mod_add_vendorspecific.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(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+mb_registerVendorSpecific("mod_vs_init()");
+function mod_vs_init(){   
+   var re = "vendorspecific=<?php echo $_SESSION['mb_user_name'] ?>";
+   return re;
+}
+

Modified: branches/print_dev/http/javascripts/mod_adminNavigation.js
===================================================================
--- branches/print_dev/http/javascripts/mod_adminNavigation.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_adminNavigation.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,8 +1,8 @@
-eventInit.register(function () {
-	$("a").click(function () {
-		$("a").each(function () {
-			this.style.color = "#808080";
-		});
-		this.style.color = "#0000ff";
-	});
+eventInit.register(function () {
+	$("a").click(function () {
+		$("a").each(function () {
+			this.style.color = "#808080";
+		});
+		this.style.color = "#0000ff";
+	});
 });
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_copyright.php
===================================================================
--- branches/print_dev/http/javascripts/mod_copyright.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_copyright.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -16,18 +16,16 @@
 # 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-include '../include/dyn_js.php';
-
-echo "var mod_copyright_target = '".$e_target[0]."';";
 ?>
+var mod_copyright_target = options.target;
+
 try{
-	if (mod_copyright_text){}
+	if (options.mod_copyright_text){}
 }
 catch(e){
-	mod_copyright_text = "mapbender.org"
+	options.mod_copyright_text = "mapbender.org"
 }
+var mod_copyright_text = options.mod_copyright_text;
 
 var mod_copyright_left = 5;
 var mod_copyright_bottom = 20;
@@ -40,14 +38,13 @@
 	mod_copyright();
 });
 function mod_copyright(){
-	var ind = getMapObjIndexByName(mod_copyright_target);
-	var myMapObj = mb_mapObj[ind];
+	var myMapObj = Mapbender.Modules[mod_copyright_target];
 
 	var str_c = "<div>";
-	str_c += "<img src='../img/transparent.gif' width ='"+mb_mapObj[ind].width+"' height='"+mb_mapObj[ind].height+"'>";
-	str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color1+";position:absolute;top:"+(mb_mapObj[ind].height - (mod_copyright_bottom-1))+"px;left:"+mod_copyright_left+"px'>"+mod_copyright_text+"</div>";
-	str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color1+";position:absolute;top:"+(mb_mapObj[ind].height - mod_copyright_bottom)+"px;left:"+mod_copyright_left+"px'>"+mod_copyright_text+"</div>";
-	str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color2+";position:absolute;top:"+(mb_mapObj[ind].height - mod_copyright_bottom)+"px;left:"+(mod_copyright_left+1)+"px'>"+mod_copyright_text+"</div>";
+	str_c += "<img src='../img/transparent.gif' width ='"+myMapObj.width+"' height='"+myMapObj.height+"'>";
+	str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color1+";position:absolute;top:"+(myMapObj.height - (mod_copyright_bottom-1))+"px;left:"+mod_copyright_left+"px'>"+mod_copyright_text+"</div>";
+	str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color1+";position:absolute;top:"+(myMapObj.height - mod_copyright_bottom)+"px;left:"+mod_copyright_left+"px'>"+mod_copyright_text+"</div>";
+	str_c += "<div style='font-family:"+mod_copyright_font+";font-size:"+mod_copyright_fontsize+";color:"+mod_copyright_color2+";position:absolute;top:"+(myMapObj.height - mod_copyright_bottom)+"px;left:"+(mod_copyright_left+1)+"px'>"+mod_copyright_text+"</div>";
 	str_c += "</div>";
 
 	var map_el = myMapObj.getDomElement();
@@ -57,15 +54,13 @@
 		el_top.style.position = "absolute";
 		el_top.style.top = "0px";
 		el_top.style.left = "0px";
-		el_top.style.width = "0px";
-		el_top.style.height = "0px";
+		el_top.style.width = myMapObj.width;
+		el_top.style.height = myMapObj.height;
 		el_top.style.overflow = "hidden";
-		el_top.style.zIndex = "10";
-		el_top.style.visibility = "hidden";
+		el_top.style.zIndex = "1000";
 		el_top.style.cursor = "crosshair";
-		el_top.style.backgroundColor = "#ff0000";
 		el_top.id = myMapObj.elementName+"_copyright";
 		map_el.appendChild(el_top);
 	}
 	writeTag(myMapObj.frameName, myMapObj.elementName+"_copyright", str_c);
-}
+}
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_digitize_tab.php
===================================================================
--- branches/print_dev/http/javascripts/mod_digitize_tab.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_digitize_tab.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -131,9 +131,62 @@
 try {if(nonTransactionalEditable){}}catch(e) {nonTransactionalEditable = false;}
 try {if(addCloneGeometryButton){}}catch(e) {addCloneGeometryButton = false;}
 
+function toggleTabs(tabId) {
+	if(!initialTab) {
+		return;
+	}
 
+	var tabHeaders = wfsWindow.document.getElementsByTagName('a');
+	var tabs       = wfsWindow.document.getElementsByTagName('div');
+	
+	for(var i = 0; i < tabHeaders.length; i++) {
+		if(tabHeaders[i].id.indexOf('tabheader') != -1) {
+			tabHeaders[i].className = 'tabheader';
+		}
+	}
+	
+	for(var i = 0; i < tabs.length; i++) {
+		if(tabs[i].className === 'tabcontent') {
+			tabs[i].style.visibility = 'hidden';
+			tabs[i].style.display    = 'none';
+		}
+	}
+	
+	wfsWindow.document.getElementById('tabheader_' + tabId).className += ' active';
+	
+	wfsWindow.document.getElementById('tab_' + tabId).style.visibility = 'visible';
+	wfsWindow.document.getElementById('tab_' + tabId).style.display    = 'block';
+	
+	return false;
+}
+
+function showHelptext(helptextId) {
+	hideHelptext();
+	wfsWindow.document.getElementById('helptext' + helptextId).style.visibility = 'visible';
+	wfsWindow.document.getElementById('helptext' + helptextId).style.display    = 'block';
+
+	return false;
+}
+
+function hideHelptext(helptextId) {
+	if(helptextId) {
+		wfsWindow.document.getElementById('helptext' + helptextId).style.visibility = 'hidden';
+		wfsWindow.document.getElementById('helptext' + helptextId).style.display    = 'none';
+	}
+
+	var helptext = wfsWindow.document.getElementsByTagName('div');
+	
+	for(var i = 0; i < helptext.length; i++) {
+		if(helptext[i].className === 'helptext') {
+			helptext[i].style.visibility = 'hidden';
+			helptext[i].style.display    = 'none';
+		}
+	}
+
+	return false;
+}
 function getMousePosition(e) {
-	parent.mb_getMousePos(e, mod_digitize_target);
+	parent.mb_getMousePos(e);
 	var currentPos = null;
 	if (mapType == "DIV") {
 		currentPos = new parent.Point(
@@ -1321,19 +1374,26 @@
 function validBoxEntrySelected(form){
 	var isCorrect = true;
 	var errorMessage = "";
+	var name = "";
 	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};
+			name += form.childNodes[i].name;
+			if (parseInt(form.childNodes[i].selectedIndex) == 0 && form.childNodes[i].getAttribute("mandatory") == "true") {
+				var msg = name + ": " + msgObj.messageSelectAnOption + "\n"
+				var categ = form.childNodes[i].getAttribute("category");
+				if (typeof(categ) != "undefined") {
+					msg = categ + " => " + msg;
+				}
+				return {"isCorrect":false, "errorMessage":msg};
 			}
 		}
 		else if (form.childNodes[i].hasChildNodes()) {
-			isCorrect = validBoxEntrySelected(form.childNodes[i]).isCorrect;
+			var res = validBoxEntrySelected(form.childNodes[i]);
+			errorMessage = res.errorMessage + errorMessage;
+			isCorrect = res.isCorrect;
+			
 		}
 	}
-	if (!isCorrect) {
-		errorMessage = msgObj.messageSelectAnOption + "\n";
-	}
 	return {"isCorrect":isCorrect, "errorMessage":errorMessage};
 }
 
@@ -1554,8 +1614,9 @@
 	//
 
 	var onChangeText = "document.getElementById('elementForm').innerHTML = ";
-	onChangeText += "window.opener.buildElementForm(this.value , " + geometryIndex + ");";
+	onChangeText += "window.opener.buildElementForm(this.value, " + geometryIndex + ");";
 	onChangeText += "window.opener.setWfsWindowStyle(this.value);";
+	onChangeText += "$('.hasDatepicker').datepicker();";
 	
 	str += "\t<select name='wfs' size='" + wfsConf.length + "'";
 	str += " onChange=\""+ onChangeText +"\"";
@@ -1577,25 +1638,155 @@
 
 	
 	str += "</select>\n\t\t</form>\n\t";
-	str += "<div id='elementForm'>\n</div>";
 	
+	var elForm = "";
 	if (defaultIndex != -1) {
-		wfsWindow.document.writeln("<html><head><meta http-equiv='Content-Type' content='text/html; charset=<?php echo CHARSET;?>'><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);
+		elForm = buildElementForm(defaultIndex, geometryIndex);
+
+		var headStr = "<html><head><style type='text/css'>" + wfsConf[defaultIndex]['g_style'] + "</style>";
+		headStr += '<link rel="stylesheet" type="text/css" href="../extensions/theme/ui.all.css" />';
+		headStr += '<style type="text/css">'
+		headStr += 'a.tabheader { margin: 0 3px 0 0;padding: 1px 5px;text-decoration: none;color: #999;background-color: #F5F5F5;border: 1px solid #999;border-bottom: 0; }';
+		headStr += 'a.tabheader.active { color: #666;background-color: transparent;border-color: #666;border-bottom: 1px solid #FFF;cursor: default; }';
+		headStr += 'div.tabcontent { visibility: hidden;display: none;margin: 1px 0 5px 0;padding: 5px;border: 1px solid #666; }';
+		headStr += 'div.helptext { visibility: hidden;display: none;position: absolute;top: 5%;left: 5%;width: 85%;padding: 5px;color: #000;background-color: #CCC;border: 1px solid #000; }';
+		headStr += 'div.helptext p { margin: 0 ; }';
+		headStr += 'div.helptext p a.close { display: block;margin: 5px auto;text-align: center; }';
+		headStr += 'a img { vertical-align: middle;border: 0; }';
+		headStr += '</style>';
+		headStr += '</head><body onload="window.opener.toggleTabs(\''+initialTab+'\'); var $dp = $(\'.hasdatepicker\');$dp.datepicker();">';
+		wfsWindow.document.write(headStr);
 	}
 	else {
-		wfsWindow.document.writeln("<html><head><meta http-equiv='Content-Type' content='text/html; charset=<?php echo CHARSET;?>'><style type='text/css'></style></head><body></body></html>");
-		wfsWindow.document.write(str);
-		wfsWindow.document.close();
+		var headStr = "<html><head><style type='text/css'></style></head><body>";
+		wfsWindow.document.write(headStr);
 	}
+	str += "<div id='elementForm'>\n" + elForm + "</div>";
+	str += "<script type='text/javascript' src='../extensions/jquery-1.3.2.min.js'><\/script>";
+	str += "<script type='text/javascript' src='../extensions/jquery-ui-1.7.1.w.o.effects.min.js'><\/script>";
+	str += "</body></html>";
+	wfsWindow.document.write(str);
+	wfsWindow.document.close();
+
+//	toggleTabs(initialTab);
+
 }
 
 function setWfsWindowStyle(wfsConfIndex) {
 	wfsWindow.document.getElementsByTagName("style")[0].innerHTML = wfsConf[wfsConfIndex]['g_style'];
 }
 
+function prepareSelectBox (formElementHtml, categoryName, isMandatory, elementLabel, elementValue) {
+	// set category
+	if (categoryName) {
+		var patternString = "<select";
+		var pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, patternString + " category='" + categoryName + "' ");
+	}
+
+	if (isMandatory) {
+		// set border if mandatory
+		patternString = "<select";
+		pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, patternString + " mandatory='true' style='border:1px solid red' ");
+	}
+
+	// set name of select box to elementlabel
+	patternString = "name\s*=\s*\\*'\w+\\*'";
+	pattern = new RegExp(patternString);
+	if (pattern.test(formElementHtml)) {
+		formElementHtml = formElementHtml.replace(pattern, "name='" + elementLabel + "'");
+	}
+	else {
+		patternString = "<select";
+		pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, "<select name='" + elementLabel + "'");
+	}
+	
+	// preselect the correct entry of the box
+	patternString = "option( )+value( )*=( )*'"+elementValue+"'";
+	pattern = new RegExp(patternString);
+	var patternStringForReplace = "option value = '"+elementValue+"'";
+	formElementHtml = formElementHtml.replace(pattern, patternStringForReplace+" selected");
+	return formElementHtml;
+}
+
+function prepareDatepicker (formElementHtml, categoryName, isMandatory, elementLabel, elementValue) {
+	// set category
+	if (categoryName) {
+		var patternString = "<input";
+		var pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, patternString + " category='" + categoryName + "' ");
+	}
+
+	if (isMandatory) {
+		// set border if mandatory
+		patternString = "<input";
+		pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, patternString + " mandatory='true' style='border:1px solid red' ");
+	}
+
+	// set name of select box to elementlabel
+	patternString = "name\s*=\s*\\*'\w+\\*'";
+	pattern = new RegExp(patternString);
+	if (pattern.test(formElementHtml)) {
+		formElementHtml = formElementHtml.replace(pattern, "name='" + elementLabel + "'");
+	}
+	else {
+		patternString = "<input";
+		pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, "<input name='" + elementLabel + "'");
+	}
+	
+	// preselect the correct entry of the box
+	patternString = "<input";
+	pattern = new RegExp(patternString);
+	formElementHtml = formElementHtml.replace(pattern, patternString + " value='"+elementValue+"'");
+
+	return formElementHtml;
+}
+
+function prepareTextArea (formElementHtml, categoryName, isMandatory, elementLabel, elementValue) {
+	// set category
+	if (categoryName) {
+		var patternString = "<textarea";
+		var pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, patternString + " category='" + categoryName + "' ");
+	}
+
+	if (isMandatory) {
+		// set border if mandatory
+		patternString = "<textarea";
+		pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, patternString + " mandatory='true' style='border:1px solid red' ");
+	}
+
+	// set name of select box to elementlabel
+	patternString = "name\s*=\s*\\*'\w+\\*'";
+	pattern = new RegExp(patternString);
+	if (pattern.test(formElementHtml)) {
+		formElementHtml = formElementHtml.replace(pattern, "name='" + elementLabel + "'");
+	}
+	else {
+		patternString = "<textarea";
+		pattern = new RegExp(patternString);
+		formElementHtml = formElementHtml.replace(pattern, "<textarea name='" + elementLabel + "'");
+	}
+	
+	// preselect the correct entry of the box
+	patternString = "<\/textarea>";
+	pattern = new RegExp(patternString);
+	formElementHtml = formElementHtml.replace(pattern, elementValue + patternString);
+
+	return formElementHtml;
+}
+
+
+
+// Returns a form with the elements of a selected WFS grouped in tabs
+// (if the original WFS is the selected WFS, the values are set too)
+var initialTab = false;
+
 // 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){
@@ -1613,78 +1804,163 @@
 	}
 	
 	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'];
+		// Check if there are categories given and
+		// build the form in tabs if necessary
+		var elementCategories = [];
+		for(var i = 0; i < featureTypeElementArray.length; i++){
+			var categoryName         = featureTypeElementArray[i].f_category_name;
+			var categoryNameIsUnique = true;
+			
+			if(categoryName.length === 0) { continue; }
+			
+			for(var j = 0; j < elementCategories.length; j++) {
+				if(elementCategories[j] == categoryName) {
+					categoryNameIsUnique = false;
+				}
 			}
-			var elementLabelStyle = featureTypeElement['f_label_id'];
+			
+			if(categoryNameIsUnique) {
+				elementCategories.push(categoryName);
+			}
+		}
 
-			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";
+		str += "<form id='"+featureTypeElementFormId+"'>\n\t";
+		
+		var hasCategories = (elementCategories.length > 0);
+		if (hasCategories) {
+			elementCategories.sort();
+			
+			initialTab = elementCategories[0];
+			for (var currentCategory = 0; currentCategory < elementCategories.length; currentCategory++) {
+				str += '<a href="#" id="tabheader_' + elementCategories[currentCategory] + '" class="tabheader" onclick="return window.opener.toggleTabs(\'' + elementCategories[currentCategory] + '\')">' + elementCategories[currentCategory] + '</a>';
+			}
+		}
+			
+		for (var currentCategory = 0; currentCategory < elementCategories.length || !hasCategories; currentCategory++) {
+			if (hasCategories) {
+				str += '<div id="tab_' + elementCategories[currentCategory] + '" class="tabcontent">';
+			}
+			str += '<table>';
 
-					var elementValue = "";
-					if (!featureTypeMismatch) {
-						for (var j = 0 ; j < memberElements.count() ; j ++) {
-							if (memberElements.getName(j) == featureTypeElement['element_name']) {
-								elementValue = memberElements.getValue(j);
+			//
+			// 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); 
+
+				if(hasCategories && featureTypeElement.f_category_name != elementCategories[currentCategory] && !isGeomColumn) {
+					continue;
+				}
+			
+
+				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";
+						if(elementLabelExists) {
+							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";
+						}
+						else {
+							str += '<td colspan="2">';
+						}
+
+						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 || !formElementHtml.match(/&lt;select/)) {
-						str += "\t\t\t\t<input id = 'datatype_mb_digitize_form_" + elementName + "' name='datatype' type='hidden' value = '" + elementType + "'>\n";
-						str += "\t\t\t\t<input id = 'mandatory_mb_digitize_form_" + elementName + "' name='mandatory' type='hidden' value = '" + isMandatory + "'>\n";
-						str += "\t\t\t\t<input id = 'mb_digitize_form_" + elementName + "' name='" + elementLabel + "' type='text' class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
-					}
-					else {
+						var formElementHtml = featureTypeElement['f_form_element_html']; 
+						if (!formElementHtml) {
+							mandatoryHint = '';
+							var mandatoryHint = (parseInt(featureTypeElement['f_mandatory']) == 1) ? ' style="border:1px solid red;"' : '';
+
+							str += "\t\t\t\t<input id = 'datatype_mb_digitize_form_" + elementName + "' name='datatype' type='hidden' value = '" + elementType + "'>\n";
+							str += "\t\t\t\t<input id = 'mandatory_mb_digitize_form_" + elementName + "' name='mandatory' type='hidden' value = '" + isMandatory + "'>\n";
+							if (!hasCategories) {
+								str += "\t\t\t\t<input id = '" + elementName + "' name='" + elementLabel + "' type='text' " + mandatoryHint + " class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
+							}
+							else {
+								str += "\t\t\t\t<input category='"+elementCategories[currentCategory]+"' id = 'mb_digitize_form_" + elementName + "' name='" + elementLabel + "' type='text' " + mandatoryHint + " class = '"+featureTypeElement['f_style_id']+"' size=20 value = '" + elementValue + "'>\n";
+							}
+						}
+						else {
 							while (formElementHtml.match(/\\/)) {
 								formElementHtml = formElementHtml.replace(/\\/, "");
 							} 
-							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";
-							// preselect the correct entry of the box
-							var patternString = "option value( )*=( )*'"+elementValue+"'";
-							var pattern = new RegExp(patternString);
-							var patternStringForReplace = "option value = '"+elementValue+"'";
-							formElementHtml = formElementHtml.replace(pattern, patternStringForReplace+" selected");
-							formElementHtml = formElementHtml.replace(/&lt;/g,'<');
-							formElementHtml = formElementHtml.replace(/&gt;/g,'>');
-							formElementHtml = formElementHtml.replace(/&#039;/g,'\'');
-							
+
+							var isMandatory = (parseInt(featureTypeElement['f_mandatory']) == 1);
+
+							var patternString = "<select";
+							pattern = new RegExp(patternString);
+							if (pattern.test(formElementHtml)) {
+								formElementHtml = prepareSelectBox(formElementHtml, "", isMandatory, elementLabel, elementValue);
+							}
+							var patternString = "hasdatepicker";
+							pattern = new RegExp(patternString);
+							if (pattern.test(formElementHtml)) {
+								formElementHtml = prepareDatepicker(formElementHtml, "", isMandatory, elementLabel, elementValue);
+							}
+							var patternString = "<textarea";
+							pattern = new RegExp(patternString);
+							if (pattern.test(formElementHtml)) {
+								formElementHtml = prepareTextArea(formElementHtml, "", isMandatory, elementLabel, elementValue);
+							}
 							str += formElementHtml;
+						}
+						
+						if(featureTypeElement.f_helptext.length > 0) {
+							str += ' <a href="#" onclick="return window.opener.showHelptext(' + i + ')"><img src="../img/help.png" width="16" height="16" alt="?" /></a> ';
+							str += '<div id="helptext' +i+ '" class="helptext">';
+							str += '<p>';
+							str += featureTypeElement.f_helptext.replace(/(http:\/\/\S*)/g,'<a href="$1" target="blank">$1<\/a>');
+							str += '<a href="#" class="close" onclick="return window.opener.hideHelptext(' + i + ')">close</a>';
+							str += '</p>';
+							str += '</div>';
+						}
+						
+						str += "\t\t\t</td>\n\t\t</tr>\n";
 					}
-					str += "\t\t\t</td>\n\t\t</tr>\n";
 				}
+				else {
+					hasGeometryColumn = true;
+				}
 			}
-			else {
-				hasGeometryColumn = true;
+
+			str += '</table>';
+			if (hasCategories) {
+				str += '</div>';
 			}
+
+			// if no categories exist, the for loop would be 
+			// infinite without this break
+			if (!hasCategories) {
+				break;
+			}
 		}
 
 		//
 		// 3. add buttons "save", "update", "delete"
 		//
-		str += "</table><table>";
+		str += "<table>";
 		var isTransactional = (featureTypeArray['wfs_transaction']); 
 		if (isTransactional) {
 			str += "\t\t<tr>\n";

Modified: branches/print_dev/http/javascripts/mod_featureInfoTunnel.php
===================================================================
--- branches/print_dev/http/javascripts/mod_featureInfoTunnel.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_featureInfoTunnel.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -78,6 +78,7 @@
 			for(var i=0;i<urls.length;i++){
 				(function () {
 					var currentRequest = escape(urls[i]);
+					var cnt = i;
 					mb_ajax_post(path, {'url':currentRequest},function(js_code,status){
 						if(js_code){
 							if(featureInfoLayerPopup == 'true'){
@@ -86,8 +87,8 @@
 									url:path+"?url="+currentRequest,
 									width:parseInt(featureInfoPopupWidth, 10),
 									height:parseInt(featureInfoPopupHeight, 10),
-									top:200 + i*25,
-									left:600 + i*25
+									top:200 + cnt*25,
+									left:600 + cnt*25
 								});
 								p.show();
 							}

Modified: branches/print_dev/http/javascripts/mod_gazetteerSQL_client.php
===================================================================
--- branches/print_dev/http/javascripts/mod_gazetteerSQL_client.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_gazetteerSQL_client.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,391 +1,391 @@
-<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
-<title>Gazetteer</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<script type="text/javascript">
-
-var targetFrameArray = [];
-<?php
-echo "var e_id = '". $e_id . "';";
-for ($i = 0; $i < count($e_target); $i++) {
-	echo "targetFrameArray.push('".$e_target[$i]."');";
-}
-?>
-<!--
-// --- begin: expected element vars ---
-// var scale 
-// var numberOfResults
-// var profile = "adresse" | "alk" | "alb" | "adresse2"
-
-if (typeof(scale) == 'undefined') {
-	var scale = 2000;
-	var e = new parent.Mb_warning("mod_gazetteerSQL: element var scale is missing.");
-}
-if (typeof(numberOfResults) == 'undefined') {
-	var numberOfResults = 0;
-	var e = new parent.Mb_warning("mod_gazetteerSQL: element var numberOfResults is missing.");
-}
-if (typeof(tooManyResultsString) == 'undefined') {
-	var tooManyResultsString = "Too many results. Please specify your query.";
-	var e = new parent.Mb_warning("mod_gazetteerSQL: element var tooManyResultsString is missing.");
-}
-if (typeof(profile) == 'undefined' || (profile != "alb" && profile != "alk" && profile != "adresse" && profile != "adresse2")) {
-	profile = "adresse"
-	var e = new parent.Mb_exception("mod_gazetteerSQL: element var profile is missing.");
-}
-
-// --- end: expected element vars ---
-
-
-var generalPreFunctions = [];
-var generalSubFunctions = [];
-var onloadSubFunctions = [];
-var communesSubFunctions = [];
-var streetSubFunctions = [];
-var numberSubFunctions = [];
-var districtSubFunctions = [];
-var parcelSubFunctions = [];
-var ownerSubFunctions = [];
-
-registerFunction(generalPreFunctions, "disableForm();");
-registerFunction(generalSubFunctions, "enableForm();");
-if (profile == "alb") {
-	registerFunction(onloadSubFunctions, "updateCommunes();");
-	registerFunction(communesSubFunctions, "updateOwner();");
-	registerFunction(ownerSubFunctions, "updateOwner();");
-}
-else if (profile == "alk") {
-	registerFunction(onloadSubFunctions, "updateCommunes();");
-	registerFunction(communesSubFunctions, "updateDistricts();");
-	registerFunction(parcelSubFunctions, "updateParcels();");
-}
-else if (profile == "adresse") {
-	registerFunction(onloadSubFunctions, "updateCommunes();");
-	registerFunction(communesSubFunctions, "updateStreets();");
-	registerFunction(streetSubFunctions, "updateNumbers();");
-}
-else if (profile == "adresse2") {
-	registerFunction(onloadSubFunctions, "updateStreets();");
-	registerFunction(streetSubFunctions, "updateNumbers();");
-}
-
-function executeFunctions(arrayOfFunctionStrings) {
-	for (var i = 0; i < arrayOfFunctionStrings.length; i++) {
-		eval(arrayOfFunctionStrings[i]);
-	}
-}
-
-function registerFunction(functionStringArray, functionString) {
-	functionStringArray.push(functionString);
-}
-
-function disableForm() {
-	document.getElementById('selectCommune').disabled = true;
-	document.getElementById('selectStreet').disabled = true;
-	document.getElementById('selectDistrict').disabled = true;
-	document.getElementById('inputParcel1').disabled = true;
-	document.getElementById('inputParcel2').disabled = true;
-	document.getElementById('inputParcelButton').disabled = true;
-	document.getElementById('inputOwner').disabled = true;
-	document.getElementById('inputOwnerButton').disabled = true;
-	document.getElementById("divResults").innerHTML = searchImage;
-}
-
-function enableForm() {
-	document.getElementById('selectCommune').removeAttribute("disabled");
-	document.getElementById('selectStreet').removeAttribute("disabled");
-	document.getElementById('selectDistrict').removeAttribute("disabled");
-	document.getElementById('inputParcel1').removeAttribute("disabled");
-	document.getElementById('inputParcel2').removeAttribute("disabled");
-	document.getElementById('inputParcelButton').removeAttribute("disabled");
-	document.getElementById('inputOwner').removeAttribute("disabled");
-	document.getElementById('inputOwnerButton').removeAttribute("disabled");
-	document.getElementById("divResults").innerHTML = "";
-}
-
-var highlight;
-var houseLocation;
-var parcelLocation;
-var searchImage = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
-var phpUrl = "../php/mod_gazetteerSQL_server.php";
-
-parent.mb_registerInitFunctions("window.frames['"+e_id+"'].initHighlight()");
-parent.mb_registerInitFunctions("window.frames['"+e_id+"'].executeFunctions(window.frames['"+e_id+"'].onloadSubFunctions)");
-
-
-// - BEGIN -------- HIGHLIGHTING AND ZOOMING ------------------------------------------
-
-function zoomToLocation(aPoint) {
-	parent.mb_repaintScale(targetFrameArray[0], aPoint.x, aPoint.y, scale)
-}
-
-function initHighlight() {
-	var generalHighlightZIndex = 100;
-	var generalHighlightLineWidth = 3;
-	var styleObj = {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex};
-	highlight = new parent.Highlight(targetFrameArray, e_id, styleObj, generalHighlightLineWidth);
-}
-
-function zoomToHouseNumber(houseNumber) {
-	zoomToLocation(houseLocation[houseNumber]);
-	removeHighlight();
-	highlightHouseNumber(houseNumber);
-}
-
-function zoomToParcel(parcelId) {
-	zoomToLocation(parcelLocation[parcelId]);
-	removeHighlight();
-	highlightParcel(parcelId);
-}
-
-function highlightHouseNumber(houseNumber) {
-	var mG = new parent.MultiGeometry(parent.geomType.point);
-	mG.addGeometry();
-	mG.get(-1).addPoint(houseLocation[houseNumber]);
-	highlight.add(mG);
-	highlight.paint();
-}
-
-function highlightParcel(parcelId) {
-	var mG = new parent.MultiGeometry(parent.geomType.point);
-	mG.addGeometry();
-	mG.get(-1).addPoint(parcelLocation[parcelId]);
-	highlight.add(mG);
-	highlight.paint();
-}
-
-function removeHighlight() {
-	highlight.clean();
-}
-
-// - END -------- HIGHLIGHTING AND ZOOMING ------------------------------------------
-
-
-
-function removeChildNodes(node) {
-	while (node.childNodes.length > 0) {
-		var childNode = node.firstChild;
-		node.removeChild(childNode);
-	}
-}
-
-function getSize(result) {
-	if (typeof(result) == "array") {
-		return result.length;
-	}
-	else if (typeof(result) == "object") {
-		var c = 0;
-		for (var attr in result) {
-			c++;
-		}
-		return c;
-	}
-	return 1;
-}
-
-function updateCommunes() {
-	executeFunctions(generalPreFunctions);
-	parent.mb_ajax_json(phpUrl, {"command":"getCommunes"}, function (json, status) {
-		executeFunctions(generalSubFunctions);
-
-		removeChildNodes(document.getElementById('selectCommune'));
-
-		for (var communeId in json.communes) {
-			if (typeof(json.communes[communeId]) != 'function') {
-				var currentNode = document.createElement("option");
-			
-				if (document.getElementById('selectCommune').childNodes.length == 0) {
-					currentNode.selected = "selected";
-				}
-				currentNode.value = communeId;
-				currentNode.innerHTML = json.communes[communeId];
-				document.getElementById('selectCommune').appendChild(currentNode);
-			}
-		}
-		executeFunctions(communesSubFunctions);
-	});
-}
-
-function updateStreets() {
-	executeFunctions(generalPreFunctions);
-	var communeId = document.getElementById('selectCommune').value;
-	
-	parent.mb_ajax_json(phpUrl, {"command":"getStreets", "communeId":communeId}, function (json, status) {
-		executeFunctions(generalSubFunctions);
-
-		removeChildNodes(document.getElementById('selectStreet'));
-
-		for (var streetId in json.streets) {
-			if (typeof(json.streets[streetId]) != 'function') {
-				var currentNode = document.createElement("option");
-	
-				if (document.getElementById('selectStreet').childNodes.length == 0) {
-					currentNode.selected = "selected";
-				}
-				
-				currentNode.value = json.streets[streetId];
-				currentNode.innerHTML = json.streets[streetId];
-				document.getElementById('selectStreet').appendChild(currentNode);
-			}
-		}
-		executeFunctions(streetSubFunctions);
-	});
-}
-
-function updateDistricts() {
-	executeFunctions(generalPreFunctions);
-
-	var communeId = document.getElementById('selectCommune').value;
-	
-	parent.mb_ajax_json(phpUrl, {"command":"getDistricts", "communeId":communeId}, function (districtObject, status) {
-		executeFunctions(generalSubFunctions);
-
-		removeChildNodes(document.getElementById('selectDistrict'));
-
-		for (var districtId in districtObject.districts) {
-			if (typeof(districtObject.districts[districtId]) != 'function') {
-				var currentNode = document.createElement("option");
-	
-				currentNode.value = districtId;
-	
-				if (document.getElementById('selectDistrict').childNodes.length == 0) {
-					currentNode.selected = "selected";
-				}
-				
-				currentNode.value = districtObject.districts[districtId];
-				currentNode.innerHTML = districtObject.districts[districtId];
-				document.getElementById('selectDistrict').appendChild(currentNode);
-			}
-		}
-		executeFunctions(districtSubFunctions);
-	});
-}
-
-function updateNumbers() {
-	executeFunctions(generalPreFunctions);
-
-	var streetName = document.getElementById('selectStreet').value;
-	var communeId = document.getElementById('selectCommune').value;
-
-	parent.mb_ajax_json(phpUrl, {"command":"getNumbers", "communeId":communeId, "streetName":streetName, "numberOfResults":numberOfResults}, function (json, status) {
-		executeFunctions(generalSubFunctions);
-		houseLocation = {};
-		var resultString = "";
-		if (getSize(json.houseNumbers) > 0) {
-			if (json.limited === true) {
-				resultString += tooManyResultsString;
-			}
-			for (var houseNumber in json.houseNumbers) {
-				if (typeof(json.houseNumbers[houseNumber]) != 'function') {
-					houseLocation[houseNumber] = new parent.Point(json.houseNumbers[houseNumber].x, json.houseNumbers[houseNumber].y);
-					resultString += "<b style=\"cursor:pointer\" onclick=\"zoomToHouseNumber('"+houseNumber+"')\" onmouseover=\"highlightHouseNumber('"+houseNumber+"')\" onmouseout=\"removeHighlight()\">"+houseNumber+"</b>&nbsp;&nbsp; ";
-				}
-			}
-		}
-		else {
-			resultString += noResultsString;
-		}
-		document.getElementById("divResults").innerHTML = resultString;
-		executeFunctions(numberSubFunctions);
-	});
-}
-
-function updateParcels() {
-	executeFunctions(generalPreFunctions);
-	
-	var districtId = document.getElementById('selectDistrict').value;
-	var inputParcel1 = document.getElementById('inputParcel1').value;
-	var inputParcel2 = document.getElementById('inputParcel2').value;
-
-
-	parent.mb_ajax_json(phpUrl, {"command":"getLandparcelsByDistrict", "districtId":districtId, "parcelNumber1":inputParcel1, "parcelNumber2":inputParcel2, "numberOfResults":numberOfResults}, function (json, status) {
-		executeFunctions(generalSubFunctions);
-
-		parcelLocation = {};
-		var resultString = "";
-		if (getSize(json.landparcels) > 0) {
-			if (json.limited === true) {
-				resultString += tooManyResultsString;
-			}
-			resultString += "<ol>";
-			for (var parcelId in json.landparcels) {
-				if (typeof(json.landparcels[parcelId]) != 'function') {
-					parcelLocation[parcelId] = new parent.Point(json.landparcels[parcelId].x, json.landparcels[parcelId].y);
-					resultString += "<li style=\"cursor:pointer\" onclick=\"zoomToParcel('"+parcelId+"')\" onmouseover=\"highlightParcel('"+parcelId+"')\" onmouseout=\"removeHighlight()\">"+parcelId+"</li>";
-				}
-			}
-			resultString += "</ol>";
-		}
-		else {
-			resultString += noResultsString;
-		}
-		document.getElementById("divResults").innerHTML = resultString;
-		executeFunctions(numberSubFunctions);
-	});
-}
-
-function updateOwner() {
-	var ownerQueryString = document.getElementById('inputOwner').value;
-	var communeId = document.getElementById('selectCommune').value;
-
-	document.getElementById("divResults").innerHTML = "";
-	document.getElementById('selectCommune').removeAttribute("disabled");
-	document.getElementById('inputOwner').removeAttribute("disabled");
-	document.getElementById('inputOwnerButton').removeAttribute("disabled");
-	
-	if (ownerQueryString != "") {
-		executeFunctions(generalPreFunctions);
-		parent.mb_ajax_json(phpUrl, {"command":"getLandparcelsByOwner", "communeId":communeId, "ownerQueryString":ownerQueryString, "numberOfResults":numberOfResults}, function (json, status) {
-			executeFunctions(generalSubFunctions);
-
-			parcelLocation = {};
-			var resultString = "";
-			if (getSize(json.landparcels) > 0) {
-				if (json.limited === true) {
-					resultString += tooManyResultsString;
-				}
-				resultString += "<ol>";
-				for (var i=0; i < json.landparcels.length; i++) {
-					var parcelId = json.landparcels[i].landparcelId;
-					parcelLocation[parcelId] = new parent.Point(json.landparcels[i].x, json.landparcels[i].y);
-					resultString += "<li style=\"cursor:pointer\" onclick=\"zoomToParcel('"+parcelId+"')\" onmouseover=\"highlightParcel('"+parcelId+"')\" onmouseout=\"removeHighlight()\">"+json.landparcels[i].owner+ " (" + parcelId+")</li>";
-				}
-				resultString += "</ol>";
-			}
-			else {
-				resultString += noResultsString;
-			}
-			document.getElementById("divResults").innerHTML = resultString;
-			executeFunctions(numberSubFunctions);
-	
-		});
-	}
-}
-// -->
-</script>
-</head>
-<body>
-<form>
-<select class='selectCommune' id='selectCommune' onchange='executeFunctions(communesSubFunctions)'></select>
-<select class='selectStreet' id='selectStreet' onchange='executeFunctions(streetSubFunctions);' size=5 disabled></select>
-<select class='selectDistrict' id='selectDistrict' onchange='executeFunctions(districtSubFunctions);' size=5 disabled></select>
-<div id='divParcel' class='divParcel'>
-Flur: <input type='input' class='inputParcel1' id='inputParcel1' disabled></select>
-Flstz: <input type='input' class='inputParcel2' id='inputParcel2' disabled></select>
-<input type='button' id='inputParcelButton' value='?' onclick='executeFunctions(parcelSubFunctions);'>
-</div>
-<div id='divOwner' class='divOwner'>
-Eigent&uuml;mer: <input type='input' class='inputOwner' id='inputOwner' disabled></select>
-<input type='button' id='inputOwnerButton' value='?' onclick='executeFunctions(ownerSubFunctions);'>
-</div>
-</form>
-<div class='divResults' id='divResults'></div>
-</body>
+<?php
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET;?>">
+<title>Gazetteer</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+
+var targetFrameArray = [];
+<?php
+echo "var e_id = '". $e_id . "';";
+for ($i = 0; $i < count($e_target); $i++) {
+	echo "targetFrameArray.push('".$e_target[$i]."');";
+}
+?>
+<!--
+// --- begin: expected element vars ---
+// var scale 
+// var numberOfResults
+// var profile = "adresse" | "alk" | "alb" | "adresse2"
+
+if (typeof(scale) == 'undefined') {
+	var scale = 2000;
+	var e = new parent.Mb_warning("mod_gazetteerSQL: element var scale is missing.");
+}
+if (typeof(numberOfResults) == 'undefined') {
+	var numberOfResults = 0;
+	var e = new parent.Mb_warning("mod_gazetteerSQL: element var numberOfResults is missing.");
+}
+if (typeof(tooManyResultsString) == 'undefined') {
+	var tooManyResultsString = "Too many results. Please specify your query.";
+	var e = new parent.Mb_warning("mod_gazetteerSQL: element var tooManyResultsString is missing.");
+}
+if (typeof(profile) == 'undefined' || (profile != "alb" && profile != "alk" && profile != "adresse" && profile != "adresse2")) {
+	profile = "adresse"
+	var e = new parent.Mb_exception("mod_gazetteerSQL: element var profile is missing.");
+}
+
+// --- end: expected element vars ---
+
+
+var generalPreFunctions = [];
+var generalSubFunctions = [];
+var onloadSubFunctions = [];
+var communesSubFunctions = [];
+var streetSubFunctions = [];
+var numberSubFunctions = [];
+var districtSubFunctions = [];
+var parcelSubFunctions = [];
+var ownerSubFunctions = [];
+
+registerFunction(generalPreFunctions, "disableForm();");
+registerFunction(generalSubFunctions, "enableForm();");
+if (profile == "alb") {
+	registerFunction(onloadSubFunctions, "updateCommunes();");
+	registerFunction(communesSubFunctions, "updateOwner();");
+	registerFunction(ownerSubFunctions, "updateOwner();");
+}
+else if (profile == "alk") {
+	registerFunction(onloadSubFunctions, "updateCommunes();");
+	registerFunction(communesSubFunctions, "updateDistricts();");
+	registerFunction(parcelSubFunctions, "updateParcels();");
+}
+else if (profile == "adresse") {
+	registerFunction(onloadSubFunctions, "updateCommunes();");
+	registerFunction(communesSubFunctions, "updateStreets();");
+	registerFunction(streetSubFunctions, "updateNumbers();");
+}
+else if (profile == "adresse2") {
+	registerFunction(onloadSubFunctions, "updateStreets();");
+	registerFunction(streetSubFunctions, "updateNumbers();");
+}
+
+function executeFunctions(arrayOfFunctionStrings) {
+	for (var i = 0; i < arrayOfFunctionStrings.length; i++) {
+		eval(arrayOfFunctionStrings[i]);
+	}
+}
+
+function registerFunction(functionStringArray, functionString) {
+	functionStringArray.push(functionString);
+}
+
+function disableForm() {
+	document.getElementById('selectCommune').disabled = true;
+	document.getElementById('selectStreet').disabled = true;
+	document.getElementById('selectDistrict').disabled = true;
+	document.getElementById('inputParcel1').disabled = true;
+	document.getElementById('inputParcel2').disabled = true;
+	document.getElementById('inputParcelButton').disabled = true;
+	document.getElementById('inputOwner').disabled = true;
+	document.getElementById('inputOwnerButton').disabled = true;
+	document.getElementById("divResults").innerHTML = searchImage;
+}
+
+function enableForm() {
+	document.getElementById('selectCommune').removeAttribute("disabled");
+	document.getElementById('selectStreet').removeAttribute("disabled");
+	document.getElementById('selectDistrict').removeAttribute("disabled");
+	document.getElementById('inputParcel1').removeAttribute("disabled");
+	document.getElementById('inputParcel2').removeAttribute("disabled");
+	document.getElementById('inputParcelButton').removeAttribute("disabled");
+	document.getElementById('inputOwner').removeAttribute("disabled");
+	document.getElementById('inputOwnerButton').removeAttribute("disabled");
+	document.getElementById("divResults").innerHTML = "";
+}
+
+var highlight;
+var houseLocation;
+var parcelLocation;
+var searchImage = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
+var phpUrl = "../php/mod_gazetteerSQL_server.php";
+
+parent.mb_registerInitFunctions("window.frames['"+e_id+"'].initHighlight()");
+parent.mb_registerInitFunctions("window.frames['"+e_id+"'].executeFunctions(window.frames['"+e_id+"'].onloadSubFunctions)");
+
+
+// - BEGIN -------- HIGHLIGHTING AND ZOOMING ------------------------------------------
+
+function zoomToLocation(aPoint) {
+	parent.mb_repaintScale(targetFrameArray[0], aPoint.x, aPoint.y, scale)
+}
+
+function initHighlight() {
+	var generalHighlightZIndex = 100;
+	var generalHighlightLineWidth = 3;
+	var styleObj = {"position":"absolute", "top":"0px", "left":"0px", "z-index":generalHighlightZIndex};
+	highlight = new parent.Highlight(targetFrameArray, e_id, styleObj, generalHighlightLineWidth);
+}
+
+function zoomToHouseNumber(houseNumber) {
+	zoomToLocation(houseLocation[houseNumber]);
+	removeHighlight();
+	highlightHouseNumber(houseNumber);
+}
+
+function zoomToParcel(parcelId) {
+	zoomToLocation(parcelLocation[parcelId]);
+	removeHighlight();
+	highlightParcel(parcelId);
+}
+
+function highlightHouseNumber(houseNumber) {
+	var mG = new parent.MultiGeometry(parent.geomType.point);
+	mG.addGeometry();
+	mG.get(-1).addPoint(houseLocation[houseNumber]);
+	highlight.add(mG);
+	highlight.paint();
+}
+
+function highlightParcel(parcelId) {
+	var mG = new parent.MultiGeometry(parent.geomType.point);
+	mG.addGeometry();
+	mG.get(-1).addPoint(parcelLocation[parcelId]);
+	highlight.add(mG);
+	highlight.paint();
+}
+
+function removeHighlight() {
+	highlight.clean();
+}
+
+// - END -------- HIGHLIGHTING AND ZOOMING ------------------------------------------
+
+
+
+function removeChildNodes(node) {
+	while (node.childNodes.length > 0) {
+		var childNode = node.firstChild;
+		node.removeChild(childNode);
+	}
+}
+
+function getSize(result) {
+	if (typeof(result) == "array") {
+		return result.length;
+	}
+	else if (typeof(result) == "object") {
+		var c = 0;
+		for (var attr in result) {
+			c++;
+		}
+		return c;
+	}
+	return 1;
+}
+
+function updateCommunes() {
+	executeFunctions(generalPreFunctions);
+	parent.mb_ajax_json(phpUrl, {"command":"getCommunes"}, function (json, status) {
+		executeFunctions(generalSubFunctions);
+
+		removeChildNodes(document.getElementById('selectCommune'));
+
+		for (var communeId in json.communes) {
+			if (typeof(json.communes[communeId]) != 'function') {
+				var currentNode = document.createElement("option");
+			
+				if (document.getElementById('selectCommune').childNodes.length == 0) {
+					currentNode.selected = "selected";
+				}
+				currentNode.value = communeId;
+				currentNode.innerHTML = json.communes[communeId];
+				document.getElementById('selectCommune').appendChild(currentNode);
+			}
+		}
+		executeFunctions(communesSubFunctions);
+	});
+}
+
+function updateStreets() {
+	executeFunctions(generalPreFunctions);
+	var communeId = document.getElementById('selectCommune').value;
+	
+	parent.mb_ajax_json(phpUrl, {"command":"getStreets", "communeId":communeId}, function (json, status) {
+		executeFunctions(generalSubFunctions);
+
+		removeChildNodes(document.getElementById('selectStreet'));
+
+		for (var streetId in json.streets) {
+			if (typeof(json.streets[streetId]) != 'function') {
+				var currentNode = document.createElement("option");
+	
+				if (document.getElementById('selectStreet').childNodes.length == 0) {
+					currentNode.selected = "selected";
+				}
+				
+				currentNode.value = json.streets[streetId];
+				currentNode.innerHTML = json.streets[streetId];
+				document.getElementById('selectStreet').appendChild(currentNode);
+			}
+		}
+		executeFunctions(streetSubFunctions);
+	});
+}
+
+function updateDistricts() {
+	executeFunctions(generalPreFunctions);
+
+	var communeId = document.getElementById('selectCommune').value;
+	
+	parent.mb_ajax_json(phpUrl, {"command":"getDistricts", "communeId":communeId}, function (districtObject, status) {
+		executeFunctions(generalSubFunctions);
+
+		removeChildNodes(document.getElementById('selectDistrict'));
+
+		for (var districtId in districtObject.districts) {
+			if (typeof(districtObject.districts[districtId]) != 'function') {
+				var currentNode = document.createElement("option");
+	
+				currentNode.value = districtId;
+	
+				if (document.getElementById('selectDistrict').childNodes.length == 0) {
+					currentNode.selected = "selected";
+				}
+				
+				currentNode.value = districtObject.districts[districtId];
+				currentNode.innerHTML = districtObject.districts[districtId];
+				document.getElementById('selectDistrict').appendChild(currentNode);
+			}
+		}
+		executeFunctions(districtSubFunctions);
+	});
+}
+
+function updateNumbers() {
+	executeFunctions(generalPreFunctions);
+
+	var streetName = document.getElementById('selectStreet').value;
+	var communeId = document.getElementById('selectCommune').value;
+
+	parent.mb_ajax_json(phpUrl, {"command":"getNumbers", "communeId":communeId, "streetName":streetName, "numberOfResults":numberOfResults}, function (json, status) {
+		executeFunctions(generalSubFunctions);
+		houseLocation = {};
+		var resultString = "";
+		if (getSize(json.houseNumbers) > 0) {
+			if (json.limited === true) {
+				resultString += tooManyResultsString;
+			}
+			for (var houseNumber in json.houseNumbers) {
+				if (typeof(json.houseNumbers[houseNumber]) != 'function') {
+					houseLocation[houseNumber] = new parent.Point(json.houseNumbers[houseNumber].x, json.houseNumbers[houseNumber].y);
+					resultString += "<b style=\"cursor:pointer\" onclick=\"zoomToHouseNumber('"+houseNumber+"')\" onmouseover=\"highlightHouseNumber('"+houseNumber+"')\" onmouseout=\"removeHighlight()\">"+houseNumber+"</b>&nbsp;&nbsp; ";
+				}
+			}
+		}
+		else {
+			resultString += noResultsString;
+		}
+		document.getElementById("divResults").innerHTML = resultString;
+		executeFunctions(numberSubFunctions);
+	});
+}
+
+function updateParcels() {
+	executeFunctions(generalPreFunctions);
+	
+	var districtId = document.getElementById('selectDistrict').value;
+	var inputParcel1 = document.getElementById('inputParcel1').value;
+	var inputParcel2 = document.getElementById('inputParcel2').value;
+
+
+	parent.mb_ajax_json(phpUrl, {"command":"getLandparcelsByDistrict", "districtId":districtId, "parcelNumber1":inputParcel1, "parcelNumber2":inputParcel2, "numberOfResults":numberOfResults}, function (json, status) {
+		executeFunctions(generalSubFunctions);
+
+		parcelLocation = {};
+		var resultString = "";
+		if (getSize(json.landparcels) > 0) {
+			if (json.limited === true) {
+				resultString += tooManyResultsString;
+			}
+			resultString += "<ol>";
+			for (var parcelId in json.landparcels) {
+				if (typeof(json.landparcels[parcelId]) != 'function') {
+					parcelLocation[parcelId] = new parent.Point(json.landparcels[parcelId].x, json.landparcels[parcelId].y);
+					resultString += "<li style=\"cursor:pointer\" onclick=\"zoomToParcel('"+parcelId+"')\" onmouseover=\"highlightParcel('"+parcelId+"')\" onmouseout=\"removeHighlight()\">"+parcelId+"</li>";
+				}
+			}
+			resultString += "</ol>";
+		}
+		else {
+			resultString += noResultsString;
+		}
+		document.getElementById("divResults").innerHTML = resultString;
+		executeFunctions(numberSubFunctions);
+	});
+}
+
+function updateOwner() {
+	var ownerQueryString = document.getElementById('inputOwner').value;
+	var communeId = document.getElementById('selectCommune').value;
+
+	document.getElementById("divResults").innerHTML = "";
+	document.getElementById('selectCommune').removeAttribute("disabled");
+	document.getElementById('inputOwner').removeAttribute("disabled");
+	document.getElementById('inputOwnerButton').removeAttribute("disabled");
+	
+	if (ownerQueryString != "") {
+		executeFunctions(generalPreFunctions);
+		parent.mb_ajax_json(phpUrl, {"command":"getLandparcelsByOwner", "communeId":communeId, "ownerQueryString":ownerQueryString, "numberOfResults":numberOfResults}, function (json, status) {
+			executeFunctions(generalSubFunctions);
+
+			parcelLocation = {};
+			var resultString = "";
+			if (getSize(json.landparcels) > 0) {
+				if (json.limited === true) {
+					resultString += tooManyResultsString;
+				}
+				resultString += "<ol>";
+				for (var i=0; i < json.landparcels.length; i++) {
+					var parcelId = json.landparcels[i].landparcelId;
+					parcelLocation[parcelId] = new parent.Point(json.landparcels[i].x, json.landparcels[i].y);
+					resultString += "<li style=\"cursor:pointer\" onclick=\"zoomToParcel('"+parcelId+"')\" onmouseover=\"highlightParcel('"+parcelId+"')\" onmouseout=\"removeHighlight()\">"+json.landparcels[i].owner+ " (" + parcelId+")</li>";
+				}
+				resultString += "</ol>";
+			}
+			else {
+				resultString += noResultsString;
+			}
+			document.getElementById("divResults").innerHTML = resultString;
+			executeFunctions(numberSubFunctions);
+	
+		});
+	}
+}
+// -->
+</script>
+</head>
+<body>
+<form>
+<select class='selectCommune' id='selectCommune' onchange='executeFunctions(communesSubFunctions)'></select>
+<select class='selectStreet' id='selectStreet' onchange='executeFunctions(streetSubFunctions);' size=5 disabled></select>
+<select class='selectDistrict' id='selectDistrict' onchange='executeFunctions(districtSubFunctions);' size=5 disabled></select>
+<div id='divParcel' class='divParcel'>
+Flur: <input type='input' class='inputParcel1' id='inputParcel1' disabled></select>
+Flstz: <input type='input' class='inputParcel2' id='inputParcel2' disabled></select>
+<input type='button' id='inputParcelButton' value='?' onclick='executeFunctions(parcelSubFunctions);'>
+</div>
+<div id='divOwner' class='divOwner'>
+Eigent&uuml;mer: <input type='input' class='inputOwner' id='inputOwner' disabled></select>
+<input type='button' id='inputOwnerButton' value='?' onclick='executeFunctions(ownerSubFunctions);'>
+</div>
+</form>
+<div class='divResults' id='divResults'></div>
+</body>
 </html>
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_home.php
===================================================================
--- branches/print_dev/http/javascripts/mod_home.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_home.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,39 +1,39 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_home
-# 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.
-?>
-function mod_home_init(){
-<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-echo "var url = '".LOGIN."';";
-echo "var name = '".urlencode($_SESSION["mb_user_name"])."';";
-echo "var pw = '".$_SESSION["mb_user_password"]."';";
-
-?>	
-	var str = "<form name='myGuiList_form' method='POST' action='' target='_self'>";
-	str += "<input type='hidden' name='name' value='"+name+"' />";
-	str += "<input type='hidden' name='password' value='"+pw+"' />";
-	str += "</form>";
-	
-	var mod_home_div = document.createElement('div');
-	mod_home_div.setAttribute("id","mod_home_d");
-	var tmp = document.body.appendChild(mod_home_div);
-	document.getElementById("mod_home_d").innerHTML = str;
-	document.forms.myGuiList_form.action = url;
-	document.forms.myGuiList_form.submit();
-	//document.location.href = url + "?name=" + name + "&password=" + pw;	
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_home
+# 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.
+?>
+function mod_home_init(){
+<?php
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+echo "var url = '".LOGIN."';";
+echo "var name = '".urlencode($_SESSION["mb_user_name"])."';";
+echo "var pw = '".$_SESSION["mb_user_password"]."';";
+
+?>	
+	var str = "<form name='myGuiList_form' method='POST' action='' target='_self'>";
+	str += "<input type='hidden' name='name' value='"+name+"' />";
+	str += "<input type='hidden' name='password' value='"+pw+"' />";
+	str += "</form>";
+	
+	var mod_home_div = document.createElement('div');
+	mod_home_div.setAttribute("id","mod_home_d");
+	var tmp = document.body.appendChild(mod_home_div);
+	document.getElementById("mod_home_d").innerHTML = str;
+	document.forms.myGuiList_form.action = url;
+	document.forms.myGuiList_form.submit();
+	//document.location.href = url + "?name=" + name + "&password=" + pw;	
 }
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_initWmc.php
===================================================================
--- branches/print_dev/http/javascripts/mod_initWmc.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_initWmc.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,116 +1,116 @@
-<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__) . "/../classes/class_wmc.php");
-require_once(dirname(__FILE__) . "/../classes/class_kml.php");
-require_once(dirname(__FILE__) . "/../classes/class_administration.php");
-
-if ($_SESSION['mb_myWmc'] && $_SESSION['mb_myWmc_action'] && 
-	in_array($_SESSION['mb_myWmc_action'], 
-	array("load", "merge", "append"))) {
-	
-	$action = $_SESSION['mb_myWmc_action'];
-	$wmc_id = $_SESSION['mb_myWmc'];
-}
-$user = $_SESSION['mb_user_id'];
-$meetingPointId = $_SESSION['mb_myKml'];
-
-$x = false;
-$y = false;
-$icon = false;
-$alt = false;
-$url = false;
-
-$adm = new administration();
-
-//KML
-if (isset($meetingPointId)) {
-	$sql = "SELECT * FROM mb_meetingpoint WHERE mb_meetingpoint_id = $1";
-	$v = array($meetingPointId);
-	$t = array('s');
-	$res = db_prep_query($sql,$v,$t);
-	if($row = db_fetch_array($res)){
-		$user = $row['fkey_mb_user_id'];
-		$password = $row['mb_user_password'];
-		$gui = $row['fkey_gui_id'];
-		$wmc_id = $row['fkey_wmc_id'];
-		$kml_doc = $row['kml'];
-		
-		$kml = new kml("", "", 0, 0, "");
-		$value = $kml->createObjFromKML($kml_doc);
-		
-		$x = $kml->x;
-		$y = $kml->y;
-		$icon = $kml->icon;
-		if ($kml->title) {
-			if ($kml->description) $alt = $kml->title . ", " .$kml->description;
-			else $alt = $kml->title;
-		}
-		else $alt = $kml->description;
-
-		if (mb_ereg("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", $kml->title)) {
-			$url = mb_ereg_replace("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", "\\1", $kml->title);
-			if (mb_substr($url, 0, 4) == "www.") {
-				$url = "http://" . $url;
-			}
-		}
-	}
-	else {
-		$js_error .= "alert('Meetingpoint ID id ".$meetingPointId." is not valid. Default GUI will be loaded instead.');"; 
-	}
-}
-	
-//WMC
-if (isset($wmc_id)) {
-	$myInitWmc = new wmc();
-	$success = $myInitWmc->createFromDb($wmc_id);
-	if ($success) {
-
-		$js_wmc = implode("", $myInitWmc->toJavaScript());
-		new mb_exception("WMC JS: " . $js_wmc);
-		
-		if (!empty($x) && !empty($y) && !empty($icon)) {
-			
-			$js_kml .= "var myPoint = realToMap('".$e_target[0]."', new Point(".$x.",".$y."));\n";
-
-			// 7 is half the width of pin.png
-			$js_kml .= "myPoint.x -= 7;";
-			// 20 is the height of pin.png
-			$js_kml .= "myPoint.y -= 20;";
-
-			$js_kml .= "var meetingPointLogoStyle = {'position':'absolute', 'top':0, 'left':0, 'z-index':100, 'font-size':'10px'};\n"; 
-			$js_kml .= "meetingPointLogoTag = new DivTag('meeting_logo', '".$e_target[0]."', meetingPointLogoStyle);\n";
-			$js_img .= "<img id='meeting_img' border='0' src='".$icon."' title='".$alt."'>";
-			if ($url) {
-				$js_img = "<a href='".$url."' target='_blank'>" . $js_img . "</a>";
-			}
-			$js_kml .= "var meetingPointLogoText = \"" . $js_img . "\";\n";
-			$js_kml .= "meetingPointLogoTag.write(meetingPointLogoText);\n";
-			$js_kml .= "var meeting_img = window.frames['".$e_target[0]."'].document.getElementById('meeting_img');";
-			$js_kml .= "meeting_img.style.position = 'absolute';";
-			$js_kml .= "meeting_img.style.top = myPoint.y;";
-			$js_kml .= "meeting_img.style.left = myPoint.x;";
-			$js_kml .= "mb_registerPanSubElement('meeting_logo');";
-		}
-	}
-	else {
-		$js_error .= "alert('WMC id ".$wmc_id." is not valid. Default GUI will be loaded instead.');"; 
-	}
-}
-echo "function mod_initWMC_init() {";
-echo $js_wmc;
-echo $js_kml;
-echo $js_error;
-echo "}";
-
-echo "function addFlag() {";
-echo $js_kml;
-echo "}";
-
-
-?>
-
-mb_registerInitFunctions("mod_initWMC()");
-function mod_initWMC(){
-	mod_initWMC_init();
-	mb_registerSubFunctions('addFlag()');
-} 
+<?php
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__) . "/../classes/class_wmc.php");
+require_once(dirname(__FILE__) . "/../classes/class_kml.php");
+require_once(dirname(__FILE__) . "/../classes/class_administration.php");
+
+if ($_SESSION['mb_myWmc'] && $_SESSION['mb_myWmc_action'] && 
+	in_array($_SESSION['mb_myWmc_action'], 
+	array("load", "merge", "append"))) {
+	
+	$action = $_SESSION['mb_myWmc_action'];
+	$wmc_id = $_SESSION['mb_myWmc'];
+}
+$user = $_SESSION['mb_user_id'];
+$meetingPointId = $_SESSION['mb_myKml'];
+
+$x = false;
+$y = false;
+$icon = false;
+$alt = false;
+$url = false;
+
+$adm = new administration();
+
+//KML
+if (isset($meetingPointId)) {
+	$sql = "SELECT * FROM mb_meetingpoint WHERE mb_meetingpoint_id = $1";
+	$v = array($meetingPointId);
+	$t = array('s');
+	$res = db_prep_query($sql,$v,$t);
+	if($row = db_fetch_array($res)){
+		$user = $row['fkey_mb_user_id'];
+		$password = $row['mb_user_password'];
+		$gui = $row['fkey_gui_id'];
+		$wmc_id = $row['fkey_wmc_id'];
+		$kml_doc = $row['kml'];
+		
+		$kml = new kml("", "", 0, 0, "");
+		$value = $kml->createObjFromKML($kml_doc);
+		
+		$x = $kml->x;
+		$y = $kml->y;
+		$icon = $kml->icon;
+		if ($kml->title) {
+			if ($kml->description) $alt = $kml->title . ", " .$kml->description;
+			else $alt = $kml->title;
+		}
+		else $alt = $kml->description;
+
+		if (mb_ereg("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", $kml->title)) {
+			$url = mb_ereg_replace("^.*,[[:space:]]((([[:alpha:]]+://)|(www.))[^<>[:space:]]+[[:alnum:]/]).*$", "\\1", $kml->title);
+			if (mb_substr($url, 0, 4) == "www.") {
+				$url = "http://" . $url;
+			}
+		}
+	}
+	else {
+		$js_error .= "alert('Meetingpoint ID id ".$meetingPointId." is not valid. Default GUI will be loaded instead.');"; 
+	}
+}
+	
+//WMC
+if (isset($wmc_id)) {
+	$myInitWmc = new wmc();
+	$success = $myInitWmc->createFromDb($wmc_id);
+	if ($success) {
+
+		$js_wmc = implode("", $myInitWmc->toJavaScript());
+		new mb_exception("WMC JS: " . $js_wmc);
+		
+		if (!empty($x) && !empty($y) && !empty($icon)) {
+			
+			$js_kml .= "var myPoint = realToMap('".$e_target[0]."', new Point(".$x.",".$y."));\n";
+
+			// 7 is half the width of pin.png
+			$js_kml .= "myPoint.x -= 7;";
+			// 20 is the height of pin.png
+			$js_kml .= "myPoint.y -= 20;";
+
+			$js_kml .= "var meetingPointLogoStyle = {'position':'absolute', 'top':0, 'left':0, 'z-index':100, 'font-size':'10px'};\n"; 
+			$js_kml .= "meetingPointLogoTag = new DivTag('meeting_logo', '".$e_target[0]."', meetingPointLogoStyle);\n";
+			$js_img .= "<img id='meeting_img' border='0' src='".$icon."' title='".$alt."'>";
+			if ($url) {
+				$js_img = "<a href='".$url."' target='_blank'>" . $js_img . "</a>";
+			}
+			$js_kml .= "var meetingPointLogoText = \"" . $js_img . "\";\n";
+			$js_kml .= "meetingPointLogoTag.write(meetingPointLogoText);\n";
+			$js_kml .= "var meeting_img = window.frames['".$e_target[0]."'].document.getElementById('meeting_img');";
+			$js_kml .= "meeting_img.style.position = 'absolute';";
+			$js_kml .= "meeting_img.style.top = myPoint.y;";
+			$js_kml .= "meeting_img.style.left = myPoint.x;";
+			$js_kml .= "mb_registerPanSubElement('meeting_logo');";
+		}
+	}
+	else {
+		$js_error .= "alert('WMC id ".$wmc_id." is not valid. Default GUI will be loaded instead.');"; 
+	}
+}
+echo "function mod_initWMC_init() {";
+echo $js_wmc;
+echo $js_kml;
+echo $js_error;
+echo "}";
+
+echo "function addFlag() {";
+echo $js_kml;
+echo "}";
+
+
+?>
+
+mb_registerInitFunctions("mod_initWMC()");
+function mod_initWMC(){
+	mod_initWMC_init();
+	mb_registerSubFunctions('addFlag()');
+} 

Modified: branches/print_dev/http/javascripts/mod_insertKmlIntoDb.php
===================================================================
--- branches/print_dev/http/javascripts/mod_insertKmlIntoDb.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_insertKmlIntoDb.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,98 +1,98 @@
-<?php
-#$Id$
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein 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.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-include(dirname(__FILE__) . "/../classes/class_kml.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<!-- 
-Licensing: See the GNU General Public License for more details.
-http://www.gnu.org/copyleft/gpl.html
-or:
-mapbender/licence/ 
--->
-
-<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>MB2 - <?php  echo  $gui_id;?></title>
-</head>
-<body>
-<?php
-if ($_POST["data"]) {
-	
-	$d = explode("____", $_POST["data"]);	
-	$wmc_id = $d[0];
-	$x = $d[1];
-	$y = $d[2];
-	$icon = $d[3];
-	$gui_id = $d[4];
-	$title_array = array();
-	if ($_POST['name']) $title_array[count($title_array)] = $_POST['name']; 
-	if ($_POST['street']) $title_array[count($title_array)] = $_POST['street'];
-	if ($_POST['postcode']) {
-		if ($_POST['city']) {
-			$title_array[count($title_array)] = $_POST['postcode'] . " " . $_POST['city'];
-		}
-		else {
-			$title_array[count($title_array)] = $_POST['postcode'];
-		}
-	}
-	elseif ($_POST['city']) {
-		$title_array[count($title_array)] = $_POST['city'];
-	}
-	if ($_POST['website']) $title_array[count($title_array)] = $_POST['website'];
-
-	$title = implode(", ", $title_array);	
-	$description = $_POST['description']; 
-	
-	$kml = new kml($title, $description, $x, $y, $icon);
-	$kml->createKMLFromObj();
-	
-	$sql = "INSERT INTO mb_meetingpoint VALUES ($1, $2, $3, $4, $5, $6)";
-	$v = array($kml->kml_id, $wmc_id, preg_replace("/&/", "&#38;" , html_entity_decode($kml->kml)), $_SESSION["mb_user_id"], $_SESSION["mb_user_password"], $gui_id);
-	$t = array('s', 's', 's', 'i', 's', 's');
-	$res = db_prep_query($sql, $v, $t);
-	
-	if (db_error()) {
-		echo "<script>var title = \"" . $title . "\";alert(\"Error while saving KML document \" + title + \"! ".db_error()."\");</script>";
-	}
-	else {
-		if ($alert) {
-			 echo "<script>var title = \"" . $title . "\";alert(\"KML document \" + title + \"has been saved!\")</script>";
-		}
-	}
-	$filename = "../tmp/".$kml->kml_id.'.kml';
-	$handle = fopen($filename, "w");
-	fputs($handle, preg_replace("/&/", "&#38;" , html_entity_decode($kml->kml)));
-	fclose($handle);
-	
-	echo "Please feel free to add the <a href = 'http://".$_SERVER['HTTP_HOST']."/mburl/".$kml->kml_id."'>link</a> to your meeting point to your website.<br><br>";
-	echo "<a href='".$filename."'>kml</a>";
-}
-?>
-
-</body>
-</html>
+<?php
+#$Id$
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein 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.
+
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+include(dirname(__FILE__) . "/../classes/class_kml.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<!-- 
+Licensing: See the GNU General Public License for more details.
+http://www.gnu.org/copyleft/gpl.html
+or:
+mapbender/licence/ 
+-->
+
+<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>MB2 - <?php  echo  $gui_id;?></title>
+</head>
+<body>
+<?php
+if ($_POST["data"]) {
+	
+	$d = explode("____", $_POST["data"]);	
+	$wmc_id = $d[0];
+	$x = $d[1];
+	$y = $d[2];
+	$icon = $d[3];
+	$gui_id = $d[4];
+	$title_array = array();
+	if ($_POST['name']) $title_array[count($title_array)] = $_POST['name']; 
+	if ($_POST['street']) $title_array[count($title_array)] = $_POST['street'];
+	if ($_POST['postcode']) {
+		if ($_POST['city']) {
+			$title_array[count($title_array)] = $_POST['postcode'] . " " . $_POST['city'];
+		}
+		else {
+			$title_array[count($title_array)] = $_POST['postcode'];
+		}
+	}
+	elseif ($_POST['city']) {
+		$title_array[count($title_array)] = $_POST['city'];
+	}
+	if ($_POST['website']) $title_array[count($title_array)] = $_POST['website'];
+
+	$title = implode(", ", $title_array);	
+	$description = $_POST['description']; 
+	
+	$kml = new kml($title, $description, $x, $y, $icon);
+	$kml->createKMLFromObj();
+	
+	$sql = "INSERT INTO mb_meetingpoint VALUES ($1, $2, $3, $4, $5, $6)";
+	$v = array($kml->kml_id, $wmc_id, preg_replace("/&/", "&#38;" , html_entity_decode($kml->kml)), $_SESSION["mb_user_id"], $_SESSION["mb_user_password"], $gui_id);
+	$t = array('s', 's', 's', 'i', 's', 's');
+	$res = db_prep_query($sql, $v, $t);
+	
+	if (db_error()) {
+		echo "<script>var title = \"" . $title . "\";alert(\"Error while saving KML document \" + title + \"! ".db_error()."\");</script>";
+	}
+	else {
+		if ($alert) {
+			 echo "<script>var title = \"" . $title . "\";alert(\"KML document \" + title + \"has been saved!\")</script>";
+		}
+	}
+	$filename = "../tmp/".$kml->kml_id.'.kml';
+	$handle = fopen($filename, "w");
+	fputs($handle, preg_replace("/&/", "&#38;" , html_entity_decode($kml->kml)));
+	fclose($handle);
+	
+	echo "Please feel free to add the <a href = 'http://".$_SERVER['HTTP_HOST']."/mburl/".$kml->kml_id."'>link</a> to your meeting point to your website.<br><br>";
+	echo "<a href='".$filename."'>kml</a>";
+}
+?>
+
+</body>
+</html>

Modified: branches/print_dev/http/javascripts/mod_insertLayerPreviewIntoDb.php
===================================================================
--- branches/print_dev/http/javascripts/mod_insertLayerPreviewIntoDb.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_insertLayerPreviewIntoDb.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,163 +1,163 @@
-<?php
-#$Id$
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein 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.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-#include(dirname(__FILE__)."/../../conf/geoportal.conf");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-require_once(dirname(__FILE__)."/../classes/class_connector.php");
-
-function savePreview($fileName, $fileContent) {
-	if (strlen($fileContent) > 0) {
-		$fileMapImg = fopen("..".LAYER_PREVIEW_URL."/".$fileName, 'w+');
-		if ($fileMapImg) {
-			rewind($fileMapImg);
-			$bytesWritten = fwrite($fileMapImg, $fileContent);
-			if ($bytesWritten) {
-				fflush($fileMapImg);
-				ftruncate($fileMapImg, ftell($fileMapImg));
-				fclose($fileMapImg);
-				return true;
-			}
-			$e = new mb_exception("..".LAYER_PREVIEW_URL."/".$fileName.": 0 bytes written.");
-			return false;
-		}
-		$e = new mb_exception("..".LAYER_PREVIEW_URL."/".$fileName.": could not open.");
-		return false;
-	}
-	$e = new mb_exception($fileName.": no file content.");
-	return false;
-}
-
-if ($_POST["data"]) {
-	$d = explode("____", $_POST["data"]);	
-
-	$mapurl = $d[0];
-	$legendurl = $d[1];
-	
-	$mapurl = eregi_replace("(&width=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_WIDTH."\\2", $mapurl);
-	$mapurl = eregi_replace("(&height=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_HEIGHT."\\2", $mapurl);
-		
-	$adm = new administration();
-	$layer_id = $_SESSION['layer_preview'];
-	if (!$layer_id) {
-		 echo "<script>alert('Could not find wms: ".$wms_getmap."');</script>";
-	}
-	else {
-		session_write_close();
-		$con1 = new connector($mapurl);
-		$fileNameMap = $layer_id."_layer_map_preview.png";
-		$fileContentMap = $con1->file;
-		$success = savePreview($fileNameMap, $fileContentMap);
-		if (!$success) $fileNameMap = "";
-		
-		$con2 = new	connector($legendurl);
-		$fileNameLegend = $layer_id."_layer_legend_preview.png";
-		$fileContentLegend = $con2->file;
-		$success = savePreview($fileNameLegend, $fileContentLegend);
-		if (!$success) $fileNameLegend = "";
- 		
-//		$rlp_4326_box = array(6.10988942079081,48.987785376052,8.58790010810365,50.9273496139233);
-		$rlp_4326_box = array(6.05,48.9,8.6,50.96);
-		
-		$sql = "SELECT * FROM layer_epsg WHERE fkey_layer_id = $1 AND epsg = 'EPSG:4326'";
-		$v = array($layer_id);
-		$t = array('i');
-		$res = db_prep_query($sql, $v, $t);
-		$row = db_fetch_array($res);
-		if ($row['minx'] && $row['miny'] && $row['maxx'] && $row['maxy']) {
-			$extent_layer_id = $layer_id;
-			$layer_4326_box = array($row['minx'], $row['miny'], $row['maxx'], $row['maxy']);
-		}
-		else {
-			$sql = "SELECT * FROM (SELECT fkey_wms_id FROM layer WHERE layer_id = $1 LIMIT 1) AS w, layer_epsg AS e, layer AS l WHERE l.fkey_wms_id = w.fkey_wms_id AND l.layer_pos = 0 AND l.layer_id = e.fkey_layer_id AND e.epsg = 'EPSG:4326'";
-			$v = array($layer_id);
-			$t = array('i');
-			$res = db_prep_query($sql, $v, $t);
-			$row = db_fetch_array($res);
-			if ($row['epsg'] && $row['minx'] && $row['miny'] && $row['maxx'] && $row['maxy']) {
-				$layer_4326_box = array($row['minx'], $row['miny'], $row['maxx'], $row['maxy']);
-				$extent_layer_id = $row['layer_id'];
-			}
-			else {
-				$layer_4326_box = $rlp_4326_box;
-				$extent_layer_id = $layer_id;
-			}
-		}
-
-		if ($layer_4326_box[0] <= $rlp_4326_box[0] || $layer_4326_box[2] >= $rlp_4326_box[2] || $layer_4326_box[1] <= $rlp_4326_box[1] || $layer_4326_box[3] >= $rlp_4326_box[3]) {
-			if ($layer_4326_box[0] < $rlp_4326_box[0]) {
-				$rlp_4326_box[0] = $layer_4326_box[0]; 
-			}
-			if ($layer_4326_box[2] > $rlp_4326_box[2]) {
-				$rlp_4326_box[2] = $layer_4326_box[2]; 
-			}
-			if ($layer_4326_box[1] < $rlp_4326_box[1]) {
-				$rlp_4326_box[1] = $layer_4326_box[1]; 
-			}
-			if ($layer_4326_box[3] > $rlp_4326_box[3]) {
-				$rlp_4326_box[3] = $layer_4326_box[3]; 
-			}
-
-			$d_x = $rlp_4326_box[2] - $rlp_4326_box[0]; 
-			$d_y = $rlp_4326_box[3] - $rlp_4326_box[1];
-			
-			$new_minx = $rlp_4326_box[0] - 0.05*($d_x);
-			$new_maxx = $rlp_4326_box[2] + 0.05*($d_x);
-			$new_miny = $rlp_4326_box[1] - 0.05*($d_y);
-			$new_maxy = $rlp_4326_box[3] + 0.05*($d_y);
-
-			if ($new_minx < -180) $rlp_4326_box[0] = -180; else $rlp_4326_box[0] = $new_minx;
-			if ($new_maxx > 180) $rlp_4326_box[2] = 180; else $rlp_4326_box[2] = $new_maxx;
-			if ($new_miny < -90) $rlp_4326_box[1] = -90; else $rlp_4326_box[1] = $new_miny;
-			if ($new_maxy > 90) $rlp_4326_box[3] = 90; else $rlp_4326_box[3] = $new_maxy;
-		}
-		$con3 = new connector(LAYER_EXTENT_URL."VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=rlp,ows_layer&STYLES=&SRS=EPSG:4326&BBOX=".$rlp_4326_box[0].",".$rlp_4326_box[1].",".$rlp_4326_box[2].",".$rlp_4326_box[3]."&WIDTH=120&HEIGHT=120&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&layer_id=".$extent_layer_id);
-		$fileNameExtent = $layer_id."_layer_extent_preview.png";
-		$fileContentExtent = $con3->file;
-		$success = savePreview($fileNameExtent, $fileContentExtent);
-		if (!$success) $fileNameExtent = "";
-
-		$sql = "SELECT * FROM layer_preview WHERE fkey_layer_id = $1";
-		$v = array($layer_id);
-		$t = array('i');
-		$res = db_prep_query($sql, $v, $t);
-		$row = db_fetch_array($res);
-		if ($row['fkey_layer_id'] == $layer_id) {
-			$sql = "UPDATE layer_preview SET layer_map_preview_filename = $1, layer_extent_preview_filename = $2, layer_legend_preview_filename = $3 WHERE fkey_layer_id = $4";
-			$v = array($fileNameMap, $fileNameExtent, $fileNameLegend, $layer_id);
-			$t = array('s', 's', 's', 'i');
-		}
-		else {
-			$sql = "INSERT INTO layer_preview (fkey_layer_id, layer_map_preview_filename, layer_extent_preview_filename, layer_legend_preview_filename) VALUES ($1, $2, $3, $4)";
-			$v = array($layer_id, $fileNameMap, $fileNameExtent, $fileNameLegend);
-			$t = array('i', 's', 's', 's');
-		}
-			
-		$res = db_prep_query($sql, $v, $t);
-		if (db_error()) {
-			 echo "<script>alert(\"Error while saving layer preview: ".addslashes(db_error())."\");</script>";
-		}
-		else {
-			 echo "<script>try{parent.opener.document.getElementById('".$layer_id."_dp').style.display='';}catch(e){};alert(\"Layer preview has been saved!\")</script>";
-		}
-	}
-}
-?>
-</body>
-<html>
+<?php
+#$Id$
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein 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.
+
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+#include(dirname(__FILE__)."/../../conf/geoportal.conf");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_connector.php");
+
+function savePreview($fileName, $fileContent) {
+	if (strlen($fileContent) > 0) {
+		$fileMapImg = fopen("..".LAYER_PREVIEW_URL."/".$fileName, 'w+');
+		if ($fileMapImg) {
+			rewind($fileMapImg);
+			$bytesWritten = fwrite($fileMapImg, $fileContent);
+			if ($bytesWritten) {
+				fflush($fileMapImg);
+				ftruncate($fileMapImg, ftell($fileMapImg));
+				fclose($fileMapImg);
+				return true;
+			}
+			$e = new mb_exception("..".LAYER_PREVIEW_URL."/".$fileName.": 0 bytes written.");
+			return false;
+		}
+		$e = new mb_exception("..".LAYER_PREVIEW_URL."/".$fileName.": could not open.");
+		return false;
+	}
+	$e = new mb_exception($fileName.": no file content.");
+	return false;
+}
+
+if ($_POST["data"]) {
+	$d = explode("____", $_POST["data"]);	
+
+	$mapurl = $d[0];
+	$legendurl = $d[1];
+	
+	$mapurl = eregi_replace("(&width=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_WIDTH."\\2", $mapurl);
+	$mapurl = eregi_replace("(&height=)[0-9]+($|[^0-9])", "\\1".LAYER_PREVIEW_HEIGHT."\\2", $mapurl);
+		
+	$adm = new administration();
+	$layer_id = $_SESSION['layer_preview'];
+	if (!$layer_id) {
+		 echo "<script>alert('Could not find wms: ".$wms_getmap."');</script>";
+	}
+	else {
+		session_write_close();
+		$con1 = new connector($mapurl);
+		$fileNameMap = $layer_id."_layer_map_preview.png";
+		$fileContentMap = $con1->file;
+		$success = savePreview($fileNameMap, $fileContentMap);
+		if (!$success) $fileNameMap = "";
+		
+		$con2 = new	connector($legendurl);
+		$fileNameLegend = $layer_id."_layer_legend_preview.png";
+		$fileContentLegend = $con2->file;
+		$success = savePreview($fileNameLegend, $fileContentLegend);
+		if (!$success) $fileNameLegend = "";
+ 		
+//		$rlp_4326_box = array(6.10988942079081,48.987785376052,8.58790010810365,50.9273496139233);
+		$rlp_4326_box = array(6.05,48.9,8.6,50.96);
+		
+		$sql = "SELECT * FROM layer_epsg WHERE fkey_layer_id = $1 AND epsg = 'EPSG:4326'";
+		$v = array($layer_id);
+		$t = array('i');
+		$res = db_prep_query($sql, $v, $t);
+		$row = db_fetch_array($res);
+		if ($row['minx'] && $row['miny'] && $row['maxx'] && $row['maxy']) {
+			$extent_layer_id = $layer_id;
+			$layer_4326_box = array($row['minx'], $row['miny'], $row['maxx'], $row['maxy']);
+		}
+		else {
+			$sql = "SELECT * FROM (SELECT fkey_wms_id FROM layer WHERE layer_id = $1 LIMIT 1) AS w, layer_epsg AS e, layer AS l WHERE l.fkey_wms_id = w.fkey_wms_id AND l.layer_pos = 0 AND l.layer_id = e.fkey_layer_id AND e.epsg = 'EPSG:4326'";
+			$v = array($layer_id);
+			$t = array('i');
+			$res = db_prep_query($sql, $v, $t);
+			$row = db_fetch_array($res);
+			if ($row['epsg'] && $row['minx'] && $row['miny'] && $row['maxx'] && $row['maxy']) {
+				$layer_4326_box = array($row['minx'], $row['miny'], $row['maxx'], $row['maxy']);
+				$extent_layer_id = $row['layer_id'];
+			}
+			else {
+				$layer_4326_box = $rlp_4326_box;
+				$extent_layer_id = $layer_id;
+			}
+		}
+
+		if ($layer_4326_box[0] <= $rlp_4326_box[0] || $layer_4326_box[2] >= $rlp_4326_box[2] || $layer_4326_box[1] <= $rlp_4326_box[1] || $layer_4326_box[3] >= $rlp_4326_box[3]) {
+			if ($layer_4326_box[0] < $rlp_4326_box[0]) {
+				$rlp_4326_box[0] = $layer_4326_box[0]; 
+			}
+			if ($layer_4326_box[2] > $rlp_4326_box[2]) {
+				$rlp_4326_box[2] = $layer_4326_box[2]; 
+			}
+			if ($layer_4326_box[1] < $rlp_4326_box[1]) {
+				$rlp_4326_box[1] = $layer_4326_box[1]; 
+			}
+			if ($layer_4326_box[3] > $rlp_4326_box[3]) {
+				$rlp_4326_box[3] = $layer_4326_box[3]; 
+			}
+
+			$d_x = $rlp_4326_box[2] - $rlp_4326_box[0]; 
+			$d_y = $rlp_4326_box[3] - $rlp_4326_box[1];
+			
+			$new_minx = $rlp_4326_box[0] - 0.05*($d_x);
+			$new_maxx = $rlp_4326_box[2] + 0.05*($d_x);
+			$new_miny = $rlp_4326_box[1] - 0.05*($d_y);
+			$new_maxy = $rlp_4326_box[3] + 0.05*($d_y);
+
+			if ($new_minx < -180) $rlp_4326_box[0] = -180; else $rlp_4326_box[0] = $new_minx;
+			if ($new_maxx > 180) $rlp_4326_box[2] = 180; else $rlp_4326_box[2] = $new_maxx;
+			if ($new_miny < -90) $rlp_4326_box[1] = -90; else $rlp_4326_box[1] = $new_miny;
+			if ($new_maxy > 90) $rlp_4326_box[3] = 90; else $rlp_4326_box[3] = $new_maxy;
+		}
+		$con3 = new connector(LAYER_EXTENT_URL."VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=rlp,ows_layer&STYLES=&SRS=EPSG:4326&BBOX=".$rlp_4326_box[0].",".$rlp_4326_box[1].",".$rlp_4326_box[2].",".$rlp_4326_box[3]."&WIDTH=120&HEIGHT=120&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&layer_id=".$extent_layer_id);
+		$fileNameExtent = $layer_id."_layer_extent_preview.png";
+		$fileContentExtent = $con3->file;
+		$success = savePreview($fileNameExtent, $fileContentExtent);
+		if (!$success) $fileNameExtent = "";
+
+		$sql = "SELECT * FROM layer_preview WHERE fkey_layer_id = $1";
+		$v = array($layer_id);
+		$t = array('i');
+		$res = db_prep_query($sql, $v, $t);
+		$row = db_fetch_array($res);
+		if ($row['fkey_layer_id'] == $layer_id) {
+			$sql = "UPDATE layer_preview SET layer_map_preview_filename = $1, layer_extent_preview_filename = $2, layer_legend_preview_filename = $3 WHERE fkey_layer_id = $4";
+			$v = array($fileNameMap, $fileNameExtent, $fileNameLegend, $layer_id);
+			$t = array('s', 's', 's', 'i');
+		}
+		else {
+			$sql = "INSERT INTO layer_preview (fkey_layer_id, layer_map_preview_filename, layer_extent_preview_filename, layer_legend_preview_filename) VALUES ($1, $2, $3, $4)";
+			$v = array($layer_id, $fileNameMap, $fileNameExtent, $fileNameLegend);
+			$t = array('i', 's', 's', 's');
+		}
+			
+		$res = db_prep_query($sql, $v, $t);
+		if (db_error()) {
+			 echo "<script>alert(\"Error while saving layer preview: ".addslashes(db_error())."\");</script>";
+		}
+		else {
+			 echo "<script>try{parent.opener.document.getElementById('".$layer_id."_dp').style.display='';}catch(e){};alert(\"Layer preview has been saved!\")</script>";
+		}
+	}
+}
+?>
+</body>
+<html>

Modified: branches/print_dev/http/javascripts/mod_loadwmc.js
===================================================================
--- branches/print_dev/http/javascripts/mod_loadwmc.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_loadwmc.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -102,7 +102,7 @@
 						try {
 							if (resultObj.javascript && typeof(resultObj.javascript) == "object") {
 								for (var j=0; j < resultObj.javascript.length; j++) {
-//									console.log("Statement: %s", resultObj.javascript[j]);
+//									var e = new Mb_notice("Statement: %s", resultObj.javascript[j]);
 									eval(resultObj.javascript[j]);
 								}
 							}	

Modified: branches/print_dev/http/javascripts/mod_loadwmc.php
===================================================================
--- branches/print_dev/http/javascripts/mod_loadwmc.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_loadwmc.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -29,15 +29,15 @@
 		$e = new mb_notice("wmc not set, generating from app: " . $_SESSION["mb_user_gui"]);
 		$wmc->createFromApplication($_SESSION["mb_user_gui"]);		
 		$_SESSION["mb_wmc"] = $wmc->toXml();
-//		$e = new mb_exception("initial WMC: " . $_SESSION["mb_wmc"]);
+		$e = new mb_notice("creating initial WMC.");
 	}
 
 	if (isset($_SESSION['mb_wmc'])) {
-		$e = new mb_exception("merging with WMC.");
 
 		if ($wmc->createFromXml($_SESSION['mb_wmc'])) {
 	
 			if ($mergeWms) {
+				$e = new mb_notice("merging with WMS.");
 				$wmsArray = array();
 				for ($i = 0; $i < count($_SESSION["wms"]); $i++) {
 					$currentWms = new wms();
@@ -59,7 +59,6 @@
 		}
 	}
 	else {
-		$e = new mb_notice("not merging WMC");
 		$jsString .= "var e = new Mb_warning('mod_loadwmc: load_wmc_session: no wmc set!');";
 	}
 	return $jsString;
@@ -75,12 +74,16 @@
 <?php
 if ($_SESSION["command"] && $_SESSION["command"] == "ADDWMS") {
 	$e = new mb_notice("merging with WMS in Session...");
-	echo createJs(true);
+	$output = createJs(true);
 }
 else {
 	$e = new mb_notice("NOT merging with WMS in Session...");
-	echo createJs(false);
+	$output = createJs(false);
 }
+
+$output = administration::convertOutgoingString($output);
+echo $output;
+
 ?>
 }
 

Modified: branches/print_dev/http/javascripts/mod_perimeter.php
===================================================================
--- branches/print_dev/http/javascripts/mod_perimeter.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_perimeter.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,173 +1,173 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_perimeter.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(dirname(__FILE__)."/../php/mb_validateSession.php");
-include(dirname(__FILE__).'/../include/dyn_js.php');
-?>
-
-var mod_perimeter_target = "<?php echo $e_target[0]; ?>";
-mb_registerInitFunctions("mod_perimeter_prepare()");
-mb_registerSubFunctions("mod_perimeter_draw()");
-mb_registerPanSubElement("perimeter");
-var mod_perimeter_img_on = new Image(); mod_perimeter_img_on.src =  "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
-var mod_perimeter_img_off = new Image(); mod_perimeter_img_off.src ="<?php  echo $e_src;  ?>";
-var mod_perimeter_img_over = new Image(); mod_perimeter_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
-var mod_perimeter_prevEvent = null;
-var mod_perimeter_x = null;
-var mod_perimeter_y = null;
-var mod_perimeter_r = null;
-var mod_perimeter_canvas = null;
-var mod_perimeter_status = 0;
-var mod_perimeter_img_obj = null;
-
-function mb_checkTag(frameName, tagName, elementId, appendAtTagName, attributes){
-	var oldElement;
-	var newElement;
-	var prefix;
-	if(frameName && frameName !== ""){
-		prefix = window.frames[frameName].document;
-	}
-	else if(!frameName || frameName === ""){
-		prefix = document;
-	}
-	oldElement = prefix.getElementById(elementId);
-	if (oldElement === null) {
-		newElement = prefix.createElement(tagName);
-		newElement = prefix.getElementsByTagName(appendAtTagName)[0].appendChild(newElement);
-	}
-	else {
-		if (oldElement.nodeName.toLowerCase() == tagName.toLowerCase()) {
-			for (var i=0; i<attributes.length; i++) {
-				oldElement.setAttribute(attributes[i][0], attributes[i][1]);
-			}
-			return oldElement;
-		}
-		else {
-			return false;
-		}
-	}
-	var newElementAttributeNode = document.createAttribute("id");
-	newElementAttributeNode.value = elementId;
-	newElement.setAttributeNode(newElementAttributeNode);
-	for (var i=0; i<attributes.length; i++) {
-		newElement.setAttribute(attributes[i][0], attributes[i][1]);
-	}
-	return newElement;
-}
-function mod_perimeter_checkDefaults(){
-	try{var t = mod_perimeter_thickness;}catch(e){mod_perimeter_thickness = 2;}
-	try{var t = mod_perimeter_color;}catch(e){mod_perimeter_color = '#000000';}
-	try{var t = mod_perimeter_text;}catch(e){mod_perimeter_text = 'Please insert a radius: ';}
-	try{var t = mod_perimeter_error;}catch(e){mod_perimeter_error = 'Invalid Input.';}
-}
-function mod_perimeter_click(o){
-	mod_perimeter_img_obj = o;
-	mod_perimeter_status = (mod_perimeter_status == 0) ? 1 : 0;
-	o.src = (mod_perimeter_status == 0) ? mod_perimeter_img_off.src : mod_perimeter_img_on.src;
-	if(mod_perimeter_status == 1){
-		mod_perimeter_saveEvents();
-	}
-	else{
-		mod_perimeter_disable();	
-	}
-}
-function mod_perimeter_saveEvents(){
-	var myE = window.frames[mod_perimeter_target].document;
-	mod_perimeter_mouseclick = myE.onclick;
-	mod_perimeter_mouseover = myE.onmouseover;
-	mod_perimeter_mousedown = myE.onmousedown;
-	mod_perimeter_mouseup = myE.onmouseup;
-	mod_perimeter_mousemove = myE.onmousemove;
-	myE.onclick = mod_perimeter_event;
-	myE.onmouseover = null;
-	myE.onmousedown = null;
-	myE.onmouseup = null;
-	myE.onmousemove = null;	
-}
-function mod_perimeter_restoreEvents(){
-	var myE = window.frames[mod_perimeter_target].document;
-	myE.onclick = mod_perimeter_mouseclick;
-	myE.onmouseover = mod_perimeter_mouseover;
-	myE.onmousedown = mod_perimeter_mousedown;
-	myE.onmouseup = mod_perimeter_mouseup;
-	myE.onmousemove = mod_perimeter_mousemove;
-}
-function mod_perimeter_over(o){
-	o.src = mod_perimeter_img_over.src;
-}
-function mod_perimeter_out(o){
-	o.src = (mod_perimeter_status == 0) ? mod_perimeter_img_off.src : mod_perimeter_img_on.src;
-}
-function mod_perimeter_disable(){
-	window.frames[mod_perimeter_target].document.getElementById("perimeter").innerHTML = '';
-}
-function mod_perimeter_event(e){
-	if(ie){
-		clickX = window.frames[mod_perimeter_target].event.clientX;
-		clickY = window.frames[mod_perimeter_target].event.clientY;
-	}
-	else{
-		clickX = e.pageX;
-		clickY = e.pageY;
-	}
-	var pos = makeClickPos2RealWorldPos(mod_perimeter_target, clickX, clickY)
-	mod_perimeter_x = pos[0];
-	mod_perimeter_y = pos[1];
-	var units = prompt(mod_perimeter_text);
-	var myUnits = mod_perimeter_validate(units);
-	if(myUnits != false){
-		mod_perimeter_r = myUnits;
-		mod_perimeter_draw();
-	}
-	else{
-		mod_perimeter_click(mod_perimeter_img_obj);	
-	}
-	mod_perimeter_restoreEvents();
-}
-function mod_perimeter_validate(u){
-	if(isNaN(u) == true){
-  		alert(mod_perimeter_error);
-  		return false;
- 	}
- 	else{
-		return parseInt(u);
- 	}
-}
-function mod_perimeter_prepare(){
-	cw_opacity=1;
-	mod_perimeter_checkDefaults();	
-	var attributes = new Array();
-	attributes[0] = new Array();
-	attributes[0][0] = "style";
-	attributes[0][1] = "position:absolute; top:0px; left:0px; z-index:100; font-size:10px;"; 
-	var node = mb_checkTag(mod_perimeter_target, "div", "perimeter", "body", attributes);
-	mod_perimeter_canvas = new jsGraphics("perimeter", window.frames[mod_perimeter_target]);
-	mod_perimeter_canvas.setStroke(mod_perimeter_thickness);
-	mod_perimeter_canvas.setColor(mod_perimeter_color);
-}
-function mod_perimeter_draw(){
-	if(mod_perimeter_status == 1){
-		mod_perimeter_disable();
-		var posCenter = makeRealWorld2mapPos(mod_perimeter_target,mod_perimeter_x, mod_perimeter_y);
-		var posRadius = makeRealWorld2mapPos(mod_perimeter_target,(mod_perimeter_x + mod_perimeter_r), mod_perimeter_y);
-		var pxRadius =  posRadius[0] - posCenter[0];
-		mod_perimeter_canvas.drawEllipse((posCenter[0]-pxRadius), (posCenter[1]-pxRadius), pxRadius*2, pxRadius*2);
-		mod_perimeter_canvas.paint();
-	}
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_perimeter.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(dirname(__FILE__)."/../php/mb_validateSession.php");
+include(dirname(__FILE__).'/../include/dyn_js.php');
+?>
+
+var mod_perimeter_target = "<?php echo $e_target[0]; ?>";
+mb_registerInitFunctions("mod_perimeter_prepare()");
+mb_registerSubFunctions("mod_perimeter_draw()");
+mb_registerPanSubElement("perimeter");
+var mod_perimeter_img_on = new Image(); mod_perimeter_img_on.src =  "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
+var mod_perimeter_img_off = new Image(); mod_perimeter_img_off.src ="<?php  echo $e_src;  ?>";
+var mod_perimeter_img_over = new Image(); mod_perimeter_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
+var mod_perimeter_prevEvent = null;
+var mod_perimeter_x = null;
+var mod_perimeter_y = null;
+var mod_perimeter_r = null;
+var mod_perimeter_canvas = null;
+var mod_perimeter_status = 0;
+var mod_perimeter_img_obj = null;
+
+function mb_checkTag(frameName, tagName, elementId, appendAtTagName, attributes){
+	var oldElement;
+	var newElement;
+	var prefix;
+	if(frameName && frameName !== ""){
+		prefix = window.frames[frameName].document;
+	}
+	else if(!frameName || frameName === ""){
+		prefix = document;
+	}
+	oldElement = prefix.getElementById(elementId);
+	if (oldElement === null) {
+		newElement = prefix.createElement(tagName);
+		newElement = prefix.getElementsByTagName(appendAtTagName)[0].appendChild(newElement);
+	}
+	else {
+		if (oldElement.nodeName.toLowerCase() == tagName.toLowerCase()) {
+			for (var i=0; i<attributes.length; i++) {
+				oldElement.setAttribute(attributes[i][0], attributes[i][1]);
+			}
+			return oldElement;
+		}
+		else {
+			return false;
+		}
+	}
+	var newElementAttributeNode = document.createAttribute("id");
+	newElementAttributeNode.value = elementId;
+	newElement.setAttributeNode(newElementAttributeNode);
+	for (var i=0; i<attributes.length; i++) {
+		newElement.setAttribute(attributes[i][0], attributes[i][1]);
+	}
+	return newElement;
+}
+function mod_perimeter_checkDefaults(){
+	try{var t = mod_perimeter_thickness;}catch(e){mod_perimeter_thickness = 2;}
+	try{var t = mod_perimeter_color;}catch(e){mod_perimeter_color = '#000000';}
+	try{var t = mod_perimeter_text;}catch(e){mod_perimeter_text = 'Please insert a radius: ';}
+	try{var t = mod_perimeter_error;}catch(e){mod_perimeter_error = 'Invalid Input.';}
+}
+function mod_perimeter_click(o){
+	mod_perimeter_img_obj = o;
+	mod_perimeter_status = (mod_perimeter_status == 0) ? 1 : 0;
+	o.src = (mod_perimeter_status == 0) ? mod_perimeter_img_off.src : mod_perimeter_img_on.src;
+	if(mod_perimeter_status == 1){
+		mod_perimeter_saveEvents();
+	}
+	else{
+		mod_perimeter_disable();	
+	}
+}
+function mod_perimeter_saveEvents(){
+	var myE = window.frames[mod_perimeter_target].document;
+	mod_perimeter_mouseclick = myE.onclick;
+	mod_perimeter_mouseover = myE.onmouseover;
+	mod_perimeter_mousedown = myE.onmousedown;
+	mod_perimeter_mouseup = myE.onmouseup;
+	mod_perimeter_mousemove = myE.onmousemove;
+	myE.onclick = mod_perimeter_event;
+	myE.onmouseover = null;
+	myE.onmousedown = null;
+	myE.onmouseup = null;
+	myE.onmousemove = null;	
+}
+function mod_perimeter_restoreEvents(){
+	var myE = window.frames[mod_perimeter_target].document;
+	myE.onclick = mod_perimeter_mouseclick;
+	myE.onmouseover = mod_perimeter_mouseover;
+	myE.onmousedown = mod_perimeter_mousedown;
+	myE.onmouseup = mod_perimeter_mouseup;
+	myE.onmousemove = mod_perimeter_mousemove;
+}
+function mod_perimeter_over(o){
+	o.src = mod_perimeter_img_over.src;
+}
+function mod_perimeter_out(o){
+	o.src = (mod_perimeter_status == 0) ? mod_perimeter_img_off.src : mod_perimeter_img_on.src;
+}
+function mod_perimeter_disable(){
+	window.frames[mod_perimeter_target].document.getElementById("perimeter").innerHTML = '';
+}
+function mod_perimeter_event(e){
+	if(ie){
+		clickX = window.frames[mod_perimeter_target].event.clientX;
+		clickY = window.frames[mod_perimeter_target].event.clientY;
+	}
+	else{
+		clickX = e.pageX;
+		clickY = e.pageY;
+	}
+	var pos = makeClickPos2RealWorldPos(mod_perimeter_target, clickX, clickY)
+	mod_perimeter_x = pos[0];
+	mod_perimeter_y = pos[1];
+	var units = prompt(mod_perimeter_text);
+	var myUnits = mod_perimeter_validate(units);
+	if(myUnits != false){
+		mod_perimeter_r = myUnits;
+		mod_perimeter_draw();
+	}
+	else{
+		mod_perimeter_click(mod_perimeter_img_obj);	
+	}
+	mod_perimeter_restoreEvents();
+}
+function mod_perimeter_validate(u){
+	if(isNaN(u) == true){
+  		alert(mod_perimeter_error);
+  		return false;
+ 	}
+ 	else{
+		return parseInt(u);
+ 	}
+}
+function mod_perimeter_prepare(){
+	cw_opacity=1;
+	mod_perimeter_checkDefaults();	
+	var attributes = new Array();
+	attributes[0] = new Array();
+	attributes[0][0] = "style";
+	attributes[0][1] = "position:absolute; top:0px; left:0px; z-index:100; font-size:10px;"; 
+	var node = mb_checkTag(mod_perimeter_target, "div", "perimeter", "body", attributes);
+	mod_perimeter_canvas = new jsGraphics("perimeter", window.frames[mod_perimeter_target]);
+	mod_perimeter_canvas.setStroke(mod_perimeter_thickness);
+	mod_perimeter_canvas.setColor(mod_perimeter_color);
+}
+function mod_perimeter_draw(){
+	if(mod_perimeter_status == 1){
+		mod_perimeter_disable();
+		var posCenter = makeRealWorld2mapPos(mod_perimeter_target,mod_perimeter_x, mod_perimeter_y);
+		var posRadius = makeRealWorld2mapPos(mod_perimeter_target,(mod_perimeter_x + mod_perimeter_r), mod_perimeter_y);
+		var pxRadius =  posRadius[0] - posCenter[0];
+		mod_perimeter_canvas.drawEllipse((posCenter[0]-pxRadius), (posCenter[1]-pxRadius), pxRadius*2, pxRadius*2);
+		mod_perimeter_canvas.paint();
+	}
 }
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_poi.php
===================================================================
--- branches/print_dev/http/javascripts/mod_poi.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_poi.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,316 +1,316 @@
-<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta name="author-mail" content="info at ccgis.de">
-<meta name="author" content="U. Rothstein">
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="DC.Rights" content="CCGIS GbR, Bonn">
-<title>Suche</title>
-<?
-	include_once(dirname(__FILE__) . "/../include/dyn_css.php");
-?>
-<style type="text/css">
-<!--
-	body{
-		font-family : Arial, Helvetica, sans-serif;
-		font-size : 12px;
-		font-weight : bold;
-		color: #808080;
-		background-color: 'ffffff';
-	}
-	.header{
-		color: #cc3366;
-	}
-	a:link{
-		font-family : Arial, Helvetica, sans-serif;
-		text-decoration : none;
-		color: #808080;
-		font-size : 12px;
-		font-weight : bold;
-	}
-	a:visited{
-		font-family : Arial, Helvetica, sans-serif;
-		text-decoration : none;
-		color: #808080;
-		font-size : 12px;
-		font-weight : bold;
-	}
-	a:hover{
-		font-family : Arial, Helvetica, sans-serif;
-		color: white;
-		text-decoration : none;
-		font-weight : bold;
-		background-color : #999999;
-	}
-	a:active{
-		font-family : Arial, Helvetica, sans-serif;
-		color: blue;
-		text-decoration : none;
-		font-weight : bold;
-	}
-	.textfield{
-		border : 2 solid #D3D3D3;
-		font-family : Arial, Helvetica, sans-serif;
-		font-size : 12px;
-		font-weight : bold;
-		color: #808080;
-		width: 100px;
-		position: absolute;
-		left: 50px
-	}
-	.sbutton{
-	font-size : 10px;
-		width: 28px;
-		height: 22px;
-		position: absolute;
-		left: 152px;
-	}
-	.resultFrame{
-		width: 180px;
-		height: 140px;
-		border: 1px;
-		position: absolute;
-		top: 25px;
-		left: 5px;
-		overflow-x : hidden;
-	}
--->
-</style>
-<?php
-#if(isset($lingo)){$lingo = $_REQUEST["lingo"];}
-#else{$lingo = "deutsch";}
-#$language = parse_ini_file("../language/".$lingo.".txt");
-
-echo "<script type='text/javascript'>";  
-echo "var conffile = '".$_REQUEST["conf_file"]."';";
-echo "var lingo = '".$_REQUEST["lingo"]."';";
-echo "var backlink = '".$_REQUEST["backlink"]."';";
-
-$lingo = $_REQUEST["lingo"];
-$title = "layername_".$lingo;
-require_once(dirname(__FILE__) . "/../../conf/".$_REQUEST["conf_file"]);
-
-echo "</script>"; 
-?>
-<script type="text/javascript">
-<!--
-
-function validate(){
-
-   if(document.form1.search.value.length < 1){
-      alert("Bitte vervollst�ndigen Sie die Angaben!");
-      document.form1.search.focus();
-      return false;
-   }
-   else{   
-      text = "mod_poi.php?&search=" + document.form1.search.value+"&conf_file="+conffile+"&lingo="+lingo+"&backlink="+backlink;
-      if (backlink=='parent'){
-      	window.frames["result"].location.href = text;
-      }else{
-      	parent.result.window.location.href = text;
-      }
-      return false;
-   }
-}
-function statistic(value){
-	if (backlink =='parent'){
-   		parent.parent.StatisticFrame.location.href = "../statistic.php?request=" + escape(value);
-   	}
-   	else{
-   		parent.StatisticFrame.location.href = "../statistic.php?request=" + escape(value);
-    }
-   return;
-}
-
-
-function showHighlight(x,y){
-
-	if (backlink =='parent'){
-		parent.parent.mb_showHighlight("mapframe1",x,y);
-		parent.parent.mb_showHighlight("overview",x,y);
-		//alert (backlink);
-	}else{
-		parent.mb_showHighlight("mapframe1",x,y);
-		parent.mb_showHighlight("overview",x,y);
-	}
-}
-function hideHighlight(){
-	if (backlink =='parent'){
-		parent.parent.mb_hideHighlight("mapframe1");
-		parent.parent.mb_hideHighlight("overview");
-	}else{
-		parent.mb_hideHighlight("mapframe1");
-		parent.mb_hideHighlight("overview");
-	}
-}
-
-function handleLayer(sel_lay, wms_title){
-    
-	//var wms_title = document.forms[0].wmsTitle.value
-
-	var x = new Array();
-
-    x[0] = sel_lay;
-
-    var y = new Array();
-    
-    if (backlink =='parent'){
-		var wms_ID = parent.parent.getWMSIDByTitle('mapframe1',wms_title);
-	}
-	else{
-		var wms_ID = parent.getWMSIDByTitle('mapframe1',wms_title);
-	}
-
-    y[0] = wms_ID;
-    
-	//alert(wms_title + " -- X "+ x + "wms_id" + wms_ID);
-	
-	if (backlink =='parent'){
-		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
-		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);
-		parent.parent.mb_execloadWmsSubFunctions();
-	}
-	else{
-		parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
-		parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);		
-		parent.mb_execloadWmsSubFunctions();
-	}
-}
-// -->
-</script>
-</head>
-<body leftmargin="2" topmargin="0" bgcolor="#ffffff">
-<?php
-
-if(!isset($_REQUEST["search"]) || $_REQUEST["search"] == ""){
-	echo "<form name='form1' target='result' onsubmit='return validate();'>";
-	echo "Suchen: &nbsp;&nbsp;<input class='textfield' name='search' type='text'> ";
-	echo "<input class='sbutton' type='submit' name='send'  value='ok'>";
-	echo "<iframe frameborder='1' name='result' src='../html/mod_blank.html' class='resultFrame' scrolling='auto'></iframe>";
-	echo "</form>";
-}
-else{
-	if(preg_match("/\*/",$_REQUEST["search"])){
-		$search = trim(preg_replace("/\*/i","", $_REQUEST["search"]));
-	}
-
-	$con = pg_connect ($con_string) or die ("Error while connecting database $dbname");
-
-	#$sql = "SELECT DISTINCT identificationinfo,minscale, md_fileidentifier ,search_columns, search_result  FROM tab_metadata WHERE public = '1' and not identificationinfo = 'Rasterebene' and not identificationinfo = 'rasterlayer'";
-	$sql = "SELECT DISTINCT identificationinfo,minscale, md_fileidentifier ,".$title.",search_columns, search_result,search_keywords, wms_title  FROM tab_metadata WHERE public = '1' and not identificationinfo = 'Rasterebene' and not identificationinfo = 'rasterlayer'";
-	$res = pg_query($con,$sql);
-	$cnt = 0;
-
-	while(pg_fetch_row($res)){
-		$table[$cnt] = pg_result($res,$cnt,"identificationinfo"); # Tabellen, Abfragenname
-		$minscale[$cnt] = pg_result($res,$cnt,"minscale");	
-		$md_fileidentifier[$cnt] = pg_result($res,$cnt,"md_fileidentifier"); # Layername
-		$layername[$cnt] = pg_result($res,$cnt,"md_fileidentifier"); # Layername in der Mapdatei
-		$result_title[$cnt] = pg_result($res,$cnt,"\"".$title."\""); # layer_deutsch Ergebnisname
-		$search_columns[$cnt] = pg_result($res,$cnt,"search_columns"); # Suchspalten, Trennung �ber ,
-		$search_result[$cnt] = pg_result($res,$cnt,"search_result"); # Ergebnisspalte
-		$search_keywords[$cnt] = pg_result($res,$cnt,"search_keywords"); # Ergebnisspalte
-		$wms_title[$cnt] = pg_result($res,$cnt,"wms_title"); # WMS tile
-           
-		# if one of the searchkeywords is found the data of the whole table is displayed as the result
-		if($search_keywords[$cnt] != '') { 
-			$array_search_keywords = explode(",", $search_keywords[$cnt]);
-			$all[$cnt] = false;
-			for ($p=0 ; $p<count($array_search_keywords);$p++){
-				$hit = preg_match("/".$_REQUEST["search"]."/i",$array_search_keywords[$p]);
-				if ($hit >0){	
-					$all[$cnt] = true;
-				}
-			}
-		}  	
-		//echo "hit:".$hit."all: ".$all[$cnt] ;
-		$cnt++;
-	}
-	$field_has_parent = false; 
-	$has_result = false; 
-
-	for($i=0; $i<count($table); $i++){
-		$sql = "Select GeometryType(the_geom) as type FROM ".$table[$i]." LIMIT 1";
-		$res = pg_query($con,$sql);
-		$type = pg_result($res,0,"type");      
-		$sql = "Select * FROM ".$table[$i]." LIMIT 1";
-		$res = pg_query($con,$sql);
-
-		if(mb_strtoupper($type) =='MULTIPOLYGON'){
-			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].", '".$wms_title[$i]."' as wms_title, X(Centroid(the_geom)) as x,Y(Centroid(the_geom)) as y  FROM ".$table[$i];
-		}
-		if(mb_strtoupper($type) =='MULTILINESTRING'){
-			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].",'".$wms_title[$i]."' as wms_title, X(Centroid(the_geom)) as x,Y(Centroid(the_geom)) as y  FROM ".$table[$i];
-		}
-		if(mb_strtoupper($type)=='POINT'){
-			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].",'".$wms_title[$i]."' as wms_title, X(the_geom) as x,Y(the_geom) as y FROM ".$table[$i];
-		}
-      
-		#---------------- search_columns search_result 
-		if ($all[$i] == false){
-			$array_search_columns = explode(",", $search_columns[$i]);
-
-			if (count($array_search_columns)>0){ 
-				$array_search_columns[count($array_search_columns)] =  $array_search_columns [0];
-				$array_search_columns [0] = "platzhalterxy";
-
-				for($j=0; $j<pg_num_fields($res); $j++){
-					if(array_search(pg_field_name($res,$j),$array_search_columns) == true  ){
-						if($field_has_parent == true){
-							$sql1 .= " OR ";
-						}
-						else {
-							$sql1 .= " WHERE ";
-						};
-						$field_has_parent = true;
-						$sql1 .= pg_field_name($res,$j) ." ILIKE ";
-						$sql1 .= "'%".$_REQUEST["search"]."%'";
-					}
-				}
-				$field_has_parent = false;
-			};
-		}
-		else {
-		}
-		$sql1 .= " ORDER BY ".$search_result[$i];
-		$res1 = pg_query($con,$sql1);
-		$cnt = 0;
-		if(pg_fetch_row($res1)>0){
-			$sel_lay = pg_result($res1,$cnt,"fkey_md_fileidentifier"); 
-      
-			if($minscale[$i] > 0){$scale = $minscale[$i]+100; }
-
-			for ($cnt=0; $cnt < pg_num_rows($res1); $cnt++){
-				if($cnt == 0){
-					$title = "layername_".$lingo;
-					echo "<div class='header'>".$result_title[$i]. "</div>";
-				}
-				if($_REQUEST["backlink"]=='parent'){
-					echo "<nobr><a href='javascript:hideHighlight();parent.parent.mb_repaintScale(\"mapframe1\"," .pg_result($res1,$cnt,"x"). ",".pg_result($res1,$cnt,"y"). ",$scale);'";
-				}
-				else{
-					echo "<nobr><a href='javascript:hideHighlight();parent.mb_repaintScale(\"mapframe1\"," .pg_result($res1,$cnt,"x"). ",".pg_result($res1,$cnt,"y"). ",$scale);'";
-				}
-
-				echo " onmouseover='showHighlight(" .pg_result($res1,$cnt,"x"). "," .pg_result($res1,$cnt,"y"). ")' ";
-				echo "onmouseout='hideHighlight();' ";
-				echo "onclick='handleLayer(\"" .pg_result($res1,$cnt,"fkey_md_fileidentifier"). "\",\"".pg_result($res1,$cnt,"wms_title")."\")'>";
-
-				echo pg_result($res1,$cnt,$search_result[$i])."</a></nobr><br>";
-				$has_result = true;
-			}
-		}
-	}
-	if($has_result == false){echo "Kein Ergebnis!";}
-	echo "<form action='" . $PHP_SELF . "?".SID."' method='post'>";
-	echo "</form>";
-}
-?>
-</body>
+<?php
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="author-mail" content="info at ccgis.de">
+<meta name="author" content="U. Rothstein">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta name="DC.Rights" content="CCGIS GbR, Bonn">
+<title>Suche</title>
+<?
+	include_once(dirname(__FILE__) . "/../include/dyn_css.php");
+?>
+<style type="text/css">
+<!--
+	body{
+		font-family : Arial, Helvetica, sans-serif;
+		font-size : 12px;
+		font-weight : bold;
+		color: #808080;
+		background-color: 'ffffff';
+	}
+	.header{
+		color: #cc3366;
+	}
+	a:link{
+		font-family : Arial, Helvetica, sans-serif;
+		text-decoration : none;
+		color: #808080;
+		font-size : 12px;
+		font-weight : bold;
+	}
+	a:visited{
+		font-family : Arial, Helvetica, sans-serif;
+		text-decoration : none;
+		color: #808080;
+		font-size : 12px;
+		font-weight : bold;
+	}
+	a:hover{
+		font-family : Arial, Helvetica, sans-serif;
+		color: white;
+		text-decoration : none;
+		font-weight : bold;
+		background-color : #999999;
+	}
+	a:active{
+		font-family : Arial, Helvetica, sans-serif;
+		color: blue;
+		text-decoration : none;
+		font-weight : bold;
+	}
+	.textfield{
+		border : 2 solid #D3D3D3;
+		font-family : Arial, Helvetica, sans-serif;
+		font-size : 12px;
+		font-weight : bold;
+		color: #808080;
+		width: 100px;
+		position: absolute;
+		left: 50px
+	}
+	.sbutton{
+	font-size : 10px;
+		width: 28px;
+		height: 22px;
+		position: absolute;
+		left: 152px;
+	}
+	.resultFrame{
+		width: 180px;
+		height: 140px;
+		border: 1px;
+		position: absolute;
+		top: 25px;
+		left: 5px;
+		overflow-x : hidden;
+	}
+-->
+</style>
+<?php
+#if(isset($lingo)){$lingo = $_REQUEST["lingo"];}
+#else{$lingo = "deutsch";}
+#$language = parse_ini_file("../language/".$lingo.".txt");
+
+echo "<script type='text/javascript'>";  
+echo "var conffile = '".$_REQUEST["conf_file"]."';";
+echo "var lingo = '".$_REQUEST["lingo"]."';";
+echo "var backlink = '".$_REQUEST["backlink"]."';";
+
+$lingo = $_REQUEST["lingo"];
+$title = "layername_".$lingo;
+require_once(dirname(__FILE__) . "/../../conf/".$_REQUEST["conf_file"]);
+
+echo "</script>"; 
+?>
+<script type="text/javascript">
+<!--
+
+function validate(){
+
+   if(document.form1.search.value.length < 1){
+      alert("Bitte vervollst�ndigen Sie die Angaben!");
+      document.form1.search.focus();
+      return false;
+   }
+   else{   
+      text = "mod_poi.php?&search=" + document.form1.search.value+"&conf_file="+conffile+"&lingo="+lingo+"&backlink="+backlink;
+      if (backlink=='parent'){
+      	window.frames["result"].location.href = text;
+      }else{
+      	parent.result.window.location.href = text;
+      }
+      return false;
+   }
+}
+function statistic(value){
+	if (backlink =='parent'){
+   		parent.parent.StatisticFrame.location.href = "../statistic.php?request=" + escape(value);
+   	}
+   	else{
+   		parent.StatisticFrame.location.href = "../statistic.php?request=" + escape(value);
+    }
+   return;
+}
+
+
+function showHighlight(x,y){
+
+	if (backlink =='parent'){
+		parent.parent.mb_showHighlight("mapframe1",x,y);
+		parent.parent.mb_showHighlight("overview",x,y);
+		//alert (backlink);
+	}else{
+		parent.mb_showHighlight("mapframe1",x,y);
+		parent.mb_showHighlight("overview",x,y);
+	}
+}
+function hideHighlight(){
+	if (backlink =='parent'){
+		parent.parent.mb_hideHighlight("mapframe1");
+		parent.parent.mb_hideHighlight("overview");
+	}else{
+		parent.mb_hideHighlight("mapframe1");
+		parent.mb_hideHighlight("overview");
+	}
+}
+
+function handleLayer(sel_lay, wms_title){
+    
+	//var wms_title = document.forms[0].wmsTitle.value
+
+	var x = new Array();
+
+    x[0] = sel_lay;
+
+    var y = new Array();
+    
+    if (backlink =='parent'){
+		var wms_ID = parent.parent.getWMSIDByTitle('mapframe1',wms_title);
+	}
+	else{
+		var wms_ID = parent.getWMSIDByTitle('mapframe1',wms_title);
+	}
+
+    y[0] = wms_ID;
+    
+	//alert(wms_title + " -- X "+ x + "wms_id" + wms_ID);
+	
+	if (backlink =='parent'){
+		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
+		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);
+		parent.parent.mb_execloadWmsSubFunctions();
+	}
+	else{
+		parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
+		parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);		
+		parent.mb_execloadWmsSubFunctions();
+	}
+}
+// -->
+</script>
+</head>
+<body leftmargin="2" topmargin="0" bgcolor="#ffffff">
+<?php
+
+if(!isset($_REQUEST["search"]) || $_REQUEST["search"] == ""){
+	echo "<form name='form1' target='result' onsubmit='return validate();'>";
+	echo "Suchen: &nbsp;&nbsp;<input class='textfield' name='search' type='text'> ";
+	echo "<input class='sbutton' type='submit' name='send'  value='ok'>";
+	echo "<iframe frameborder='1' name='result' src='../html/mod_blank.html' class='resultFrame' scrolling='auto'></iframe>";
+	echo "</form>";
+}
+else{
+	if(preg_match("/\*/",$_REQUEST["search"])){
+		$search = trim(preg_replace("/\*/i","", $_REQUEST["search"]));
+	}
+
+	$con = pg_connect ($con_string) or die ("Error while connecting database $dbname");
+
+	#$sql = "SELECT DISTINCT identificationinfo,minscale, md_fileidentifier ,search_columns, search_result  FROM tab_metadata WHERE public = '1' and not identificationinfo = 'Rasterebene' and not identificationinfo = 'rasterlayer'";
+	$sql = "SELECT DISTINCT identificationinfo,minscale, md_fileidentifier ,".$title.",search_columns, search_result,search_keywords, wms_title  FROM tab_metadata WHERE public = '1' and not identificationinfo = 'Rasterebene' and not identificationinfo = 'rasterlayer'";
+	$res = pg_query($con,$sql);
+	$cnt = 0;
+
+	while(pg_fetch_row($res)){
+		$table[$cnt] = pg_result($res,$cnt,"identificationinfo"); # Tabellen, Abfragenname
+		$minscale[$cnt] = pg_result($res,$cnt,"minscale");	
+		$md_fileidentifier[$cnt] = pg_result($res,$cnt,"md_fileidentifier"); # Layername
+		$layername[$cnt] = pg_result($res,$cnt,"md_fileidentifier"); # Layername in der Mapdatei
+		$result_title[$cnt] = pg_result($res,$cnt,"\"".$title."\""); # layer_deutsch Ergebnisname
+		$search_columns[$cnt] = pg_result($res,$cnt,"search_columns"); # Suchspalten, Trennung �ber ,
+		$search_result[$cnt] = pg_result($res,$cnt,"search_result"); # Ergebnisspalte
+		$search_keywords[$cnt] = pg_result($res,$cnt,"search_keywords"); # Ergebnisspalte
+		$wms_title[$cnt] = pg_result($res,$cnt,"wms_title"); # WMS tile
+           
+		# if one of the searchkeywords is found the data of the whole table is displayed as the result
+		if($search_keywords[$cnt] != '') { 
+			$array_search_keywords = explode(",", $search_keywords[$cnt]);
+			$all[$cnt] = false;
+			for ($p=0 ; $p<count($array_search_keywords);$p++){
+				$hit = preg_match("/".$_REQUEST["search"]."/i",$array_search_keywords[$p]);
+				if ($hit >0){	
+					$all[$cnt] = true;
+				}
+			}
+		}  	
+		//echo "hit:".$hit."all: ".$all[$cnt] ;
+		$cnt++;
+	}
+	$field_has_parent = false; 
+	$has_result = false; 
+
+	for($i=0; $i<count($table); $i++){
+		$sql = "Select GeometryType(the_geom) as type FROM ".$table[$i]." LIMIT 1";
+		$res = pg_query($con,$sql);
+		$type = pg_result($res,0,"type");      
+		$sql = "Select * FROM ".$table[$i]." LIMIT 1";
+		$res = pg_query($con,$sql);
+
+		if(mb_strtoupper($type) =='MULTIPOLYGON'){
+			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].", '".$wms_title[$i]."' as wms_title, X(Centroid(the_geom)) as x,Y(Centroid(the_geom)) as y  FROM ".$table[$i];
+		}
+		if(mb_strtoupper($type) =='MULTILINESTRING'){
+			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].",'".$wms_title[$i]."' as wms_title, X(Centroid(the_geom)) as x,Y(Centroid(the_geom)) as y  FROM ".$table[$i];
+		}
+		if(mb_strtoupper($type)=='POINT'){
+			$sql1 = "SELECT '". $layername[$i]."' as fkey_md_fileidentifier,".$search_result[$i].",'".$wms_title[$i]."' as wms_title, X(the_geom) as x,Y(the_geom) as y FROM ".$table[$i];
+		}
+      
+		#---------------- search_columns search_result 
+		if ($all[$i] == false){
+			$array_search_columns = explode(",", $search_columns[$i]);
+
+			if (count($array_search_columns)>0){ 
+				$array_search_columns[count($array_search_columns)] =  $array_search_columns [0];
+				$array_search_columns [0] = "platzhalterxy";
+
+				for($j=0; $j<pg_num_fields($res); $j++){
+					if(array_search(pg_field_name($res,$j),$array_search_columns) == true  ){
+						if($field_has_parent == true){
+							$sql1 .= " OR ";
+						}
+						else {
+							$sql1 .= " WHERE ";
+						};
+						$field_has_parent = true;
+						$sql1 .= pg_field_name($res,$j) ." ILIKE ";
+						$sql1 .= "'%".$_REQUEST["search"]."%'";
+					}
+				}
+				$field_has_parent = false;
+			};
+		}
+		else {
+		}
+		$sql1 .= " ORDER BY ".$search_result[$i];
+		$res1 = pg_query($con,$sql1);
+		$cnt = 0;
+		if(pg_fetch_row($res1)>0){
+			$sel_lay = pg_result($res1,$cnt,"fkey_md_fileidentifier"); 
+      
+			if($minscale[$i] > 0){$scale = $minscale[$i]+100; }
+
+			for ($cnt=0; $cnt < pg_num_rows($res1); $cnt++){
+				if($cnt == 0){
+					$title = "layername_".$lingo;
+					echo "<div class='header'>".$result_title[$i]. "</div>";
+				}
+				if($_REQUEST["backlink"]=='parent'){
+					echo "<nobr><a href='javascript:hideHighlight();parent.parent.mb_repaintScale(\"mapframe1\"," .pg_result($res1,$cnt,"x"). ",".pg_result($res1,$cnt,"y"). ",$scale);'";
+				}
+				else{
+					echo "<nobr><a href='javascript:hideHighlight();parent.mb_repaintScale(\"mapframe1\"," .pg_result($res1,$cnt,"x"). ",".pg_result($res1,$cnt,"y"). ",$scale);'";
+				}
+
+				echo " onmouseover='showHighlight(" .pg_result($res1,$cnt,"x"). "," .pg_result($res1,$cnt,"y"). ")' ";
+				echo "onmouseout='hideHighlight();' ";
+				echo "onclick='handleLayer(\"" .pg_result($res1,$cnt,"fkey_md_fileidentifier"). "\",\"".pg_result($res1,$cnt,"wms_title")."\")'>";
+
+				echo pg_result($res1,$cnt,$search_result[$i])."</a></nobr><br>";
+				$has_result = true;
+			}
+		}
+	}
+	if($has_result == false){echo "Kein Ergebnis!";}
+	echo "<form action='" . $PHP_SELF . "?".SID."' method='post'>";
+	echo "</form>";
+}
+?>
+</body>
 </html>
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_reload.php
===================================================================
--- branches/print_dev/http/javascripts/mod_reload.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_reload.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,40 +1,66 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/reload
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-var mod_reload_img = new Image(); 
-mod_reload_img.src = "<?php  echo $e_src;  ?>";
-var mod_reload_img_over = new Image(); 
-mod_reload_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
-
-function mod_reload(){
-    location.reload();
-}
-function mod_reload_init(obj){
-	document.getElementById("reload").src = mod_reload_img_over.src;
-	obj.onmouseover = new Function("mod_reload_over()");
-	obj.onmouseout = new Function("mod_reload_out()");
-}
-function mod_reload_over(){
-	document.getElementById("reload").src = mod_reload_img_over.src;
-}
-function mod_reload_out(){
-	document.getElementById("reload").src = mod_reload_img.src;
-}
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/reload
+# 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.
+?>
+/**
+ * Package: Reload
+ * 
+ * Description:
+ * A button that reloads the whole window. 
+ *
+ * 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) VALUES ('<gui_id>', 'reload',
+ * > 2,1,'reload','img','../img/button_blink_red/reload_off.png', '',335,
+ * > 60,24,24,1,'','','','mod_reload.php','','mapframe1','',
+ * > 'http://www.mapbender.org/index.php/Reload');
+ *
+ * Maintainer: 
+ * http://www.mapbender.org/User:Vera_Schulze
+ */
+var Reload = function (domElement) {
+	
+	var that = this;
+	
+	domElement.src = options.src;
+	if (!options.src) {
+		new Mb_exception(options.id + " requires a src.");
+	}
+	else {
+		$(domElement).mouseover(function () {
+			domElement.src = options.src.replace(/_off/,"_over");
+		}).mouseout(function () {
+			domElement.src = options.src;
+		}).click(function () {
+		   that.reload(); 
+		});
+	};
+	
+	/**
+	 * Method: reload
+	 *
+	 * Reloads the window.
+	 */
+	this.reload = function () {
+		location.reload();
+	};
+};
+
+var reload = new Reload(this);
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_renderGML.php
===================================================================
--- branches/print_dev/http/javascripts/mod_renderGML.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_renderGML.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,50 +1,50 @@
-<?php
-# http://www.mapbender.org/index.php/Monitor_Capabilities
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_gml2.php");
-
-$gml_string = $_SESSION["GML"];
-
-if ($gml_string) {
-	$gml = new gml2();
-	$gml->parse_xml($gml_string);
-	$bbox = $gml->bbox;
-	echo "mb_registerInitFunctions('highlight_init()');\n";
-	echo "function highlight_init() {\n";
-	echo "var mf = new Array(";
-	for ($i=0; $i<count($e_target); $i++) {
-		if ($i>0) echo ", ";
-		echo "'".$e_target[$i]."'";
-	}
-	echo ");\n";
-	echo "hl = new Highlight(mf, 'GML_rendering', {'position':'absolute', 'top':'0px', 'left':'0px', 'z-index':" . GML_HIGHLIGHT_Z_INDEX . "});\n";
-	echo $gml->exportMemberToJS(0, false);
-	echo "hl.add(q);\n";
-	echo "hl.paint();\n";
-	echo "mb_registerSubFunctions('hl.paint()');\n";
-	echo "}\n";
-	$e = new mb_notice("renderGML: GML: " . $_SESSION["GML"] . "; EPSG: " . $_SESSION["epsg"] . "; BBOX: " . implode(", ", $bbox));
-	$_SESSION["GML"] = NULL;
-	$e = new mb_notice("renderGML: deleting GML...");
-	
-}
-else {
-	$e = new mb_notice("renderGML: no GML.");
-}
+<?php
+# http://www.mapbender.org/index.php/Monitor_Capabilities
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_gml2.php");
+
+$gml_string = $_SESSION["GML"];
+
+if ($gml_string) {
+	$gml = new gml2();
+	$gml->parse_xml($gml_string);
+	$bbox = $gml->bbox;
+	echo "mb_registerInitFunctions('highlight_init()');\n";
+	echo "function highlight_init() {\n";
+	echo "var mf = new Array(";
+	for ($i=0; $i<count($e_target); $i++) {
+		if ($i>0) echo ", ";
+		echo "'".$e_target[$i]."'";
+	}
+	echo ");\n";
+	echo "hl = new Highlight(mf, 'GML_rendering', {'position':'absolute', 'top':'0px', 'left':'0px', 'z-index':" . GML_HIGHLIGHT_Z_INDEX . "});\n";
+	echo $gml->exportMemberToJS(0, false);
+	echo "hl.add(q);\n";
+	echo "hl.paint();\n";
+	echo "mb_registerSubFunctions('hl.paint()');\n";
+	echo "}\n";
+	$e = new mb_notice("renderGML: GML: " . $_SESSION["GML"] . "; EPSG: " . $_SESSION["epsg"] . "; BBOX: " . implode(", ", $bbox));
+	$_SESSION["GML"] = NULL;
+	$e = new mb_notice("renderGML: deleting GML...");
+	
+}
+else {
+	$e = new mb_notice("renderGML: no GML.");
+}
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_resize_mapsize.php
===================================================================
--- branches/print_dev/http/javascripts/mod_resize_mapsize.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_resize_mapsize.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,123 +1,123 @@
-<?php
-# $Id:mod_resize_mapsize.php 1964 2008-01-15 08:11:29Z christoph $
-# http://www.mapbender.org/index.php/ResizeMapsize
-# Created on 12.07.2006/07:32:08
-# Copyright (C) 2002 CCGIS 
-# Projekt: mapbender
-# File: mod_resize_mapsize.php
-#
-# 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(dirname(__FILE__)."/../php/mb_validatePermission.php");
-include(dirname(__FILE__) . "/../include/dyn_js.php");
-
-$sqltarget = "SELECT e_target FROM gui_element WHERE e_id = 'resizeMapsize' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-$res = db_prep_query($sqltarget, $v, $t);
-while($row = db_fetch_array($res)){
-	$e_target = $row["e_target"];
-}
-
-$sql = "SELECT e_left, e_top FROM gui_element WHERE e_id = '".$e_target."' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-$res = db_prep_query($sql, $v, $t);
-while($row = db_fetch_array($res)){
-	$e_left = $row["e_left"];
-	$e_top = $row["e_top"];
-}
-
-$sqllegend = "SELECT e_width FROM gui_element WHERE e_id = 'legend' AND fkey_gui_id = $1";
-$v = array($gui_id);
-$t = array('s');
-$res = db_prep_query($sqllegend, $v, $t);
-while($row = db_fetch_array($res)){
-	$leg_e_width = $row["e_width"];
-}
-
-?>
-try{
-	if (resize_option){}
-}
-catch(e){
-	resize_option = "auto";
-}
-
-try{
-	if (adjust_width){}
-}
-catch(e){
-	adjust_width = "-45";
-}
-
-try{
-	if (adjust_height){}
-}
-catch(e){
-	adjust_height = "-35";
-}
-var map_frame = "<?php echo $e_target ?>";
-var map_frame_left = "<?php echo $e_left ?>";
-var map_frame_top = "<?php echo $e_top ?>";
-var legend_width = "<?php echo $leg_e_width ?>";
-
-function frameWidth(){
-  	if (window.innerWidth) return window.innerWidth;
-  	else if (document.body && document.body.offsetWidth)  return document.body.offsetWidth;
-  	else return 0;
-}
-
-function frameHeight(){
-  	if (window.innerHeight)return window.innerHeight;
-	else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
-    else return 0;
-}
-
-function adjustDimension(){
-	var ind = getMapObjIndexByName("<?php  echo $e_target;  ?>");
-	var mapheight = frameHeight() - <?php echo $e_top ?> + parseInt(adjust_height);
-	var mapwidth = frameWidth() - map_frame_left - legend_width + parseInt(adjust_width) ;
-	var coords = mb_mapObj[ind].extent.split(",");
-	midcoordx=parseFloat((parseFloat(coords[2])-parseFloat(coords[0]))/2)+parseFloat(coords[0]);
-	midcoordy=parseFloat((parseFloat(coords[3])-parseFloat(coords[1]))/2)+parseFloat(coords[1]);
-	mb_mapObj[ind].setWidth(mapwidth);
-	mb_mapObj[ind].setHeight(mapheight);
-	mb_mapObj[ind].repaintScale(midcoordx,midcoordy,mb_mapObj[ind].getScale());
-}
-
-function rebuild() {
-  	if (width_temp != frameWidth() || height_temp != frameHeight()) window.setTimeout('adjustDimension()', 500);
-}
-
-function control(){
-  	adjustDimension();
-	if (!window.width_temp && window.innerWidth) {
-  	    window.onresize = rebuild;
-  	    width_temp = frameWidth();
-  	    height_temp = frameHeight();
-    }
-
-    if (!window.width_temp && document.body && document.body.offsetWidth) {
-  	    window.onresize = rebuild;
-  	    width_temp = frameWidth();
-  	    height_temp = frameHeight();
-    }
-}
-if (resize_option == 'auto'){
-	eventInit.register(function() {
-		control();
-	});
-}
+<?php
+# $Id:mod_resize_mapsize.php 1964 2008-01-15 08:11:29Z christoph $
+# http://www.mapbender.org/index.php/ResizeMapsize
+# Created on 12.07.2006/07:32:08
+# Copyright (C) 2002 CCGIS 
+# Projekt: mapbender
+# File: mod_resize_mapsize.php
+#
+# 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(dirname(__FILE__)."/../php/mb_validatePermission.php");
+include(dirname(__FILE__) . "/../include/dyn_js.php");
+
+$sqltarget = "SELECT e_target FROM gui_element WHERE e_id = 'resizeMapsize' AND fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sqltarget, $v, $t);
+while($row = db_fetch_array($res)){
+	$e_target = $row["e_target"];
+}
+
+$sql = "SELECT e_left, e_top FROM gui_element WHERE e_id = '".$e_target."' AND fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sql, $v, $t);
+while($row = db_fetch_array($res)){
+	$e_left = $row["e_left"];
+	$e_top = $row["e_top"];
+}
+
+$sqllegend = "SELECT e_width FROM gui_element WHERE e_id = 'legend' AND fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sqllegend, $v, $t);
+while($row = db_fetch_array($res)){
+	$leg_e_width = $row["e_width"];
+}
+
+?>
+try{
+	if (resize_option){}
+}
+catch(e){
+	resize_option = "auto";
+}
+
+try{
+	if (adjust_width){}
+}
+catch(e){
+	adjust_width = "-45";
+}
+
+try{
+	if (adjust_height){}
+}
+catch(e){
+	adjust_height = "-35";
+}
+var map_frame = "<?php echo $e_target ?>";
+var map_frame_left = "<?php echo $e_left ?>";
+var map_frame_top = "<?php echo $e_top ?>";
+var legend_width = "<?php echo $leg_e_width ?>";
+
+function frameWidth(){
+  	if (window.innerWidth) return window.innerWidth;
+  	else if (document.body && document.body.offsetWidth)  return document.body.offsetWidth;
+  	else return 0;
+}
+
+function frameHeight(){
+  	if (window.innerHeight)return window.innerHeight;
+	else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
+    else return 0;
+}
+
+function adjustDimension(){
+	var ind = getMapObjIndexByName("<?php  echo $e_target;  ?>");
+	var mapheight = frameHeight() - <?php echo $e_top ?> + parseInt(adjust_height);
+	var mapwidth = frameWidth() - map_frame_left - legend_width + parseInt(adjust_width) ;
+	var coords = mb_mapObj[ind].extent.split(",");
+	midcoordx=parseFloat((parseFloat(coords[2])-parseFloat(coords[0]))/2)+parseFloat(coords[0]);
+	midcoordy=parseFloat((parseFloat(coords[3])-parseFloat(coords[1]))/2)+parseFloat(coords[1]);
+	mb_mapObj[ind].setWidth(mapwidth);
+	mb_mapObj[ind].setHeight(mapheight);
+	mb_mapObj[ind].repaintScale(midcoordx,midcoordy,mb_mapObj[ind].getScale());
+}
+
+function rebuild() {
+  	if (width_temp != frameWidth() || height_temp != frameHeight()) window.setTimeout('adjustDimension()', 500);
+}
+
+function control(){
+  	adjustDimension();
+	if (!window.width_temp && window.innerWidth) {
+  	    window.onresize = rebuild;
+  	    width_temp = frameWidth();
+  	    height_temp = frameHeight();
+    }
+
+    if (!window.width_temp && document.body && document.body.offsetWidth) {
+  	    window.onresize = rebuild;
+  	    width_temp = frameWidth();
+  	    height_temp = frameHeight();
+    }
+}
+if (resize_option == 'auto'){
+	eventInit.register(function() {
+		control();
+	});
+}

Modified: branches/print_dev/http/javascripts/mod_sandclock.php
===================================================================
--- branches/print_dev/http/javascripts/mod_sandclock.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_sandclock.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -16,76 +16,136 @@
 # 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-echo "var mod_sandclock_target = '".$e_target[0]."';";
-include '../include/dyn_js.php';
 ?>
-try{
-	if (mod_sandclock_image){}
-}
-catch(e){
-	mod_sandclock_image = "../img/sandclock.gif";
-}
+/**
+ * Package: Sandclock
+ *
+ * Description:
+ * Displays an arbitrary sandclock image on a map
+ *
+ * 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) VALUES ('<gui_id>', 'sandclock', '0002', 
+ * > '1', 'displays a sand clock while waiting for requests', 'div', '', 
+ * > '', '', '', '', '', '', '', '', 'div', 'mod_sandclock.php', '', 
+ * > 'mapframe1', '');
+ * > 
+ * > INSERT INTO gui_element_vars (fkey_gui_id, fkey_e_id, var_name, 
+ * > var_value, context, var_type) VALUES ('<gui_id>', 'sandclock', 
+ * > 'mod_sandclock_image', '../img/sandclock.gif', 
+ * > 'define a sandclock-image', 'var');
+ * 
+ * Maintainer:
+ * http://www.mapbender.org/User:Christoph_Baudson
+ * 
+ * Parameters:
+ * mod_sandclock_img - *[optional]* the filename and path to the sandclock image
+ */
+ 
+var Sandclock = function (options) {
+	var that = this;
 
-var mod_sandclock_img = new Image();
-mod_sandclock_img.src = mod_sandclock_image;
-
-eventAfterMapRequest.register(function (obj) {
-	mod_sandclock(true,obj.myMapId);
-});
-
-function mod_sandclock(start,myMapId){
-	var ind = getMapObjIndexByName(mod_sandclock_target);
-	if(start){
-		var temp = "<img src='"+mod_sandclock_img.src+"'>";
-
-		var map_el = mb_mapObj[ind].getDomElement();
-		if(!map_el.ownerDocument.getElementById(mb_mapObj[ind].elementName+"_sandclock")){
-			//create Box Elements
-			el_top = map_el.ownerDocument.createElement("div");
-			el_top.style.position = "absolute";
-			el_top.style.top = "0px";
-			el_top.style.left = "0px";
-			el_top.style.overflow = "hidden";
-			el_top.style.zIndex = "10";
-			el_top.style.visibility = "visible";
-			el_top.style.cursor = "crosshair";
-			el_top.id = mb_mapObj[ind].elementName+"_sandclock";
-			map_el.appendChild(el_top);
-		}
-		writeTag(mb_mapObj[ind].frameName, mb_mapObj[ind].elementName+"_sandclock", temp);
-		mb_arrangeElement("", mod_sandclock_target+"_sandclock", (mb_mapObj[ind].width/2 - 16), (mb_mapObj[ind].height/2 - 16));
+	//
+	// check if target is set correctly
+	//
+	if (!options.target) {
+		new Mb_Exception(this.id + "requires a target.");
+		return;
 	}
+	
+	if (!Mapbender.Modules[options.target]) {
+		new Mb_exception("Target " + options.target + " not found by " + this.id)
+	}
+	var map = Mapbender.Modules[options.target];
+	
+	//
+	// element vars
+	//
+	if (!options.mod_sandclock_image) {
+		options.mod_sandclock_image = "../img/sandclock.gif";
+	}
 
+	var mod_sandclock_img = new Image();
+	mod_sandclock_img.src = options.mod_sandclock_image;
+	
+	
 	//
-	// if myMapId is nopt given, the sandclock has to be turned off manually
-	// by calling mod_sandclock_off. Usually this is done in a callback 
-	// function.
+	// constructor
 	//
-	if (typeof myMapId !== "undefined") {
-		aktiv = setTimeout(function () {
-			mod_sandclock('',myMapId);
+	eventAfterMapRequest.register(function (obj) {
+		that.show(obj.myMapId);
+	});
+
+	var isInitialised = false;
+	
+	var aktiv;
+	
+	/** 
+	 * Method: show
+	 *
+	 * Displays the sandclock
+	 */
+	this.show = function (mapId) {
+		if (!isInitialised) {
+			var temp = "<img src='"+mod_sandclock_img.src+"'>";
+	
+			var map_el = map.getDomElement();
+			if(!map_el.ownerDocument.getElementById(map.elementName+"_sandclock")){
+				//create Box Elements
+				el_top = map_el.ownerDocument.createElement("div");
+				el_top.style.position = "absolute";
+				el_top.style.top = "0px";
+				el_top.style.left = "0px";
+				el_top.style.overflow = "hidden";
+				el_top.style.zIndex = "10";
+				el_top.style.visibility = "visible";
+				el_top.style.cursor = "crosshair";
+				el_top.id = map.elementName+"_sandclock";
+				map_el.appendChild(el_top);
+			}
+			writeTag(map.frameName, map.elementName+"_sandclock", temp);
+			mb_arrangeElement("", options.target+"_sandclock", (map.width/2 - 16), (map.height/2 - 16));
+			isInitialised = true;
+		}
+	
+		//
+		// if mapId is not given, the sandclock has to be turned off manually
+		// by calling hide(). Usually this is done in a callback 
+		// function.
+		//
+		if (typeof mapId !== "undefined") {
+			aktiv = setTimeout(function () {
+				that.show(mapId);
 			},10);
-		var myMapIdArray = myMapId.split(",");
-		var complete = true;
-		var myMapId;
-		for (var i = 0; i < myMapIdArray.length && complete; i++) {
-			myMapId = myMapIdArray[i];
-			var myDoc = mb_mapObj[ind].getDomElement().ownerDocument;
-			if(myDoc.getElementById(myMapId) && 
-				!myDoc.getElementById(myMapId).complete) {
-				complete = false;
+			var mapIdArray = mapId.split(",");
+			var complete = true;
+			var mapId;
+			for (var i = 0; i < mapIdArray.length && complete; i++) {
+				mapId = mapIdArray[i];
+				var myDoc = map.getDomElement().ownerDocument;
+				if(myDoc.getElementById(mapId) && 
+					!myDoc.getElementById(mapId).complete) {
+					complete = false;
+				}
 			}
+			if (complete) {
+				clearTimeout(aktiv);
+				that.hide(map);
+			} 
 		}
-		if (complete) {
-			clearTimeout(aktiv);
-			mod_sandclock_off(mb_mapObj[ind]);
-		} 
-	}
+		
+	};
+	
+	/**
+	 * Method: hide
+	 *
+	 * Hides the sandclock
+	 */
+	this.hide = function () {
+		writeTag(map.frameName, map.elementName+"_sandclock", "");
+	};
 }
 
-function mod_sandclock_off() {
-	var mapObj = getMapObjByName(mod_sandclock_target);
-	writeTag(mapObj.frameName, mapObj.elementName+"_sandclock", "");
-}
+var sandclock = new Sandclock(options);

Modified: branches/print_dev/http/javascripts/mod_saveLayerPreview.php
===================================================================
--- branches/print_dev/http/javascripts/mod_saveLayerPreview.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_saveLayerPreview.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,34 +1,34 @@
-<?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(dirname(__FILE__)."/../php/mb_validateSession.php");
-include(dirname(__FILE__) . "/../include/dyn_js.php");
-
-echo "mod_savewmc_target = '".$e_target[0]."';";
-?>
-var mod_saveLayerPreview_img = new Image(); mod_saveLayerPreview_img.src = "<?php  echo $e_src;  ?>";
-
-function mod_saveLayerPreview(){
-//	document.sendData.target = "_blank";
-	document.sendData.action = "../javascripts/mod_insertLayerPreviewIntoDb.php";
-	document.sendData.data.value = mb_mapObj[0].mapURL[0] + "____" + wms[0].wms_getlegendurl;
-	document.sendData.submit();
-}
-
-
+<?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(dirname(__FILE__)."/../php/mb_validateSession.php");
+include(dirname(__FILE__) . "/../include/dyn_js.php");
+
+echo "mod_savewmc_target = '".$e_target[0]."';";
+?>
+var mod_saveLayerPreview_img = new Image(); mod_saveLayerPreview_img.src = "<?php  echo $e_src;  ?>";
+
+function mod_saveLayerPreview(){
+//	document.sendData.target = "_blank";
+	document.sendData.action = "../javascripts/mod_insertLayerPreviewIntoDb.php";
+	document.sendData.data.value = mb_mapObj[0].mapURL[0] + "____" + wms[0].wms_getlegendurl;
+	document.sendData.submit();
+}
+
+

Modified: branches/print_dev/http/javascripts/mod_saveWmcKml.php
===================================================================
--- branches/print_dev/http/javascripts/mod_saveWmcKml.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_saveWmcKml.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,108 +1,108 @@
-<?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(dirname(__FILE__)."/../php/mb_validateSession.php");
-echo "mod_savewmc_target = '".$e_target[0]."';";
-?>
-
-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_saveWmcKml(obj){
-	current_user = "<?php echo $_SESSION["mb_user_id"]; ?>";
-	current_password = "<?php echo $_SESSION["mb_user_password"];?>";
-	current_gui = "<?php echo $gui_id;?>";
-	
-	alert('Please set the meeting point by clicking the map.');
-	
-	var ind = getMapObjIndexByName(mod_savewmc_target);
-	
-	var el = frames[mod_savewmc_target].document;
-	el.onmousedown = mod_getMousePos;
-	el.onmouseup = null;
-	el.onmousemove = null;
-	el.onmouseover = null;
-}
-
-function mod_getMousePos(e) {
-	mb_getMousePos(e,mod_savewmc_target);
-	var q = new Point(clickX,clickY);
-	var realWorldPos = mapToReal(mod_savewmc_target,q);
-
-	var el = frames[mod_savewmc_target].document;
-	el.onmousedown = null;
-	//alert(realWorldPos);
-	//document.sendData.target = "_blank";
-	//document.sendData.action = "../javascripts/mod_insertWmcIntoDb.php";
-	//document.sendData.data.value = user + "____" + generalTitle + "____" + wmc + "____" + id;
-	//document.sendData.submit();
-
-	saveWindow = open("", "save", "width=400, height=300, resizable, dependent=yes, scrollbars=yes");
-	saveWindow.document.open("text/html");
-/*
-	var cssLink = saveWindow.document.createElement("link");
-	cssLink.setAttribute("href", wfsCssUrl); 
-	cssLink.setAttribute("type", "text/css"); 
-	cssLink.setAttribute("rel", "stylesheet"); 
-	var cssTmp = saveWindow.document.getElementsByTagName("head")[0];
-	cssTmp.appendChild(cssLink);
-*/
-	var wmc_title = "meetingpoint";
-	var icon = "http://wms1.ccgis.de/mapbender_dev/img/pin.png";
-	
-	var str = "";
-	var onclick = "wmcid=window.opener.mod_savewmc('"+wmc_title+"');";
-	onclick += "document.sendData.action = '../javascripts/mod_insertKmlIntoDb.php?<?php echo SID;?>';";
-	onclick += "document.sendData.data.value = wmcid + '____" + realWorldPos.x + "____" + realWorldPos.y + "____"+ icon + "____<?php echo $gui_id;?>';";
-	onclick += "document.sendData.submit();" 
-	str += "<form name='sendData' method='post'>\n";
-	str += "<table>\n";
-	str += "<tr>\n";
-	str += "<td>Name</td>\n";
-	str += "<td><input type='text' name='name'></td>\n";
-	str += "</tr>\n";
-	str += "<tr>\n";
-	str += "<td>Strasse</td>\n";
-	str += "<td><input type='text' name='street'></td>\n";
-	str += "</tr>\n";
-	str += "<tr>\n";
-	str += "<td>PLZ</td>\n";
-	str += "<td><input type='text' name='postcode'></td>\n";
-	str += "</tr>\n";
-	str += "<tr>\n";
-	str += "<td>Ort</td>\n";
-	str += "<td><input type='text' name='city'></td>\n";
-	str += "</tr>\n";
-	str += "<tr>\n";
-	str += "<td>Webseite</td>\n";
-	str += "<td><input type='text' name='website'></td>\n";
-	str += "</tr>\n";
-	str += "<tr>\n";
-	str += "<td>Beschreibung</td>\n";
-	str += "<td><textarea name='description'></textarea></td>\n";
-	str += "</tr>\n";
-	str += "<tr>\n";
-	str += "<td colspan=2><input type='button' value='URL generieren' name='generateUrl' onclick=\""+onclick+"\"></td>\n";
-	str += "</tr>\n";
-	str += "</table>\n";
-	str += "<input type=hidden name=data>\n";
-	str += "</form>";
-	saveWindow.document.write(str);
-	saveWindow.document.close();
+<?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(dirname(__FILE__)."/../php/mb_validateSession.php");
+echo "mod_savewmc_target = '".$e_target[0]."';";
+?>
+
+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_saveWmcKml(obj){
+	current_user = "<?php echo $_SESSION["mb_user_id"]; ?>";
+	current_password = "<?php echo $_SESSION["mb_user_password"];?>";
+	current_gui = "<?php echo $gui_id;?>";
+	
+	alert('Please set the meeting point by clicking the map.');
+	
+	var ind = getMapObjIndexByName(mod_savewmc_target);
+	
+	var el = frames[mod_savewmc_target].document;
+	el.onmousedown = mod_getMousePos;
+	el.onmouseup = null;
+	el.onmousemove = null;
+	el.onmouseover = null;
+}
+
+function mod_getMousePos(e) {
+	mb_getMousePos(e,mod_savewmc_target);
+	var q = new Point(clickX,clickY);
+	var realWorldPos = mapToReal(mod_savewmc_target,q);
+
+	var el = frames[mod_savewmc_target].document;
+	el.onmousedown = null;
+	//alert(realWorldPos);
+	//document.sendData.target = "_blank";
+	//document.sendData.action = "../javascripts/mod_insertWmcIntoDb.php";
+	//document.sendData.data.value = user + "____" + generalTitle + "____" + wmc + "____" + id;
+	//document.sendData.submit();
+
+	saveWindow = open("", "save", "width=400, height=300, resizable, dependent=yes, scrollbars=yes");
+	saveWindow.document.open("text/html");
+/*
+	var cssLink = saveWindow.document.createElement("link");
+	cssLink.setAttribute("href", wfsCssUrl); 
+	cssLink.setAttribute("type", "text/css"); 
+	cssLink.setAttribute("rel", "stylesheet"); 
+	var cssTmp = saveWindow.document.getElementsByTagName("head")[0];
+	cssTmp.appendChild(cssLink);
+*/
+	var wmc_title = "meetingpoint";
+	var icon = "http://wms1.ccgis.de/mapbender_dev/img/pin.png";
+	
+	var str = "";
+	var onclick = "wmcid=window.opener.mod_savewmc('"+wmc_title+"');";
+	onclick += "document.sendData.action = '../javascripts/mod_insertKmlIntoDb.php?<?php echo SID;?>';";
+	onclick += "document.sendData.data.value = wmcid + '____" + realWorldPos.x + "____" + realWorldPos.y + "____"+ icon + "____<?php echo $gui_id;?>';";
+	onclick += "document.sendData.submit();" 
+	str += "<form name='sendData' method='post'>\n";
+	str += "<table>\n";
+	str += "<tr>\n";
+	str += "<td>Name</td>\n";
+	str += "<td><input type='text' name='name'></td>\n";
+	str += "</tr>\n";
+	str += "<tr>\n";
+	str += "<td>Strasse</td>\n";
+	str += "<td><input type='text' name='street'></td>\n";
+	str += "</tr>\n";
+	str += "<tr>\n";
+	str += "<td>PLZ</td>\n";
+	str += "<td><input type='text' name='postcode'></td>\n";
+	str += "</tr>\n";
+	str += "<tr>\n";
+	str += "<td>Ort</td>\n";
+	str += "<td><input type='text' name='city'></td>\n";
+	str += "</tr>\n";
+	str += "<tr>\n";
+	str += "<td>Webseite</td>\n";
+	str += "<td><input type='text' name='website'></td>\n";
+	str += "</tr>\n";
+	str += "<tr>\n";
+	str += "<td>Beschreibung</td>\n";
+	str += "<td><textarea name='description'></textarea></td>\n";
+	str += "</tr>\n";
+	str += "<tr>\n";
+	str += "<td colspan=2><input type='button' value='URL generieren' name='generateUrl' onclick=\""+onclick+"\"></td>\n";
+	str += "</tr>\n";
+	str += "</table>\n";
+	str += "<input type=hidden name=data>\n";
+	str += "</form>";
+	saveWindow.document.write(str);
+	saveWindow.document.close();
 }
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_savewmc.php
===================================================================
--- branches/print_dev/http/javascripts/mod_savewmc.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_savewmc.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,82 +1,82 @@
-<?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(dirname(__FILE__)."/../php/mb_validatePermission.php");
-include(dirname(__FILE__) . "/../include/dyn_js.php");
-
-echo "mod_savewmc_target = '".$e_target[0]."';";
-?>
-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) {
-	eventAfterMapRequest.register(function () {
-		mod_savewmc_session();
-	});
-//	mb_registerInitFunctions('setOnUnload()');
-}
-
-<?php 
-if ($e_src) {
-	sprintf("var mod_savewmc_img = new Image(); 
-			mod_savewmc_img.src = '%s';", $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", 1, function(result, status) {});
-}
-
-function mod_savewmc(title){
-	var generalTitle = title ? title : prompt("Save WMC as...");
-	if (generalTitle != "" && generalTitle != null) {
-		sendMapDataToServer(generalTitle, 0, function(result, status) {alert(status + ": " + result);});
-	}
-}
-
-function sendMapDataToServer(generalTitle, storeInSession, callbackFunction) {
-	var user = "<?php echo $_SESSION["mb_user_id"]; ?>";
-	var ind = getMapObjIndexByName(mod_savewmc_target);
-	
-	var	extensionDataString = "";
-	if (currentWmcExtensionData != null) {
-		extensionDataString = $.toJSON(currentWmcExtensionData);
-	}
-
-	if (storeInSession) {
-		$.ajaxSetup({async:false}); 
-	}
-	$.post("../php/mod_savewmc_server.php", {
-		"saveInSession":storeInSession, 
-		"generalTitle":generalTitle, 
-		"extensionData":extensionDataString, 
-		"mapObject":$.toJSON(mb_mapObj)
-	}, callbackFunction);
-}
+<?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(dirname(__FILE__)."/../php/mb_validatePermission.php");
+include(dirname(__FILE__) . "/../include/dyn_js.php");
+
+echo "mod_savewmc_target = '".$e_target[0]."';";
+?>
+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) {
+	eventAfterMapRequest.register(function () {
+		mod_savewmc_session();
+	});
+//	mb_registerInitFunctions('setOnUnload()');
+}
+
+<?php 
+if ($e_src) {
+	sprintf("var mod_savewmc_img = new Image(); 
+			mod_savewmc_img.src = '%s';", $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", 1, function(result, status) {});
+}
+
+function mod_savewmc(title){
+	var generalTitle = title ? title : prompt("Save WMC as...");
+	if (generalTitle != "" && generalTitle != null) {
+		sendMapDataToServer(generalTitle, 0, function(result, status) {alert(status + ": " + result);});
+	}
+}
+
+function sendMapDataToServer(generalTitle, storeInSession, callbackFunction) {
+	var user = "<?php echo $_SESSION["mb_user_id"]; ?>";
+	var ind = getMapObjIndexByName(mod_savewmc_target);
+	
+	var	extensionDataString = "";
+	if (currentWmcExtensionData != null) {
+		extensionDataString = $.toJSON(currentWmcExtensionData);
+	}
+
+	if (storeInSession) {
+		$.ajaxSetup({async:false}); 
+	}
+	$.post("../php/mod_savewmc_server.php", {
+		"saveInSession":storeInSession, 
+		"generalTitle":generalTitle, 
+		"extensionData":extensionDataString, 
+		"mapObject":$.toJSON(mb_mapObj)
+	}, callbackFunction);
+}

Modified: branches/print_dev/http/javascripts/mod_scaleSel.php
===================================================================
--- branches/print_dev/http/javascripts/mod_scaleSel.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_scaleSel.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,7 +1,7 @@
 <?php
 # $Id$
 # http://www.mapbender.org/index.php/mod_scaleSel.php
-# Copyright (C) 2002 CCGIS 
+# 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
@@ -16,22 +16,27 @@
 # 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.
+?>
+var mod_scaleSelect_target = options.target;
 
-require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
-echo "var mod_scaleSelect_target = '".$e_target[0]."';";
-?>
 eventAfterMapRequest.register(function (obj) {
 	mod_scaleSelect_val(obj.map.elementName);
 });
+
 function mod_scaleSelect(obj){
+	var myMapObj = Mapbender.Modules[mod_scaleSelect_target];
 	var ind = obj.selectedIndex;
-	mb_repaintScale(mod_scaleSelect_target,null,null,obj.options[ind].value);
+	myMapObj.repaintScale(null,null,obj.options[ind].value);
 }
 function mod_scaleSelect_val(frameName){
 	if(frameName == mod_scaleSelect_target){
-		var ind = getMapObjIndexByName(frameName);
-		var scale = mb_mapObj[ind].getScale();
+		var myMapObj = Mapbender.Modules[mod_scaleSelect_target];
+		var scale = myMapObj.getScale();
 		document.getElementById("scaleSelect").options[0].text = "1 : " + scale;
 		document.getElementById("scaleSelect").options[0].selected = true;
 	}
 }
+
+$(this).change(function () {
+	mod_scaleSelect(this);
+});
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_setPOI2Scale.php
===================================================================
--- branches/print_dev/http/javascripts/mod_setPOI2Scale.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_setPOI2Scale.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,51 +1,51 @@
-<?php
-# $Id$ 
-# http://www.mapbender.org/index.php/mod_setPOI2Scale.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(dirname(__FILE__)."/../php/mb_validatePermission.php");
-echo "var mod_setPOI2Scale_target = '".$e_target[0]."';";
-include(dirname(__FILE__) . "/../include/dyn_js.php");
-
-?>
-
-try{
-	if (mod_setPOI2Scale_defScale){}
-}
-catch(e){
-	mod_setPOI2Scale_defScale = 5000;
-}
-
-eventInit.register(function () {
-	mod_setPOI2Scale();
-});
-
-function mod_setPOI2Scale(){
-	var my_target = mod_setPOI2Scale_target.split(",");
-	var myPOI = "<?php echo $_SESSION['mb_myPOI2SCALE'] ?>";
-	if(myPOI && myPOI != ""){
-		var coord = myPOI.split(",");
-		if(coord.length == 2){
-			coord[2] = mod_setPOI2Scale_defScale; 	
-		}
-		for(var i=0; i<my_target.length; i++){		
-			if(myPOI != ""){							
-				mb_repaintScale(my_target[i], coord[0], coord[1], coord[2]);			
-			}
-		}
-	}
-}
+<?php
+# $Id$ 
+# http://www.mapbender.org/index.php/mod_setPOI2Scale.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(dirname(__FILE__)."/../php/mb_validatePermission.php");
+echo "var mod_setPOI2Scale_target = '".$e_target[0]."';";
+include(dirname(__FILE__) . "/../include/dyn_js.php");
+
+?>
+
+try{
+	if (mod_setPOI2Scale_defScale){}
+}
+catch(e){
+	mod_setPOI2Scale_defScale = 5000;
+}
+
+eventInit.register(function () {
+	mod_setPOI2Scale();
+});
+
+function mod_setPOI2Scale(){
+	var my_target = mod_setPOI2Scale_target.split(",");
+	var myPOI = "<?php echo $_SESSION['mb_myPOI2SCALE'] ?>";
+	if(myPOI && myPOI != ""){
+		var coord = myPOI.split(",");
+		if(coord.length == 2){
+			coord[2] = mod_setPOI2Scale_defScale; 	
+		}
+		for(var i=0; i<my_target.length; i++){		
+			if(myPOI != ""){							
+				mb_repaintScale(my_target[i], coord[0], coord[1], coord[2]);			
+			}
+		}
+	}
+}

Modified: branches/print_dev/http/javascripts/mod_setTimeout.php
===================================================================
--- branches/print_dev/http/javascripts/mod_setTimeout.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_setTimeout.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,94 +1,94 @@
-<?php
-# $Id$
-# maintained by http://www.mapbender.org/index.php/User:Astrid Emde
-# http://www.mapbender.org/index.php/mod_setTimeout.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(dirname(__FILE__)."/../php/mb_validateSession.php");
-include '../include/dyn_js.php';
-
-?>
-
-try{
-	if (mod_timeout_text){}
-}
-catch(e){
-	mod_timeout_text = "Your session may not be valid anymore!";
-	//mod_timeout_text = "Bitte beachten Sie, dass Ihre Session abgelaufen sein kann!";
-}
-
-try{
-	if (mod_timeout_ttl){}
-}
-catch(e){
-	mod_timeout_ttl = '15';
-}
-
-/*
-* alert:    a confirm - window to reload the application when timeout is reached
-* logout:  request mod_logout after timeout
-*/
-try{
-	if (mod_timeout_action){}
-}
-catch(e){
-	mod_timeout_action = 'alert';
-}
-
-
-/*version 2.0.0*/
-mod_timeout_cnt = false;
-
-
-mb_registerSubFunctions("mod_setTimeout_set()");            // maprequest
-mb_registerInitFunctions("mod_setTimeout_interval()");
-
-function mod_setTimeout_interval(){
-   var aktiv = window.setInterval("mod_setTimeout_check()",60000);
-   mod_setTimeout_set();
-   mod_setTimeout_check();
-}
-
-function mod_setTimeout_set(){
-   mod_timeout_cnt = parseInt(mod_timeout_ttl);
-   mod_setTimeout_check();
-}
-
-function mod_setTimeout_check(){
-   
-   var str = "<span style='font-family: Arial, Helvetica, sans-serif;font-size:10px;'>";
-   str += "Logout in ";
-   
-   if(mod_timeout_cnt >= 0){
-      str += mod_timeout_cnt;
-   }
-   else { str += "0";  }
-   
-   str += " min";
-   str += "</span>";
-   writeTag("", "timeout",  str ); 
-   
-   if(mod_timeout_cnt == 0 && mod_timeout_action == 'alert'){       
-      var go = confirm(mod_timeout_text);
-      if(go == true){
-        //  document.location.href = "./login.php"; 
-      }
-      
-   }
-   if(mod_timeout_cnt == 0 && mod_timeout_action == 'logout'){ document.location.href = "../php/mod_logout.php";}
-   mod_timeout_cnt--;
-}
+<?php
+# $Id$
+# maintained by http://www.mapbender.org/index.php/User:Astrid Emde
+# http://www.mapbender.org/index.php/mod_setTimeout.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(dirname(__FILE__)."/../php/mb_validateSession.php");
+include '../include/dyn_js.php';
+
+?>
+
+try{
+	if (mod_timeout_text){}
+}
+catch(e){
+	mod_timeout_text = "Your session may not be valid anymore!";
+	//mod_timeout_text = "Bitte beachten Sie, dass Ihre Session abgelaufen sein kann!";
+}
+
+try{
+	if (mod_timeout_ttl){}
+}
+catch(e){
+	mod_timeout_ttl = '15';
+}
+
+/*
+* alert:    a confirm - window to reload the application when timeout is reached
+* logout:  request mod_logout after timeout
+*/
+try{
+	if (mod_timeout_action){}
+}
+catch(e){
+	mod_timeout_action = 'alert';
+}
+
+
+/*version 2.0.0*/
+mod_timeout_cnt = false;
+
+
+mb_registerSubFunctions("mod_setTimeout_set()");            // maprequest
+mb_registerInitFunctions("mod_setTimeout_interval()");
+
+function mod_setTimeout_interval(){
+   var aktiv = window.setInterval("mod_setTimeout_check()",60000);
+   mod_setTimeout_set();
+   mod_setTimeout_check();
+}
+
+function mod_setTimeout_set(){
+   mod_timeout_cnt = parseInt(mod_timeout_ttl);
+   mod_setTimeout_check();
+}
+
+function mod_setTimeout_check(){
+   
+   var str = "<span style='font-family: Arial, Helvetica, sans-serif;font-size:10px;'>";
+   str += "Logout in ";
+   
+   if(mod_timeout_cnt >= 0){
+      str += mod_timeout_cnt;
+   }
+   else { str += "0";  }
+   
+   str += " min";
+   str += "</span>";
+   writeTag("", "timeout",  str ); 
+   
+   if(mod_timeout_cnt == 0 && mod_timeout_action == 'alert'){       
+      var go = confirm(mod_timeout_text);
+      if(go == true){
+        //  document.location.href = "./login.php"; 
+      }
+      
+   }
+   if(mod_timeout_cnt == 0 && mod_timeout_action == 'logout'){ document.location.href = "../php/mod_logout.php";}
+   mod_timeout_cnt--;
+}

Modified: branches/print_dev/http/javascripts/mod_switchLocale_noreload.php
===================================================================
--- branches/print_dev/http/javascripts/mod_switchLocale_noreload.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_switchLocale_noreload.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,54 +1,54 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/localeSwitch
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_locale.php");
-
-include(dirname(__FILE__) . "/../include/dyn_js.php");
-
-if (!USE_I18N) {
-	echo "var languages = '" . $_SESSION["mb_lang"] . "';";
-}
-?>
-
-function validate_locale(){
-	var index = document.getElementById("language").selectedIndex;
-	var lang = document.getElementById("language").options[index].value;
-	mb_ajax_post("../php/mod_setLocale.php", {"lang":lang}, function(result, status) {
-		Mapbender.locale = result;
-		eventLocalize.trigger();
-	});
-}
-
-eventInit.register(function () {
-	var localeSelectNode = document.getElementById('language');
-	var languageArray = languages.split(",");
-	var selected = false;
-	for (var i = 0; i < languageArray.length; i++) {
-		if (languageArray[i] == '<?php echo $_SESSION["mb_lang"];?>') {
-			selected = true;
-		}		
-		else {
-			selected = false;
-		}
-		
-		var currentOption = new Option(languageArray[i], languageArray[i], selected, selected);
-		localeSelectNode.options[i] = currentOption;
-	}
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/localeSwitch
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_locale.php");
+
+include(dirname(__FILE__) . "/../include/dyn_js.php");
+
+if (!USE_I18N) {
+	echo "var languages = '" . $_SESSION["mb_lang"] . "';";
+}
+?>
+
+function validate_locale(){
+	var index = document.getElementById("language").selectedIndex;
+	var lang = document.getElementById("language").options[index].value;
+	mb_ajax_post("../php/mod_setLocale.php", {"lang":lang}, function(result, status) {
+		Mapbender.locale = result;
+		eventLocalize.trigger();
+	});
+}
+
+eventInit.register(function () {
+	var localeSelectNode = document.getElementById('language');
+	var languageArray = languages.split(",");
+	var selected = false;
+	for (var i = 0; i < languageArray.length; i++) {
+		if (languageArray[i] == '<?php echo $_SESSION["mb_lang"];?>') {
+			selected = true;
+		}		
+		else {
+			selected = false;
+		}
+		
+		var currentOption = new Option(languageArray[i], languageArray[i], selected, selected);
+		localeSelectNode.options[i] = currentOption;
+	}
 });
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_wfs_gazetteer_client.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -175,9 +175,8 @@
 			currentImg.name = buttonWfs_id[i];
 			currentImg.title = buttonWfs_title_off[i];
 			currentImg.src = buttonWfs_imgdir+buttonWfs_src[i];
-			currentImg.style.marginRight = "5px";
+			currentImg.style.margin = "5px";
 			currentImg.onmouseover = new Function("wfsInitFunction("+i+")");
-			
 			document.getElementById("displaySpatialButtons").appendChild(currentImg);
 		}
 	}
@@ -233,8 +232,9 @@
 				var spatialRes = document.createElement("span");
 				spatialRes.id = "spatialResHint";
 				spatialRes.name = "spatialResHint";
+				spatialRes.className = "spatialResHint";
 				document.getElementById("displaySpatialButtons").appendChild(spatialRes);
-				document.getElementById("spatialResHint").innerHTML = spatialRequestIsSetMessage;
+				document.getElementById("spatialResHint").innerHTML = "<br><img src='"+spatialRequestIsSetImg+"'></img>"+spatialRequestIsSetMessage;
 				spatialRequestGeom = queryGeom;
 			}
 			parent.mb_disableThisButton(selectedType);
@@ -350,15 +350,13 @@
 
 function initModWfsGazetteer() {
 	// empty nodes
-	var nodesToEmpty = ["selectWfsConfForm", "wfsForm", "res", "wfsInfo"];
+	var nodesToEmpty = ["selectWfsConfForm", "wfsForm", "res", "wfsIcons"];
 	while (nodesToEmpty.length > 0) {
 		var currentId = nodesToEmpty.pop();
 		var currentNode = document.getElementById(currentId);
 		removeChildNodes(currentNode);
 	}
-	document.getElementById("wfsGeomType").style.visibility = "hidden";
-	document.getElementById("wfsRemove").style.visibility = "hidden";
-		
+	
 	geomArray = new parent.GeometryArray();
 
 	parent.mb_ajax_json("../php/mod_wfs_gazetteer_server.php", {command:"getWfsConf",wfsConfIdString:wfsConfIdString}, function(json, status) {
@@ -376,11 +374,10 @@
 		else if (wfsCount === 1) {
 			appendStyles();
 			appendWfsForm();
-			setWfsInfo();	
 		}
 		else {
 			appendWfsConfSelectBox();
-			setWfsInfo();	
+			
 		}
 		parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
 	});
@@ -393,7 +390,13 @@
 }
 
 function setWfsInfo() {
-	var bulbNode = document.getElementById("wfsInfo"); 	
+	
+	var bodyNode = document.getElementById("wfsIcons");
+	removeChildNodes(bodyNode);
+	var bulbNode = document.createElement("a");	
+	bulbNode.name = "wfsInfo";
+	bulbNode.id = "wfsInfo";
+	bodyNode.appendChild(bulbNode);
 
 	// append bulb image
 	removeChildNodes(bulbNode);
@@ -402,12 +405,41 @@
 	//imgNode.src = "../img/button_digitize/geomInfo.png";
 	imgNode.src = "../img/tree_new/info.png";
 	imgNode.border = 0;
+	imgNode.title = "show metadata";
 	bulbNode.appendChild(imgNode);
 	bulbNode.href = "javascript:openwindow('../php/mod_featuretypeMetadata.php?wfs_conf_id=" + global_selectedWfsConfId.toString() + "');";
 	bulbNode.style.visibility = "visible";
-	
+		
+	// set image: remove this WFS
+	var wfsRemoveNode = document.createElement("img");
+	wfsRemoveNode.name = "wfsRemove";
+	wfsRemoveNode.id = "wfsRemove";
+	wfsRemoveNode.title = "remove WFS Conf";
+	bodyNode.appendChild(wfsRemoveNode);
+	//wfsRemoveNode.src = "../img/button_digitize/geomRemove.png";
+	wfsRemoveNode.src = "../img/tree_new/delete_wms.png";
+	wfsRemoveNode.style.visibility = 'visible';
+	// Internet explorer
+	if (parent.ie) {
+		wfsRemoveNode.onclick = function() {
+			var x = new Function ("", "delete global_wfsConfObj[global_selectedWfsConfId];setWfsConfIdString();initModWfsGazetteer();parent.mb_setWmcExtensionData({'wfsConfIdString':wfsConfIdString});"); 
+			x(); 
+		};
+	}
+	// Firefox
+	else {
+		wfsRemoveNode.onclick = function () {
+			delete global_wfsConfObj[global_selectedWfsConfId];
+			setWfsConfIdString();
+			initModWfsGazetteer();			
+			parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
+		}
+	} 
 	// set wfsGeomType image
-	var wfsGeomTypeNode = document.getElementById("wfsGeomType");
+	var wfsGeomTypeNode = document.createElement("img");
+	wfsGeomTypeNode.name = "wfsGeomType";
+	wfsGeomTypeNode.id = "wfsGeomType";
+	bodyNode.appendChild(wfsGeomTypeNode);
 	var wfsGeomType = "";
 	for (var i=0; i < global_wfsConfObj[global_selectedWfsConfId].element.length; i++) {
 		if (parseInt(global_wfsConfObj[global_selectedWfsConfId].element[i].f_geom)) {
@@ -417,40 +449,19 @@
 	if (wfsGeomType.match(/Point/)) {
 		wfsGeomTypeNode.src = "../img/button_digitize/point.png";
 		wfsGeomTypeNode.style.visibility = 'visible';
+		wfsGeomTypeNode.title = 'Point';
 	}
 	else if (wfsGeomType.match(/Line/)) {
 		wfsGeomTypeNode.src = "../img/button_digitize/line.png";
-		wfsGeomTypeNode.style.visibility = 'visible';
+		wfsGeomTypeNode.title = 'Line';
 	}
 	else if (wfsGeomType.match(/Polygon/)) {
 		wfsGeomTypeNode.src = "../img/button_digitize/polygon.png";
-		wfsGeomTypeNode.style.visibility = 'visible';
+		wfsGeomTypeNode.title = 'Polygon';
 	}
 	else {
 		var e = new parent.Mb_exception("WFS gazetteer: geometry type unknown.");
 	}
-	
-	// set image: remove this WFS
-	var wfsRemoveNode = document.getElementById("wfsRemove");
-	//wfsRemoveNode.src = "../img/button_digitize/geomRemove.png";
-	wfsRemoveNode.src = "../img/tree_new/delete_wms.png";
-	wfsRemoveNode.style.visibility = 'visible';
-	// Internet explorer
-	if (parent.ie) {
-		wfsRemoveNode.onclick = function() {
-			var x = new Function ("", "delete global_wfsConfObj[global_selectedWfsConfId];setWfsConfIdString();initModWfsGazetteer();parent.mb_setWmcExtensionData({'wfsConfIdString':wfsConfIdString});"); 
-			x(); 
-		};
-	}
-	// Firefox
-	else {
-		wfsRemoveNode.onclick = function () {
-			delete global_wfsConfObj[global_selectedWfsConfId];
-			setWfsConfIdString();
-			initModWfsGazetteer();			
-			parent.mb_setWmcExtensionData({"wfsConfIdString":wfsConfIdString});
-		}
-	}  
 }
 
 function setWfsConfIdString() {
@@ -477,13 +488,12 @@
 	 	if(typeof(wfsPopup)!="undefined"){
 	 		wfsPopup.destroy();
 	 	}
-    	setWfsInfo();
-		appendStyles();
+    	appendStyles();
 		appendWfsForm();
 		};
 	}
 	else{
-	   selectNode.setAttribute("onchange", "if(typeof(resultGeometryPopup)!='undefined'){resultGeometryPopup.destroy();}if(typeof(wfsPopup)!='undefined'){wfsPopup.destroy();};global_selectedWfsConfId = this.value;setWfsInfo();appendStyles();appendWfsForm();");
+	   selectNode.setAttribute("onchange", "if(typeof(resultGeometryPopup)!='undefined'){resultGeometryPopup.destroy();}if(typeof(wfsPopup)!='undefined'){wfsPopup.destroy();};global_selectedWfsConfId = this.value;appendStyles();appendWfsForm();");
 	}
 	var isSelected = false;
 	for (var wfsConfId in global_wfsConfObj) {
@@ -508,6 +518,9 @@
 }
 
 function appendWfsForm() {
+	if(showWfsIcons) {
+		setWfsInfo();
+	}
 	var form = document.getElementById("wfsForm");
 	removeChildNodes(form);
 	var resultDiv = document.getElementById("res");
@@ -574,7 +587,7 @@
 	var delFilterButton = document.createElement("input");
 	delFilterButton.type = "button";
 	delFilterButton.style.marginLeft = "5px";
-	delFilterButton.className = global_wfsConfObj[global_selectedWfsConfId].g_button_id;
+	delFilterButton.className = "buttonDelFilter";
 	delFilterButton.value = clearFilterButtonLabel;
 	// Internet explorer
 	if (parent.ie) {
@@ -718,7 +731,7 @@
 	}
 	else{
 		if(inputNotEnough.length==0){
-			var andConditions = "";
+			var andConditions = [];
 			
 			var el = global_wfsConfObj[global_selectedWfsConfId].element;
 			var srs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
@@ -854,49 +867,50 @@
 						}
 					}
 					if(a.length > 1){
-						andConditions += "<Or>" + orConditions + "</Or>";
+						andConditions.push("<Or>" + orConditions + "</Or>");
 					}
 					else {
-						andConditions += orConditions;
+						andConditions.push(orConditions);
 					}
 				}
 			}
 			
 			if(spatialRequestGeom!=null){
+				var currentAndCondition = "";
 				if(spatialRequestGeom.geomType == "polygon"){
 					if(buttonPolygon.filteroption=='within'){	
-						andConditions += "<Within><ogc:PropertyName>";
+						currentAndCondition = "<Within><ogc:PropertyName>";
 						for (var j=0; j < el.length; j++) {
 							if(el[j]['f_geom']==1){
 								var elementName = el[j]['element_name'];
-								andConditions += el[j]['element_name'];
+								currentAndCondition += el[j]['element_name'];
 							}
 						}
-						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+						currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
+						currentAndCondition += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
 						for(var k=0; k<spatialRequestGeom.count(); k++){
-							if(k>0)	andConditions += " ";
-							andConditions += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
+							if(k>0)	currentAndCondition += " ";
+							currentAndCondition += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
 						}
-						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
-						andConditions += "</gml:Polygon></Within>";
+						currentAndCondition += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
+						currentAndCondition += "</gml:Polygon></Within>";
 					}
 					else if(buttonPolygon.filteroption=='intersects'){
-						andConditions += "<Intersects><ogc:PropertyName>";
+						currentAndCondition = "<Intersects><ogc:PropertyName>";
 						for (var j=0; j < el.length; j++) {
 							if(el[j]['f_geom']==1){
 								var elementName = el[j]['element_name'];
-								andConditions += el[j]['element_name'];
+								currentAndCondition += el[j]['element_name'];
 							}
 						}
-						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+						currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
+						currentAndCondition += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
 						for(var k=0; k<spatialRequestGeom.count(); k++){
-							if(k>0)	andConditions += " ";
-							andConditions += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
+							if(k>0)	currentAndCondition += " ";
+							currentAndCondition += spatialRequestGeom.get(k).x+","+spatialRequestGeom.get(k).y;
 						}
-						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
-						andConditions += "</gml:Polygon></Intersects>";
+						currentAndCondition += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
+						currentAndCondition += "</gml:Polygon></Intersects>";
 					}
 				}	
 				else if(spatialRequestGeom.geomType == "line"){
@@ -904,48 +918,48 @@
 					rectangle = spatialRequestGeom.getBBox();
 					
 					if(buttonRectangle.filteroption=='within'){	
-						andConditions += "<Within><ogc:PropertyName>";
+						currentAndCondition = "<Within><ogc:PropertyName>";
 						for (var j=0; j < el.length; j++) {
 							if(el[j]['f_geom']==1){
 								var elementName = el[j]['element_name'];
-								andConditions += el[j]['element_name'];
+								currentAndCondition += el[j]['element_name'];
 							}
 						}
-						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
-						andConditions += rectangle[0].x+","+rectangle[0].y;
-						andConditions += " ";
-						andConditions += rectangle[0].x+","+rectangle[1].y;
-						andConditions += " ";
-						andConditions += rectangle[1].x+","+rectangle[1].y;
-						andConditions += " ";
-						andConditions += rectangle[1].x+","+rectangle[0].y;
-						andConditions += " ";
-						andConditions += rectangle[0].x+","+rectangle[0].y;
-						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
-						andConditions += "</gml:Polygon></Within>";
+						currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
+						currentAndCondition += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";
+						currentAndCondition += rectangle[0].x+","+rectangle[0].y;
+						currentAndCondition += " ";
+						currentAndCondition += rectangle[0].x+","+rectangle[1].y;
+						currentAndCondition += " ";
+						currentAndCondition += rectangle[1].x+","+rectangle[1].y;
+						currentAndCondition += " ";
+						currentAndCondition += rectangle[1].x+","+rectangle[0].y;
+						currentAndCondition += " ";
+						currentAndCondition += rectangle[0].x+","+rectangle[0].y;
+						currentAndCondition += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
+						currentAndCondition += "</gml:Polygon></Within>";
 					}
 					else if(buttonRectangle.filteroption=='intersects'){
-						andConditions += "<Intersects><ogc:PropertyName>";
+						currentAndCondition = "<Intersects><ogc:PropertyName>";
 						for (var j=0; j < el.length; j++) {
 							if(el[j]['f_geom']==1){
 								var elementName = el[j]['element_name'];
-								andConditions += el[j]['element_name'];
+								currentAndCondition += el[j]['element_name'];
 							}
 						}
-						andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
-						andConditions += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
-						andConditions += rectangle[0].x+","+rectangle[0].y;
-						andConditions += " ";
-						andConditions += rectangle[0].x+","+rectangle[1].y;
-						andConditions += " ";
-						andConditions += rectangle[1].x+","+rectangle[1].y;
-						andConditions += " ";
-						andConditions += rectangle[1].x+","+rectangle[0].y;
-						andConditions += " ";
-						andConditions += rectangle[0].x+","+rectangle[0].y;
-						andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
-						andConditions += "</gml:Polygon></Intersects>";
+						currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\">";
+						currentAndCondition += "<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+						currentAndCondition += rectangle[0].x+","+rectangle[0].y;
+						currentAndCondition += " ";
+						currentAndCondition += rectangle[0].x+","+rectangle[1].y;
+						currentAndCondition += " ";
+						currentAndCondition += rectangle[1].x+","+rectangle[1].y;
+						currentAndCondition += " ";
+						currentAndCondition += rectangle[1].x+","+rectangle[0].y;
+						currentAndCondition += " ";
+						currentAndCondition += rectangle[0].x+","+rectangle[0].y;
+						currentAndCondition += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs>";
+						currentAndCondition += "</gml:Polygon></Intersects>";
 					}			
 				}
 				else if(spatialRequestGeom.geomType == "point"){
@@ -960,30 +974,35 @@
 					var realWorld2 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
 					var realWorld3 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYAddPix);
 					var realWorld4 = parent.makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYAddPix);
-					andConditions += "<Intersects><ogc:PropertyName>";
+					currentAndCondition = "<Intersects><ogc:PropertyName>";
 					for (var j=0; j < el.length; j++) {
 						if(el[j]['f_geom']==1){
 							var elementName = el[j]['element_name'];
-							andConditions += el[j]['element_name'];
+							currentAndCondition += el[j]['element_name'];
 						}
 					}
-					andConditions += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
-					andConditions += realWorld1[0] + "," + realWorld1[1] + " " + realWorld2[0] + "," + realWorld2[1] +  " ";
-					andConditions += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1]; 
-					andConditions += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects>";
+					currentAndCondition += "</ogc:PropertyName><gml:Polygon srsName=\""+srs+"\"><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>";	
+					currentAndCondition += realWorld1[0] + "," + realWorld1[1] + " " + realWorld2[0] + "," + realWorld2[1] +  " ";
+					currentAndCondition += realWorld3[0] + "," + realWorld3[1] + " " + realWorld4[0] + "," + realWorld4[1] + " " + realWorld1[0] + "," + realWorld1[1]; 
+					currentAndCondition += "</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects>";
 				}
 				//andConditions += "<ogc:Not><ogc:PropertyIsNull>";
 	            //andConditions += "<ogc:PropertyName>" + elementName + "</ogc:PropertyName>";
 	       		//andConditions += "</ogc:PropertyIsNull></ogc:Not>";
+				if (currentAndCondition !== "") {
+					andConditions.push(currentAndCondition);
+				}
+
 			}
 			
-			if (filterParameterCount > 1 || spatialRequestGeom != null) {
-				andConditions = "<And>" + andConditions + "</And>";
+			var andConditionString = andConditions.join("");
+			if (andConditions.length > 1) {
+				andConditionString = "<And>" + andConditionString + "</And>";
 			}
 	
-			var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditions+"</ogc:Filter>";
+			var filter = "<ogc:Filter xmlns:ogc='http://ogc.org' xmlns:gml='http://www.opengis.net/gml'>"+andConditionString+"</ogc:Filter>";
 	
-			document.getElementById("res").innerHTML = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
+			document.getElementById("res").innerHTML = "<table><tr><td><img src='"+progressIndicatorImg+"'></td><td>"+progressIndicatorText+"</td></tr></table>";
 			var parameters = {
 				"command" : "getSearchResults", 
 				"wfs_conf_id" : global_selectedWfsConfId, 
@@ -993,7 +1012,7 @@
 				"backlink" : ""
 			};
 			parent.mb_ajax_get("../php/mod_wfs_gazetteer_server.php", parameters, function (jsCode, status) {
-				document.getElementById("res").innerHTML = "<table><tr><td>Arranging search results...</td></tr></table>";
+				document.getElementById("res").innerHTML = "<table><tr><td>"+arrangeResultsText+"</td></tr></table>";
 				
 				if(status=='success'){
 					for (var i=0; i < parent.wms.length; i++) {
@@ -1053,7 +1072,8 @@
 		}
 		resultGeometryPopup.show();
 		parent.$("#resultTable").tablesorter({
-     		sortList: [[0,0]]
+     		sortList: [[0,0]],
+     		widgets: ['zebra'] 
         });
 	}
 	else{
@@ -1093,10 +1113,10 @@
 						listOfGeom += "<td style='cursor:pointer;\n";
 						if(showResultInPopup==1){
 							if ((i % 2) === 0) {
-								listOfGeom += "color:blue'";
+								listOfGeom += "' class='even'";
 							}
 							else {
-								listOfGeom += "color:red'";
+								listOfGeom += "' class='odd'";
 							}
 						}
 						else{
@@ -1268,13 +1288,12 @@
 
 </script>
 </head>
-<body leftmargin='0' topmargin='10'  bgcolor='#ffffff'>
+<body>
 <form name='selectWfsConfForm' id='selectWfsConfForm'></form>
-<div name='displaySpatialButtons' id='displaySpatialButtons' style='width:180px'></div>
-<a name='wfsInfo' id='wfsInfo'></a>
-<img src = "" name='wfsRemove' id='wfsRemove'>
-<img src = "" name='wfsGeomType' id='wfsGeomType'>
-<form name='wfsForm' id='wfsForm' onsubmit='return validate()'></form>
+<div name='wfsIcons' id='wfsIcons'></div>
+<div name='displaySpatialButtons' id='displaySpatialButtons' style='width:180px;margin-top:5px;background-color:#FFFFFF;'></div>
+<form name='wfsForm' id='wfsForm' onsubmit='return validate()'>
+</form>
 <div name='res' id='res' style='width:180px'></div>
 </body>
 </html>

Modified: branches/print_dev/http/javascripts/mod_zoomFull.php
===================================================================
--- branches/print_dev/http/javascripts/mod_zoomFull.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_zoomFull.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,31 +1,21 @@
 <?php
 #$Id$
 #$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_zoomFull.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
-require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
 ?>
-   var mod_zoomFull_img = new Image(); 
-   mod_zoomFull_img.src = "<?php  echo $e_src;  ?>";
-   var mod_zoomFull_img_over = new Image(); 
-   mod_zoomFull_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
-
-function mod_zoomFull(){
-	var frameName = "<?php  echo $e_target[0];  ?>"
-    var ind = this.getMapObjIndexByName(frameName);
-	
-	mb_mapObj[ind].zoomFull();
-}
-
-function mod_zoomFull_init(obj){
-   document.getElementById("zoomFull").src = mod_zoomFull_img_over.src;
-   obj.onmouseover = new Function("mod_zoomFull_over()");
-   obj.onmouseout = new Function("mod_zoomFull_out()");
-}
-function mod_zoomFull_over(){
-   document.getElementById("zoomFull").src = mod_zoomFull_img_over.src;
-}
-function mod_zoomFull_out(){
-   document.getElementById("zoomFull").src = mod_zoomFull_img.src;
-}
-
-
-
+$(this).click(function () {
+	if (!options.target) {
+		return;
+	}
+	if (!Mapbender.Modules[options.target]) {
+		return;
+	}
+	Mapbender.Modules[options.target].zoomFull();
+}).mouseover(function () {
+	if (options.src) {
+		this.src = options.src.replace(/_off/, "_over");
+	}
+}).mouseout(function () {
+	if (options.src) {
+		this.src = options.src;
+	}
+});
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_zoomIn1.php
===================================================================
--- branches/print_dev/http/javascripts/mod_zoomIn1.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_zoomIn1.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -16,30 +16,45 @@
 # 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(dirname(__FILE__)."/../php/mb_validatePermission.php");
 ?>
-var zoomin1Id = '<?php echo $e_id; ?>';
-var mod_zoom1_img = new Image(); 
-mod_zoom1_img.src = "<?php  echo $e_src;  ?>";
-var mod_zoom1_img_over = new Image(); 
-mod_zoom1_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
-
-var $zoomin1Button = $("#"+zoomin1Id);
-
-$zoomin1Button.click(function () {
-	zoom("<?php  echo $e_target[0];  ?>", true, 2.0);
-});
-
-function mod_zoomIn1_init(obj){
-	document.getElementById("zoomIn1").src = mod_zoom1_img_over.src;
-	obj.onmouseover = new Function("mod_zoomIn1_over()");
-	obj.onmouseout = new Function("mod_zoomIn1_out()");
-}
-function mod_zoomIn1_over(){
-	document.getElementById("zoomIn1").src = mod_zoom1_img_over.src;
-}
-function mod_zoomIn1_out(){
-	document.getElementById("zoomIn1").src = mod_zoom1_img.src;
-}
-
+/**
+ * Package: ZoomIn1
+ *
+ * Description:
+ * Click button, which minimizes the real world bounding box of the visible map section, doubles the scale (halfes the scale number). Image size is not affected. 
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:Christoph_Baudson
+ *
+ * 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) 
+ * > VALUES('gui', 'zoomIn1', 2, 1, 'zoomIn button','Zoom in',
+ * > 'img','../img/button_gray/zoomIn2_off.png','',220,10,24,24,1,
+ * > '','','','mod_zoomIn1.php','','mapframe1','',
+ * > 'http://www.mapbender.org/index.php/ZoomIn');
+ *
+ * Files:
+ *  - http/javascripts/mod_zoomIn1.php
+ *
+ *  
+ */
+$(this).click(function () {
+	if (!options.target) {
+		return;
+	}
+	if (!Mapbender.Modules[options.target]) {
+		return;	
+	}
+	Mapbender.Modules[options.target].zoom(true, 2.0);
+}).mouseover(function () {
+	if (options.src) {
+		this.src = options.src.replace(/_off/, "_over");
+	}
+}).mouseout(function () {
+	if (options.src) {
+		this.src = options.src;
+	}
+});
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/mod_zoomOut1.php
===================================================================
--- branches/print_dev/http/javascripts/mod_zoomOut1.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/mod_zoomOut1.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,31 +1,21 @@
 <?php
 #$Id$
 #$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_zoomOut1.php,v 1.8 2005/09/13 18:16:42 bjoern_heuser Exp $
-
-require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
 ?>
-var mod_zoomOut_img = new Image(); 
-mod_zoomOut_img.src = "<?php  echo $e_src;  ?>";
-var mod_zoomOut_img_over = new Image(); 
-mod_zoomOut_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
-
-var zoomOut1Id = '<?php echo $e_id; ?>';
-
-var $zoomOut1Button = $("#"+zoomOut1Id);
-
-$zoomOut1Button.click(function () {
-	zoom("<?php  echo $e_target[0];  ?>", false, 2.0);
-});
-
-function mod_zoomOut1_init(obj){
-   document.getElementById("zoomOut1").src = mod_zoomOut_img_over.src;
-   obj.onmouseover = new Function("mod_zoomOut1_over()");
-   obj.onmouseout = new Function("mod_zoomOut1_out()");
-}
-function mod_zoomOut1_over(){
-   document.getElementById("zoomOut1").src = mod_zoomOut_img_over.src;
-}
-function mod_zoomOut1_out(){
-   document.getElementById("zoomOut1").src = mod_zoomOut_img.src;
-}
-
+$(this).click(function () {
+	if (!options.target) {
+		return;
+	}
+	if (!Mapbender.Modules[options.target]) {
+		return;
+	}
+	Mapbender.Modules[options.target].zoom(false, 2.0);
+}).mouseover(function () {
+	if (options.src) {
+		this.src = options.src.replace(/_off/, "_over");
+	}
+}).mouseout(function () {
+	if (options.src) {
+		this.src = options.src;
+	}
+});
\ No newline at end of file

Modified: branches/print_dev/http/javascripts/ovnf.php
===================================================================
--- branches/print_dev/http/javascripts/ovnf.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/ovnf.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -24,6 +24,9 @@
 if (typeof(overview_wms) === 'undefined')overview_wms = 0;
 overview_wms = parseInt(overview_wms);
 
+var mod_overview_width = <?php echo $e_width; ?>;
+var mod_overview_height = <?php echo $e_height; ?>;
+
 mb_registerMapObj('', 'overview', overview_wms ,<?php echo $e_width; ?>, <?php echo $e_height; ?>);
 parent.eventInitMap.register(function init_overview(){
 		var ind = getMapObjIndexByName('overview');
@@ -48,3 +51,50 @@
 	mod_box_setValidClipping(mod_box_stop(e));
 }
 
+eventAfterMapRequest.register(function () {
+	var targetMapObj = getMapObjByName(mod_overview_target);
+	
+	if (!targetMapObj) {
+		return;
+	}
+	var arrayBBox = targetMapObj.extent.split(",");
+	var minX = parseFloat(arrayBBox[0]);
+	var minY = parseFloat(arrayBBox[1]);
+	var maxX = parseFloat(arrayBBox[2]);
+	var maxY = parseFloat(arrayBBox[3]);
+	var mapObj = getMapObjByName("overview");
+	var pointMin = mapObj.convertRealToPixel(new Point(minX, maxY)); 
+	var pointMax = mapObj.convertRealToPixel(new Point(maxX, minY)); 
+	var px1 = pointMin.x;
+	var py1 = pointMin.y;
+	var px2 = pointMax.x;
+	var py2 = pointMax.y;
+
+	mb_isBF = "overview";
+	mb_zF = mod_overview_target;
+	
+	while((px2 - px1) < 8){
+		px1 -= 1;
+		px2 += 1;
+	}
+	while((py2 - py1) < 8){
+		py1 -= 1;
+		py2 += 1;
+	}
+	
+	if(px1 < 0){px1 = 1;}
+	if(px1 > mod_overview_width){px1 = mod_overview_width-1;}
+
+	if(py1 < 0){py1 = 1;}
+	if(py1 > mod_overview_height){py1 = mod_overview_height-1;}
+
+	if(px2 > mod_overview_width){px2 = mod_overview_width-1;}
+	if(px2 < 0){px2 = 1;}
+
+	if(py2 > mod_overview_height){py2 = mod_overview_height-1;}
+	if(py2 < 0){py2 = 1;}
+
+	mb_drawBox(px1,py1,px2,py2);
+});
+
+

Modified: branches/print_dev/http/javascripts/requestGeometryConstructor.js
===================================================================
--- branches/print_dev/http/javascripts/requestGeometryConstructor.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/requestGeometryConstructor.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,228 +1,228 @@
-/* 
-* $Id: requestGeometryConstructor.js 1882 2007-12-03 09:01:24Z verenadiewald $
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
-//http://www.mapbender.org/index.php/requestGeometryConstructor.js
-
-/**
- * @class A class representing a constructor for a geometry/WFS request.
- *
- * @constructor
- * @param {String} geomType type of the {@link RequestGeometryConstructor}
- * @param {String} geomType target of the {@link RequestGeometryConstructor}
- */
- function RequestGeometryConstructor(geomTarget){
- 	/**
- 	 * geomTarget target of the {@link RequestGeometryConstructor}
-	 *
-	 * @type String
-	 */
-
-	this.geomTarget = geomTarget;
-
-	var ind = getMapObjIndexByName(this.geomTarget);
-	var myMapObj = mb_mapObj[ind];		
-	var map_el = myMapObj.getDomElement();
-	if(!map_el.ownerDocument.getElementById(myMapObj.elementName+"_measuring")){
-		//create Box Elements
-		var el_top = map_el.ownerDocument.createElement("div");
-		el_top.style.position = "absolute";
-		el_top.style.top = "0px";
-		el_top.style.left = "0px";
-		el_top.style.zIndex = "16";
-		el_top.style.fontSize = "10px";
-		el_top.id = myMapObj.elementName+"_measuring";
-		map_el.appendChild(el_top);
-	}
-	
-	if(!map_el.ownerDocument.getElementById(myMapObj.elementName+"_measure_display")){
-		//create Box Elements
-		var el_top = map_el.ownerDocument.createElement("div");
-		el_top.style.position = "absolute";
-		el_top.style.top = "0px";
-		el_top.style.left = "0px";
-		el_top.style.zIndex = "17";
-		el_top.id = myMapObj.elementName+"_measure_display";
-		map_el.appendChild(el_top);
-	}
-
-	
-	this.getGeometry = function(queryType,callbackFunction){
-		var target = this.geomTarget;
-		s = new Snapping(this.geomTarget);
-		callback = callbackFunction;
-		
-		var ind = getMapObjIndexByName(target);
-		var el = mb_mapObj[ind].getDomElement();
-	   	el.onmouseover = null;
-	   	el.onmousedown = null;
-	   	el.onmouseup = null;
-	   	el.onmousemove = null;
-	
-		if (queryType == "point") {
-			queryGeom = new Geometry(geomType.point);
-			el.onmousedown = function (e) {
-				realWorldPos = mapToReal(target,myMapObj.getMousePosition(e));
-				queryGeom.addPoint(realWorldPos);
-				callback(target, queryGeom);
-				el.onmouseover = null;
-	   			el.onmousedown = null;
-	   			el.onmouseup = null;
-	   			el.onmousemove = null;
-				queryGeom = null;
-		   	};
-		}
-		else if (queryType == "polygon") {
-			queryGeom = new Geometry(geomType.polygon);
-			el.onmousedown = wfsSpatialRequestStart;
-			el.onmousemove = wfsSpatialRequestRun;
-		}
-		else if (queryType == "rectangle") {
-			queryGeom = new Geometry(geomType.line);
-			el.onmouseover = selAreaExtInit;
-			el.onmousedown = mod_box_start;
-		   	el.onmouseup = selAreaExtGet;
-		   	el.onmousemove = mod_box_run;
-		}
-		else if (queryType == "extent") {
-			queryGeom = new Geometry(geomType.line);
-			var ind = getMapObjIndexByName(target);
-			var p0 = mapToReal(target, new Point(0,0));
-			var p1 = mapToReal(target, new Point(mb_mapObj[ind].width,mb_mapObj[ind].height)); 
-			queryGeom.addPoint(p0);
-			queryGeom.addPoint(p1);
-			callback(target, queryGeom);
-			el.onmouseover = null;
-   			el.onmousedown = null;
-   			el.onmouseup = null;
-   			el.onmousemove = null;
-			queryGeom = null;
-		}
-		
-	}
-	
-	var s;
-	var callback;
-	
-	var wfsSpatialRequestStart = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-		var realWorldPos;
-		if (s.isSnapped() == true) {
-			realWorldPos = s.getSnappedPoint(); 
-			s.clean();
-		}
-		else {
-			realWorldPos = mapToReal(that.geomTarget,myMapObj.getMousePosition(e));
-		}
-		queryGeom.addPoint(realWorldPos);
-	
-		if (queryGeom.count() == 1) {
-			s.add(queryGeom.get(0));
-		}
-		if (s.isSnapped() && queryGeom.count() >= 3 && queryGeom.get(-1).equals(queryGeom.get(0))) {
-			queryGeom.close();
-			callback(that.geomTarget,queryGeom);
-			writeTag(myMapObj.frameName, myMapObj.elementName+"_measuring", "");
-			writeTag(myMapObj.frameName, myMapObj.elementName+"_measure_display", "");
-			var ind = getMapObjIndexByName("mapframe1");
-			var el = mb_mapObj[ind].getDomElement();
-			el.onmouseover = null;
-   			el.onmousedown = null;
-   			el.onmouseup = null;
-   			el.onmousemove = null;
-			queryGeom = null;
-			return;
-		}
-		drawDashedLineExt();	
-	}
-	
-	var wfsSpatialRequestRun = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-		if (queryGeom.count() >= 3) {
-			var pos = myMapObj.getMousePosition(e);
-			s.check(pos);
-		}
-	}
-	
-	var drawDashedLineExt = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-		var ind = getMapObjIndexByName(that.geomTarget);
-		var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mb_mapObj[ind].width+"' height='0'></div>";
-		str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mb_mapObj[ind].height+"'></div>";
-		if (queryGeom != null) {
-			for(var i=0; i<queryGeom.count(); i++){
-				var pos = realToMap(that.geomTarget,queryGeom.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(queryGeom.count()>1){
-				for(var k=1; k<queryGeom.count(); k++){
-					var pos0 = realToMap(that.geomTarget,queryGeom.get(k));
-					var pos1 = realToMap(that.geomTarget,queryGeom.get(k-1));
-					str_mPoints += evaluateDashesExt(pos1,pos0,k);
-				}
-			}
-		}
-		writeTag(myMapObj.frameName, myMapObj.elementName+"_measuring", str_mPoints);
-	}
-	
-	var evaluateDashesExt = function(p1,p0,count){
-		this.geomTarget = geomTarget;
-		var that = this;
-		var ind = getMapObjIndexByName(that.geomTarget);
-		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 <= mb_mapObj[ind].width && currPoint.y >= 0 && currPoint.y <= mb_mapObj[ind].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;
-	}
-	
-	var selAreaExtInit = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-   		mb_isBF = that.geomTarget;
-   		mb_zF = that.geomTarget;
-	}
-	
-	var selAreaExtGet = function(e){
-		this.geomTarget = geomTarget;
-		var that = this;
-		selAreaExtSetValidClipping(mod_box_stop(e));
-		mb_isBF = that.geomTarget;
-		mb_zF = that.geomTarget;
-	}
-	
-	var selAreaExtSetValidClipping = function(coords){
-		this.geomTarget = geomTarget;
-		var that = this;
-		if (queryGeom != null) {
-			queryGeom.addPoint(new Point(coords[0],coords[1]));
-			queryGeom.addPoint(new Point(coords[2],coords[3]));
-			
-			if(queryGeom.count() == 2){
-				callback(that.geomTarget,queryGeom);
-				var ind = getMapObjIndexByName("mapframe1");
-				var el = mb_mapObj[ind].getDomElement();
-				el.onmouseover = null;
-	   			el.onmousedown = null;
-	   			el.onmouseup = null;
-	   			el.onmousemove = null;
-				queryGeom = null;
-			}
-			else{
-				callback(that.geomTarget,queryGeom);
-			}
-		}
-	}	
-}
-
-
+/* 
+* $Id: requestGeometryConstructor.js 1882 2007-12-03 09:01:24Z verenadiewald $
+* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
+* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
+*/
+//http://www.mapbender.org/index.php/requestGeometryConstructor.js
+
+/**
+ * @class A class representing a constructor for a geometry/WFS request.
+ *
+ * @constructor
+ * @param {String} geomType type of the {@link RequestGeometryConstructor}
+ * @param {String} geomType target of the {@link RequestGeometryConstructor}
+ */
+ function RequestGeometryConstructor(geomTarget){
+ 	/**
+ 	 * geomTarget target of the {@link RequestGeometryConstructor}
+	 *
+	 * @type String
+	 */
+
+	this.geomTarget = geomTarget;
+
+	var ind = getMapObjIndexByName(this.geomTarget);
+	var myMapObj = mb_mapObj[ind];		
+	var map_el = myMapObj.getDomElement();
+	if(!map_el.ownerDocument.getElementById(myMapObj.elementName+"_measuring")){
+		//create Box Elements
+		var el_top = map_el.ownerDocument.createElement("div");
+		el_top.style.position = "absolute";
+		el_top.style.top = "0px";
+		el_top.style.left = "0px";
+		el_top.style.zIndex = "16";
+		el_top.style.fontSize = "10px";
+		el_top.id = myMapObj.elementName+"_measuring";
+		map_el.appendChild(el_top);
+	}
+	
+	if(!map_el.ownerDocument.getElementById(myMapObj.elementName+"_measure_display")){
+		//create Box Elements
+		var el_top = map_el.ownerDocument.createElement("div");
+		el_top.style.position = "absolute";
+		el_top.style.top = "0px";
+		el_top.style.left = "0px";
+		el_top.style.zIndex = "17";
+		el_top.id = myMapObj.elementName+"_measure_display";
+		map_el.appendChild(el_top);
+	}
+
+	
+	this.getGeometry = function(queryType,callbackFunction){
+		var target = this.geomTarget;
+		s = new Snapping(this.geomTarget);
+		callback = callbackFunction;
+		
+		var ind = getMapObjIndexByName(target);
+		var el = mb_mapObj[ind].getDomElement();
+	   	el.onmouseover = null;
+	   	el.onmousedown = null;
+	   	el.onmouseup = null;
+	   	el.onmousemove = null;
+	
+		if (queryType == "point") {
+			queryGeom = new Geometry(geomType.point);
+			el.onmousedown = function (e) {
+				realWorldPos = mapToReal(target,myMapObj.getMousePosition(e));
+				queryGeom.addPoint(realWorldPos);
+				callback(target, queryGeom);
+				el.onmouseover = null;
+	   			el.onmousedown = null;
+	   			el.onmouseup = null;
+	   			el.onmousemove = null;
+				queryGeom = null;
+		   	};
+		}
+		else if (queryType == "polygon") {
+			queryGeom = new Geometry(geomType.polygon);
+			el.onmousedown = wfsSpatialRequestStart;
+			el.onmousemove = wfsSpatialRequestRun;
+		}
+		else if (queryType == "rectangle") {
+			queryGeom = new Geometry(geomType.line);
+			el.onmouseover = selAreaExtInit;
+			el.onmousedown = mod_box_start;
+		   	el.onmouseup = selAreaExtGet;
+		   	el.onmousemove = mod_box_run;
+		}
+		else if (queryType == "extent") {
+			queryGeom = new Geometry(geomType.line);
+			var ind = getMapObjIndexByName(target);
+			var p0 = mapToReal(target, new Point(0,0));
+			var p1 = mapToReal(target, new Point(mb_mapObj[ind].width,mb_mapObj[ind].height)); 
+			queryGeom.addPoint(p0);
+			queryGeom.addPoint(p1);
+			callback(target, queryGeom);
+			el.onmouseover = null;
+   			el.onmousedown = null;
+   			el.onmouseup = null;
+   			el.onmousemove = null;
+			queryGeom = null;
+		}
+		
+	}
+	
+	var s;
+	var callback;
+	
+	var wfsSpatialRequestStart = function(e){
+		this.geomTarget = geomTarget;
+		var that = this;
+		var realWorldPos;
+		if (s.isSnapped() == true) {
+			realWorldPos = s.getSnappedPoint(); 
+			s.clean();
+		}
+		else {
+			realWorldPos = mapToReal(that.geomTarget,myMapObj.getMousePosition(e));
+		}
+		queryGeom.addPoint(realWorldPos);
+	
+		if (queryGeom.count() == 1) {
+			s.add(queryGeom.get(0));
+		}
+		if (s.isSnapped() && queryGeom.count() >= 3 && queryGeom.get(-1).equals(queryGeom.get(0))) {
+			queryGeom.close();
+			callback(that.geomTarget,queryGeom);
+			writeTag(myMapObj.frameName, myMapObj.elementName+"_measuring", "");
+			writeTag(myMapObj.frameName, myMapObj.elementName+"_measure_display", "");
+			var ind = getMapObjIndexByName("mapframe1");
+			var el = mb_mapObj[ind].getDomElement();
+			el.onmouseover = null;
+   			el.onmousedown = null;
+   			el.onmouseup = null;
+   			el.onmousemove = null;
+			queryGeom = null;
+			return;
+		}
+		drawDashedLineExt();	
+	}
+	
+	var wfsSpatialRequestRun = function(e){
+		this.geomTarget = geomTarget;
+		var that = this;
+		if (queryGeom.count() >= 3) {
+			var pos = myMapObj.getMousePosition(e);
+			s.check(pos);
+		}
+	}
+	
+	var drawDashedLineExt = function(e){
+		this.geomTarget = geomTarget;
+		var that = this;
+		var ind = getMapObjIndexByName(that.geomTarget);
+		var str_mPoints = "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='"+mb_mapObj[ind].width+"' height='0'></div>";
+		str_mPoints += "<div style='position:absolute;left:0px;top:0px' ><img src='"+mb_trans.src+"' width='0' height='"+mb_mapObj[ind].height+"'></div>";
+		if (queryGeom != null) {
+			for(var i=0; i<queryGeom.count(); i++){
+				var pos = realToMap(that.geomTarget,queryGeom.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(queryGeom.count()>1){
+				for(var k=1; k<queryGeom.count(); k++){
+					var pos0 = realToMap(that.geomTarget,queryGeom.get(k));
+					var pos1 = realToMap(that.geomTarget,queryGeom.get(k-1));
+					str_mPoints += evaluateDashesExt(pos1,pos0,k);
+				}
+			}
+		}
+		writeTag(myMapObj.frameName, myMapObj.elementName+"_measuring", str_mPoints);
+	}
+	
+	var evaluateDashesExt = function(p1,p0,count){
+		this.geomTarget = geomTarget;
+		var that = this;
+		var ind = getMapObjIndexByName(that.geomTarget);
+		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 <= mb_mapObj[ind].width && currPoint.y >= 0 && currPoint.y <= mb_mapObj[ind].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;
+	}
+	
+	var selAreaExtInit = function(e){
+		this.geomTarget = geomTarget;
+		var that = this;
+   		mb_isBF = that.geomTarget;
+   		mb_zF = that.geomTarget;
+	}
+	
+	var selAreaExtGet = function(e){
+		this.geomTarget = geomTarget;
+		var that = this;
+		selAreaExtSetValidClipping(mod_box_stop(e));
+		mb_isBF = that.geomTarget;
+		mb_zF = that.geomTarget;
+	}
+	
+	var selAreaExtSetValidClipping = function(coords){
+		this.geomTarget = geomTarget;
+		var that = this;
+		if (queryGeom != null) {
+			queryGeom.addPoint(new Point(coords[0],coords[1]));
+			queryGeom.addPoint(new Point(coords[2],coords[3]));
+			
+			if(queryGeom.count() == 2){
+				callback(that.geomTarget,queryGeom);
+				var ind = getMapObjIndexByName("mapframe1");
+				var el = mb_mapObj[ind].getDomElement();
+				el.onmouseover = null;
+	   			el.onmousedown = null;
+	   			el.onmouseup = null;
+	   			el.onmousemove = null;
+				queryGeom = null;
+			}
+			else{
+				callback(that.geomTarget,queryGeom);
+			}
+		}
+	}	
+}
+
+

Modified: branches/print_dev/http/javascripts/wfs_obj.js
===================================================================
--- branches/print_dev/http/javascripts/wfs_obj.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/javascripts/wfs_obj.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,75 +1,75 @@
-//$Id$
-//$Header: /cvsroot/mapbender/mapbender/http/javascripts/wfs_obj.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
-//global variables
-var wfs = [];
-var wfs_featuretype_count = 0;
-var wfs_element_count = 0;
-//list of all wms-objects
-function add_wfs(
-			wfs_id,
-			wfs_version,
-			wfs_title,
-			wfs_abstract,
-			wfs_getcapabilities,
-			wfs_describefeaturetype){
-					wfs[wfs.length] = new wfs_const( 
-					wfs_id,
-			      wfs_version,
-			      wfs_title,
-			      wfs_abstract,
-			      wfs_getcapabilities,
-			      wfs_describefeaturetype);
-					//wfs_featuretype[wfs.length - 1] = [];
-}
-//the wms constructor
-function wfs_const(  
-			wfs_id,
-			wfs_version,
-			wfs_title,
-			wfs_abstract,
-			wfs_getcapabilities,
-			wfs_describefeaturetype){
-   
-	this.wfs_id = wfs_id;
-	this.wfs_version = wfs_version;
-	this.wfs_title = wfs_title;
-	this.wfs_abstract = wfs_abstract;
-	this.wfs_getcapabilities = wfs_getcapabilities;
-	this.wfs_describefeaturetype = wfs_describefeaturetype;
-
-	this.wfs_featuretype = [];
-   //alert(wfs_id + " , " +wfs_title + " , " +wfs_abstract + " , " +wfs_getcapabilities + " , " +wfs_describefeaturetype);
-}
-//featuretype
-function wfs_add_featuretype(
-			featuretype_name,
-			featuretype_title,
-			featuretype_srs,
-			featuretype_geomtype){
-                      
-	      wfs[wfs.length-1].wfs_featuretype[wfs[wfs.length-1].wfs_featuretype.length] = new featuretype(
-											featuretype_name,
-											featuretype_title,
-											featuretype_srs,
-											featuretype_geomtype);
-//alert(featuretype_name + " , " +featuretype_title + " , " +featuretype_srs + " , " +featuretype_geomtype);
-}
-function featuretype(
-			featuretype_name,
-			featuretype_title,
-			featuretype_srs,
-			featuretype_geomtype){
-	this.featuretype_name = featuretype_name;
-	this.featuretype_title = featuretype_title;
-	this.featuretype_srs = featuretype_srs;
-	this.featuretype_geomtype = featuretype_geomtype;
-	this.element = [];
-	wfs_featuretype_count++; 
-}
-//elements
-function wfs_add_featuretype_element(element_name, element_type, element_count, featuretype_count){
-	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count] = [];
-	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count].name = element_name;
-	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count].type = element_type;
-   //alert(element_name +" , "+element_type);
-}
+//$Id$
+//$Header: /cvsroot/mapbender/mapbender/http/javascripts/wfs_obj.js,v 1.3 2005/09/13 14:38:11 bjoern_heuser Exp $
+//global variables
+var wfs = [];
+var wfs_featuretype_count = 0;
+var wfs_element_count = 0;
+//list of all wms-objects
+function add_wfs(
+			wfs_id,
+			wfs_version,
+			wfs_title,
+			wfs_abstract,
+			wfs_getcapabilities,
+			wfs_describefeaturetype){
+					wfs[wfs.length] = new wfs_const( 
+					wfs_id,
+			      wfs_version,
+			      wfs_title,
+			      wfs_abstract,
+			      wfs_getcapabilities,
+			      wfs_describefeaturetype);
+					//wfs_featuretype[wfs.length - 1] = [];
+}
+//the wms constructor
+function wfs_const(  
+			wfs_id,
+			wfs_version,
+			wfs_title,
+			wfs_abstract,
+			wfs_getcapabilities,
+			wfs_describefeaturetype){
+   
+	this.wfs_id = wfs_id;
+	this.wfs_version = wfs_version;
+	this.wfs_title = wfs_title;
+	this.wfs_abstract = wfs_abstract;
+	this.wfs_getcapabilities = wfs_getcapabilities;
+	this.wfs_describefeaturetype = wfs_describefeaturetype;
+
+	this.wfs_featuretype = [];
+   //alert(wfs_id + " , " +wfs_title + " , " +wfs_abstract + " , " +wfs_getcapabilities + " , " +wfs_describefeaturetype);
+}
+//featuretype
+function wfs_add_featuretype(
+			featuretype_name,
+			featuretype_title,
+			featuretype_srs,
+			featuretype_geomtype){
+                      
+	      wfs[wfs.length-1].wfs_featuretype[wfs[wfs.length-1].wfs_featuretype.length] = new featuretype(
+											featuretype_name,
+											featuretype_title,
+											featuretype_srs,
+											featuretype_geomtype);
+//alert(featuretype_name + " , " +featuretype_title + " , " +featuretype_srs + " , " +featuretype_geomtype);
+}
+function featuretype(
+			featuretype_name,
+			featuretype_title,
+			featuretype_srs,
+			featuretype_geomtype){
+	this.featuretype_name = featuretype_name;
+	this.featuretype_title = featuretype_title;
+	this.featuretype_srs = featuretype_srs;
+	this.featuretype_geomtype = featuretype_geomtype;
+	this.element = [];
+	wfs_featuretype_count++; 
+}
+//elements
+function wfs_add_featuretype_element(element_name, element_type, element_count, featuretype_count){
+	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count] = [];
+	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count].name = element_name;
+	wfs[wfs.length-1].wfs_featuretype[featuretype_count].element[element_count].type = element_type;
+   //alert(element_name +" , "+element_type);
+}

Modified: branches/print_dev/http/php/createImageFromText.php
===================================================================
--- branches/print_dev/http/php/createImageFromText.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/createImageFromText.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,38 +1,38 @@
-<?php
-# $Id$
-# Modul Maintainer Christoph Baudson
-# http://www.mapbender.org/index.php/createImageFromText
-# 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.
-
-$text = $_GET["text"];
-$angle = intval($_GET["angle"]);
-
-$text_x = 4;
-$text_y = 0;
-$rect_w = 7 * mb_strlen($text) + $text_x;
-$rect_h = 14 + $text_y;
-
-$im = imagecreate($rect_w, $rect_h);
-$white = imagecolorallocate($im, 255, 255, 255);
-$black = imagecolorallocate($im, 0, 0, 0);
-imagestring($im, 2, $text_x, $text_y, $text, $black);
-$im = imagerotate($im, $angle, -1);
-
-Header("Content-type:image/png");
-imagepng($im);
-imagedestroy($im);
-?>
+<?php
+# $Id$
+# Modul Maintainer Christoph Baudson
+# http://www.mapbender.org/index.php/createImageFromText
+# 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.
+
+$text = $_GET["text"];
+$angle = intval($_GET["angle"]);
+
+$text_x = 4;
+$text_y = 0;
+$rect_w = 7 * mb_strlen($text) + $text_x;
+$rect_h = 14 + $text_y;
+
+$im = imagecreate($rect_w, $rect_h);
+$white = imagecolorallocate($im, 255, 255, 255);
+$black = imagecolorallocate($im, 0, 0, 0);
+imagestring($im, 2, $text_x, $text_y, $text, $black);
+$im = imagerotate($im, $angle, -1);
+
+Header("Content-type:image/png");
+imagepng($im);
+imagedestroy($im);
+?>

Modified: branches/print_dev/http/php/mb_listGUIs.php
===================================================================
--- branches/print_dev/http/php/mb_listGUIs.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mb_listGUIs.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -21,7 +21,7 @@
 	if(count($arrayGUIs) === 0) {
 		echo "<h1>Error</h1>";
 		echo "<p>There are no GUIs available for this user.</p>";
-		printf("<p><a href=\"../php/mod_logout.php?%s\"><img src=\"../img/button_gray/logout_off.png\" onmouseover=\"this.src='../img/button_gray/logout_over.png'\" onmouseout=\"this.src='../img/button_gray/logout_off.png'\" alt=\"Logout\" title=\"Logout\"></a></p>",SID);
+		printf("<p><a href=\"../php/mod_logout.php?%s\"><img src=\"../img/button_gray/logout_off.png\" onmouseover=\"this.src='../img/button_gray/logout_over.png'\" onmouseout=\"this.src='../img/button_gray/logout_off.png'\" title=\"Logout\"></a></p>",SID);
 		
 		return;
 	}
@@ -29,13 +29,12 @@
 	$v = array();
 	$t = array();
 
-	$sql  = "SELECT DISTINCT gui_id,gui_name,gui_description, ggc.*,gc.category_name,gc.category_description, gc.category_id ";
+	$sql  = "SELECT DISTINCT gui_id,gui_name,gui_description, ggc.*,gc.category_name,gc.category_description ";
 	$sql .= "FROM gui g ";
 	$sql .= "LEFT JOIN gui_gui_category ggc ON g.gui_id = ggc.fkey_gui_id ";
 	$sql .= "LEFT JOIN gui_category gc ON (ggc.fkey_gui_category_id = gc.category_id) ";
 	$sql .= "WHERE gui_id IN (";
 
-
 	for($i = 0; $i < count($arrayGUIs); $i++) {
 		if($i > 0) {
 			$sql .= ",";
@@ -46,66 +45,41 @@
 		array_push($v,$arrayGUIs[$i]);
 		array_push($t,'s');
 	}
-
-	$sql .= ") ORDER BY gc.category_id, gui_name";
-
- 	$result = db_prep_query($sql,$v,$t);
 	
+	$sql .= ") ORDER BY gc.category_name, gui_name";
+		
+	$result = db_prep_query($sql,$v,$t);
+	
 	$category = NULL;
-
-	echo "<h1 class='listGuisHeader'>Available application(s)</h1>\n";
-	printf("<p class='logoutButton'><a href=\"../php/mod_logout.php?%s\"><img src=\"../img/button_gray/logout_off.png\" onmouseover=\"this.src='../img/button_gray/logout_over.png'\" onmouseout=\"this.src='../img/button_gray/logout_off.png'\" title=\"Logout\" alt=\"Logout\" /></a></p>\n",SID);
-
-	echo "<div id='menu'>\n";
-	echo "<ul class=\"gui_list\">\n";
-
-
-  $num =  pg_numrows($result);
- 
-  for ($j=0; $j<$num; $j++){
-     
-    $row = pg_fetch_array ($result, $j);  	
-     if($category !== $row["category_name"]) {
-  			$category = $row["category_name"];
-        			
-  			if(strlen($row["category_name"]) > 0) {		  
-  			
-          printf("\t<li class=\"gui_category\" id=\"%s\"><h2>%s</h2>",$row["category_name"],$row["category_name"]);			  
-        }
-        else {
-        	//$category="NULL";	  
-          printf("\t<li class=\"gui_category\" ><h2>GUI(s) without category</h2>");			  
-        }
-        
-  			if(strlen($row["category_description"]) > 0) {
-  				printf("<label for=\"%s\" class=\"gui_category_description\">%s</label>\n",$row["category_name"],$row["category_description"]);
-  			  
-          echo "\t\t<ul>\n";
-        }
-        else {
-  			  echo "\n\t\t<ul>\n";		
-  		  } 
-  		}
-  		
-  		$url = sprintf("index.php?%s&amp;gui_id=%s",strip_tags(SID),$row["gui_id"]);
-  		if(($j % 2) == 0){$class= "class='alternate' ";}
-  		else {$class="class='normal'";}
-      //printf("\t\t<li id=\"%s\" %s onclick=\"location.href='%s'\" ><a href=\"%s\">%s</a><label for=\"%s\">%s</label></li>\n",$row["gui_name"],$class,$url,$url,$row["gui_name"],$row["gui_name"],$row["gui_description"]);
-     
-      printf("\t\t<li id=\"%s\" %s onclick=\"location.href='%s'\" ><a href=\"%s\">%s</a> \n\t\t\t <ul><li>%s</li></ul></li>\n",$row["gui_name"],$class,$url,$url,$row["gui_name"],$row["gui_description"]);
-     
-     //checks next category or last category
-     $nextrow = pg_fetch_array ($result, $j+1); 
-     if(($category !== $nextrow["category_name"]) ||($num==$j+1)) {
-     echo "\t\t</ul>\n";
-     echo "\t</li>\n"; 
-     }
-   
-   
-          
-  }
-echo "</ul>\n";
-echo "</div>\n";
+echo "<h1><font align='left' color='#000000'>Ma</font><font color='#0000CE'>p</font><font color='#C00000'>b</font><font color='#000000'>ender </font> - "._mb('available Applications')."</h1>";
+	printf("<p><a href=\"../php/mod_logout.php?%s\"><img src=\"../img/button_gray/logout_off.png\" onmouseover=\"this.src='../img/button_gray/logout_over.png'\" onmouseout=\"this.src='../img/button_gray/logout_off.png'\" title=\"Logout\"></a></p>",SID);
+	
+	$total_guis = 0;
+	while($row = db_fetch_array($result)){
+		if($category !== $row["category_name"]) {
+			$category = $row["category_name"];
+			
+			echo "</ul>";
+			
+			if(strlen($row["category_name"]) > 0) {
+				printf("<h2 class=\"gui_category\">%s</h2>",$row["category_name"]);
+			}else{
+				printf("<h2 class=\"gui_category\">%s</h2>","");
+			}
+			if(strlen($row["category_description"]) > 0) {
+				printf("<p class=\"gui_category_description\"><em>%s</em></p>",$row["category_description"]);
+			}else{
+				printf("<p class=\"gui_category_description\"><em>%s</em></p>","");
+			}
+			
+			echo "<ul class=\"gui_list\">";
+		}
+		
+		$class = ($total_guis %2 === 0) ? " class=\"alternate\"" : NULL;
+		$url   = sprintf("index.php?%s&gui_id=%s",strip_tags(SID),$row["gui_id"]);
+		printf("<li%s onclick=\"location.href='%s'\"><strong><a href=\"%s\">%s</a></strong><br /><em>%s</em></li>",$class,$url,$url,$row["gui_name"],$row["gui_description"]);
+		
+		$total_guis++;
+	}
 }
-
-?>
+?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_SelectKeyword.php
===================================================================
--- branches/print_dev/http/php/mod_SelectKeyword.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_SelectKeyword.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,61 +1,61 @@
-<?php
-# $Id$
-# ttp://www.mapbender.org/index.php/mod_SelectKeyword
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<html>
-<head>
-<title>Select Keyword</title>
+<?php
+# $Id$
+# ttp://www.mapbender.org/index.php/mod_SelectKeyword
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+<html>
+<head>
+<title>Select Keyword</title>
 <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.'">';	
-?>
-
-<script language='JavaScript'>
-<!--
+?>
+
+<script language='JavaScript'>
+<!--
 function insertValue(val){
-   window.opener.document.form1.search.value = val;
+   window.opener.document.form1.search.value = val;
    window.close();
-}
--->
-</script>
-</head>
-
-<body  >
-
-<?php
+}
+-->
+</script>
+</head>
+
+<body  >
+
+<?php
 $sql = "Select keyword_id, ltrim(keyword) as keyword from keyword order by upper(ltrim(keyword));";
 $res = db_query($sql);
-
-echo "<select size='20' name='keywordlist' ondblClick='insertValue(this.value)' title='double click to select a keyword'>\n";
- 
-$cnt = 0;
-while($row = db_fetch_array($res)){    
-	echo "<option value='". $row["keyword"]."' >";
+
+echo "<select size='20' name='keywordlist' ondblClick='insertValue(this.value)' title='double click to select a keyword'>\n";
+ 
+$cnt = 0;
+while($row = db_fetch_array($res)){    
+	echo "<option value='". $row["keyword"]."' >";
 	echo $row["keyword"];
-	$cnt++;
-	echo "</option>";
-}
-echo "</select>";
-
-?>
-</body>
+	$cnt++;
+	echo "</option>";
+}
+echo "</select>";
+
+?>
+</body>
 </html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_WMSpreferences.php
===================================================================
--- branches/print_dev/http/php/mod_WMSpreferences.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_WMSpreferences.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,64 +1,64 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Administration
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-?>
-<!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>WMS Preferences</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<STYLE TYPE="text/css">
-		<!--
-   body{
-   	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
-   	color:#0066cc;
-      font-size:10pt
-   }    
-   
-   table{
-   	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
-   	color:#808080;;
-      font-size:9pt
-   } 
-   
-   th{
-   	background-color:#F0F0F0;
-   }  
-   
-   select{
-		width:240px;
-   }    
-   
-	-->
-</STYLE>
-<?php
-echo '<script type="text/javascript">';
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/Administration
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+<!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>WMS Preferences</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<STYLE TYPE="text/css">
+		<!--
+   body{
+   	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+   	color:#0066cc;
+      font-size:10pt
+   }    
+   
+   table{
+   	font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
+   	color:#808080;;
+      font-size:9pt
+   } 
+   
+   th{
+   	background-color:#F0F0F0;
+   }  
+   
+   select{
+		width:240px;
+   }    
+   
+	-->
+</STYLE>
+<?php
+echo '<script type="text/javascript">';
 $sql = "SELECT * FROM gui_element WHERE e_id = 'WMS_preferences' AND fkey_gui_id = $1";
 $v = array($_SESSION["mb_user_gui"]);
 $t = array("s");
@@ -73,215 +73,215 @@
 }
 if($cnt > 1){ echo "alert('WMS_preferences: ID not unique!');";}
 $e_target = explode(",", $e_target);
-echo "var mod_WMSpreferences_target1 = '".trim($e_target[0])."';";
-echo "var mod_WMSpreferences_target2 = '".trim($e_target[1])."';";
-echo "</script>";
-
-$sql_visible = "SELECT * FROM gui_wms WHERE fkey_gui_id = $1";
-$v = array($_SESSION["mb_user_gui"]);
-$t = array("s"); 
-$res_visible = db_prep_query($sql_visible, $v, $t); 
-$cnt_visible = 0; 
-
-while($row = db_fetch_array($res_visible)){
-	$gui_wms_visible[$cnt_visible] = $row["gui_wms_visible"];
-	$fkey_wms_id_visible[$cnt_visible] = $row["fkey_wms_id"];
-	if($cnt_visible>0){
-		$vis .= ",";
-		$wmsid .= ",";		
-	}
-	$vis .= $gui_wms_visible[$cnt_visible];
-	$wmsid .= $fkey_wms_id_visible[$cnt_visible];
-	$cnt_visible++;
-}
-
-echo '<script type="text/javascript">';
-echo "var mod_gui_wms_visible = '".$vis."';";
-echo "var mod_fkey_wms_id_visible = '".$wmsid."';";
-echo "</script>";
-?>
-
-<script type="text/javascript">
-<!--
-var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);
-var my = window.opener.mb_mapObj[ind];
-
+echo "var mod_WMSpreferences_target1 = '".trim($e_target[0])."';";
+echo "var mod_WMSpreferences_target2 = '".trim($e_target[1])."';";
+echo "</script>";
+
+$sql_visible = "SELECT * FROM gui_wms WHERE fkey_gui_id = $1";
+$v = array($_SESSION["mb_user_gui"]);
+$t = array("s"); 
+$res_visible = db_prep_query($sql_visible, $v, $t); 
+$cnt_visible = 0; 
+
+while($row = db_fetch_array($res_visible)){
+	$gui_wms_visible[$cnt_visible] = $row["gui_wms_visible"];
+	$fkey_wms_id_visible[$cnt_visible] = $row["fkey_wms_id"];
+	if($cnt_visible>0){
+		$vis .= ",";
+		$wmsid .= ",";		
+	}
+	$vis .= $gui_wms_visible[$cnt_visible];
+	$wmsid .= $fkey_wms_id_visible[$cnt_visible];
+	$cnt_visible++;
+}
+
+echo '<script type="text/javascript">';
+echo "var mod_gui_wms_visible = '".$vis."';";
+echo "var mod_fkey_wms_id_visible = '".$wmsid."';";
+echo "</script>";
+?>
+
+<script type="text/javascript">
+<!--
+var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);
+var my = window.opener.mb_mapObj[ind];
+
  function mb_swapWmsByIndex(mapObj_ind, indexA, indexB) {
- 	var myMapObj = window.opener.mb_mapObj[mapObj_ind];
-	if (indexA != indexB && indexA >= 0 && indexA < myMapObj.wms.length && indexB >= 0 && indexB < myMapObj.wms.length) {
-		upper = myMapObj.wms[indexA];
-		myMapObj.wms[indexA] = myMapObj.wms[indexB];
-		myMapObj.wms[indexB] = upper;
-		var upperLayers = myMapObj.layers[indexA];
-		var upperStyles = myMapObj.styles[indexA];
-		var upperQuerylayers = myMapObj.querylayers[indexA];
-		myMapObj.layers[indexA] = myMapObj.layers[indexB];
-		myMapObj.styles[indexA] = myMapObj.styles[indexB];
-		myMapObj.querylayers[indexA] = myMapObj.querylayers[indexB];
-		myMapObj.layers[indexB] = upperLayers;
-		myMapObj.styles[indexB] = upperStyles;
-		myMapObj.querylayers[indexB] = upperQuerylayers;
-		return true;
-	}
-	else {
-		return false;
-	}
-}
-
- 
-
-// Opacity version
-
+ 	var myMapObj = window.opener.mb_mapObj[mapObj_ind];
+	if (indexA != indexB && indexA >= 0 && indexA < myMapObj.wms.length && indexB >= 0 && indexB < myMapObj.wms.length) {
+		upper = myMapObj.wms[indexA];
+		myMapObj.wms[indexA] = myMapObj.wms[indexB];
+		myMapObj.wms[indexB] = upper;
+		var upperLayers = myMapObj.layers[indexA];
+		var upperStyles = myMapObj.styles[indexA];
+		var upperQuerylayers = myMapObj.querylayers[indexA];
+		myMapObj.layers[indexA] = myMapObj.layers[indexB];
+		myMapObj.styles[indexA] = myMapObj.styles[indexB];
+		myMapObj.querylayers[indexA] = myMapObj.querylayers[indexB];
+		myMapObj.layers[indexB] = upperLayers;
+		myMapObj.styles[indexB] = upperStyles;
+		myMapObj.querylayers[indexB] = upperQuerylayers;
+		return true;
+	}
+	else {
+		return false;
+	}
+}
+
+ 
+
+// Opacity version
+
 function cambia_opacity(id,incremento){
 	opacity = my.wms[id].gui_wms_mapopacity*100 + parseInt(incremento);
 	my.wms[id].setOpacity(opacity);
 	loadWMS();
-}
-
-
-
-
-function setMapformat(val){
-	var tmp = val.split(",");
-	my.wms[tmp[0]].gui_wms_mapformat = tmp[1];
-	loadWMS();
-}
-
-function setFeatureformat(val){
-	var tmp = val.split(",");
-	my.wms[tmp[0]].gui_wms_featureinfoformat = tmp[1];
-	loadWMS();
-}
-
-function setExceptionformat(val){
-	var tmp = val.split(",");
-	my.wms[tmp[0]].gui_wms_exceptionformat = tmp[1];
-	loadWMS();
-}
-
-function swap(index1, index2){
-	if (mb_swapWmsByIndex(ind, index1, index2) == true) {
-		loadWMS();
-		window.opener.zoom(mod_WMSpreferences_target1, true, 1.0);
-		window.opener.mb_execloadWmsSubFunctions();
-	}
-}
-
-function remove_wms(num){
-	var cnt_vis=0;
-	var wms_visible_down = mod_gui_wms_visible.split(",");
-	var wms_vis_down = wms_visible_down.length;
-	
-	//check if there are more than two visible wms's
-	for(var i=0; i < wms_visible_down.length; i++){
-		var my_wms_visible = wms_visible_down[i];
-		if(my_wms_visible == 0){
-  			var cnt_vis = cnt_vis+1;		
-		}
-	}	
-
-	if(my.wms.length - cnt_vis>1){
-	  	var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);  
-  		window.opener.mb_mapObjremoveWMS(ind,num) 
-		window.opener.mb_execloadWmsSubFunctions();
-//  	window.opener.frames[mod_WMSpreferences_target2].document.location.reload();
-  		window.location.reload();
-	}
-	else{
-		alert ("Last WMS can't be removed.\n(Der letzte WMS kann nicht entfernt werden.)");
-	}	
-}
-
-function loadWMS(){
-	var str = "";
-	var wms_visible = mod_gui_wms_visible.split(",");
-	var wms_id_visible = mod_fkey_wms_id_visible.split(",");
-	var visibleWmsIndexArray = new Array();
-	
-	for(var i=0; i < my.wms.length; i++){
-		var found = false;
-		for(var j=0; j < wms_id_visible.length; j++){
-			if (wms_visible[j] == 1 && wms_id_visible[j] == my.wms[i].wms_id){
-				visibleWmsIndexArray[visibleWmsIndexArray.length] = i;
-				found = true;
-			}
-		}
-		if (found == false && my.wms[i].gui_wms_visible == 1) {
-			visibleWmsIndexArray[visibleWmsIndexArray.length] = i;
-		}
-	}
-	
-	for (var i = 0 ; i < visibleWmsIndexArray.length ; i++) {
-		z = visibleWmsIndexArray[i];
-		var mapString = "";
-		var featureinfoString = "";
-		var exceptionString = "";
-				
-		for(var j=0; j<my.wms[z].data_type.length; j++){
-			if(my.wms[z].data_type[j] == 'map'){
-				mapString += "<option value='"+z+","+my.wms[z].data_format[j]+"'";
-				if(my.wms[z].data_format[j] == my.wms[z].gui_wms_mapformat){
-					mapString += "selected";
-				}
-				mapString += ">"+my.wms[z].data_format[j]+"</option>";
-			}
-			else if(my.wms[z].data_type[j] == 'featureinfo'){
-				featureinfoString += "<option value='"+z+","+my.wms[z].data_format[j]+"'";
-				if(my.wms[z].data_format[j] == my.wms[z].gui_wms_featureinfoformat){
-					featureinfoString += "selected";
-				}
-				featureinfoString += ">"+my.wms[z].data_format[j]+"</option>";
-			}
-			else if(my.wms[z].data_type[j] == 'exception'){
-				exceptionString += "<option value='"+z+","+my.wms[z].data_format[j]+"'";
-				if(my.wms[z].data_format[j] == my.wms[z].gui_wms_exceptionformat){
-					exceptionString += "selected";
-				}
-				exceptionString += ">"+my.wms[z].data_format[j]+"</option>";
-			}
-		}
-
-		str += "<table border='1' rules='rows'>";  
-		str += "<tr><th>";
-		str += "<img src='../img/button_gray/up.png' style='filter:Chroma(color=#C2CBCF);' onclick='swap("+visibleWmsIndexArray[i-1]+","+z+")' value='up' title='move WMS up'>&nbsp;";
-		str += "<img src='../img/button_gray/down.png' style='filter:Chroma(color=#C2CBCF);' onclick='swap("+z+", "+visibleWmsIndexArray[i+1]+")'value='down'title='move WMS down'>&nbsp;</td>";
-		str += "<img src='../img/button_gray/del.png' onclick='remove_wms("+z+")' value='remove' title='remove WMS from GUI'>&nbsp;";	
-		str += "</th><th  width='300'><div id ='id_"+my.wms[z].wms_id+"' style='cursor:pointer' onmouseover = 'title=\""+"id:"+my.wms[z].wms_id+" "+my.wms[z].wms_abstract+"\"'><b>"+my.wms[z].wms_title+"</b>";
-		str += "</div></th></tr>";
-		//str += "<tr><td>ID:</td><td>"+my.wms[z].wms_id+"</td></tr>";
-		str += "<tr><td>MapImageFormat: </td><td>";
-		str += "<select onchange='setMapformat(this.value)'>"
-		str += mapString;
-		str += "</select></td></tr>";
-		str += "<tr><td>FeatureInfoFormat: </td><td>";
-		str += "<select onchange='setFeatureformat(this.value)'>";
-		str += featureinfoString;
-		str += "</select></td></tr>";
-		str += "<tr><td>ExceptionFormat: </td><td>";
-		str += "<select onchange='setExceptionformat(this.value)'>"
-		str += exceptionString;
-		str += "</select></td></tr></table>";	
-		str += "<table><tr>";
-
-		//opacity version
-		str += "<tr><td>Opacity:</td><td><input type=\"button\" onclick=\"cambia_opacity('"+visibleWmsIndexArray[i]+"','-10')\" value=\"-\">";
-		str += "<input id=\"valor_opacity_"+visibleWmsIndexArray[i]+"\" type=\"text\" disabled=\"disabled\" size=\"3\" value=\""+my.wms[visibleWmsIndexArray[i]].gui_wms_mapopacity*100+" %\">";
-		str += "<input type=\"button\" onclick=\"cambia_opacity('"+visibleWmsIndexArray[i]+"','+10')\" value=\"+\">";
-		str += "</td></tr>";
-
-		str += "</tr></table><br>";
-	}
-	
-	document.getElementById('data').innerHTML = str;
-}
-
-// -->
-</script>
-</head>
-<body onload='loadWMS()'>
-<div id='data'><div>
-<form>
-<input type='hidden' name='visibility' value=''>
-</form>
-</body>
-</html>
+}
+
+
+
+
+function setMapformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_mapformat = tmp[1];
+	loadWMS();
+}
+
+function setFeatureformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_featureinfoformat = tmp[1];
+	loadWMS();
+}
+
+function setExceptionformat(val){
+	var tmp = val.split(",");
+	my.wms[tmp[0]].gui_wms_exceptionformat = tmp[1];
+	loadWMS();
+}
+
+function swap(index1, index2){
+	if (mb_swapWmsByIndex(ind, index1, index2) == true) {
+		loadWMS();
+		window.opener.zoom(mod_WMSpreferences_target1, true, 1.0);
+		window.opener.mb_execloadWmsSubFunctions();
+	}
+}
+
+function remove_wms(num){
+	var cnt_vis=0;
+	var wms_visible_down = mod_gui_wms_visible.split(",");
+	var wms_vis_down = wms_visible_down.length;
+	
+	//check if there are more than two visible wms's
+	for(var i=0; i < wms_visible_down.length; i++){
+		var my_wms_visible = wms_visible_down[i];
+		if(my_wms_visible == 0){
+  			var cnt_vis = cnt_vis+1;		
+		}
+	}	
+
+	if(my.wms.length - cnt_vis>1){
+	  	var ind = window.opener.getMapObjIndexByName(mod_WMSpreferences_target1);  
+  		window.opener.mb_mapObjremoveWMS(ind,num) 
+		window.opener.mb_execloadWmsSubFunctions();
+//  	window.opener.frames[mod_WMSpreferences_target2].document.location.reload();
+  		window.location.reload();
+	}
+	else{
+		alert ("Last WMS can't be removed.\n(Der letzte WMS kann nicht entfernt werden.)");
+	}	
+}
+
+function loadWMS(){
+	var str = "";
+	var wms_visible = mod_gui_wms_visible.split(",");
+	var wms_id_visible = mod_fkey_wms_id_visible.split(",");
+	var visibleWmsIndexArray = new Array();
+	
+	for(var i=0; i < my.wms.length; i++){
+		var found = false;
+		for(var j=0; j < wms_id_visible.length; j++){
+			if (wms_visible[j] == 1 && wms_id_visible[j] == my.wms[i].wms_id){
+				visibleWmsIndexArray[visibleWmsIndexArray.length] = i;
+				found = true;
+			}
+		}
+		if (found == false && my.wms[i].gui_wms_visible == 1) {
+			visibleWmsIndexArray[visibleWmsIndexArray.length] = i;
+		}
+	}
+	
+	for (var i = 0 ; i < visibleWmsIndexArray.length ; i++) {
+		z = visibleWmsIndexArray[i];
+		var mapString = "";
+		var featureinfoString = "";
+		var exceptionString = "";
+				
+		for(var j=0; j<my.wms[z].data_type.length; j++){
+			if(my.wms[z].data_type[j] == 'map'){
+				mapString += "<option value='"+z+","+my.wms[z].data_format[j]+"'";
+				if(my.wms[z].data_format[j] == my.wms[z].gui_wms_mapformat){
+					mapString += "selected";
+				}
+				mapString += ">"+my.wms[z].data_format[j]+"</option>";
+			}
+			else if(my.wms[z].data_type[j] == 'featureinfo'){
+				featureinfoString += "<option value='"+z+","+my.wms[z].data_format[j]+"'";
+				if(my.wms[z].data_format[j] == my.wms[z].gui_wms_featureinfoformat){
+					featureinfoString += "selected";
+				}
+				featureinfoString += ">"+my.wms[z].data_format[j]+"</option>";
+			}
+			else if(my.wms[z].data_type[j] == 'exception'){
+				exceptionString += "<option value='"+z+","+my.wms[z].data_format[j]+"'";
+				if(my.wms[z].data_format[j] == my.wms[z].gui_wms_exceptionformat){
+					exceptionString += "selected";
+				}
+				exceptionString += ">"+my.wms[z].data_format[j]+"</option>";
+			}
+		}
+
+		str += "<table border='1' rules='rows'>";  
+		str += "<tr><th>";
+		str += "<img src='../img/button_gray/up.png' style='filter:Chroma(color=#C2CBCF);' onclick='swap("+visibleWmsIndexArray[i-1]+","+z+")' value='up' title='move WMS up'>&nbsp;";
+		str += "<img src='../img/button_gray/down.png' style='filter:Chroma(color=#C2CBCF);' onclick='swap("+z+", "+visibleWmsIndexArray[i+1]+")'value='down'title='move WMS down'>&nbsp;</td>";
+		str += "<img src='../img/button_gray/del.png' onclick='remove_wms("+z+")' value='remove' title='remove WMS from GUI'>&nbsp;";	
+		str += "</th><th  width='300'><div id ='id_"+my.wms[z].wms_id+"' style='cursor:pointer' onmouseover = 'title=\""+"id:"+my.wms[z].wms_id+" "+my.wms[z].wms_abstract+"\"'><b>"+my.wms[z].wms_title+"</b>";
+		str += "</div></th></tr>";
+		//str += "<tr><td>ID:</td><td>"+my.wms[z].wms_id+"</td></tr>";
+		str += "<tr><td>MapImageFormat: </td><td>";
+		str += "<select onchange='setMapformat(this.value)'>"
+		str += mapString;
+		str += "</select></td></tr>";
+		str += "<tr><td>FeatureInfoFormat: </td><td>";
+		str += "<select onchange='setFeatureformat(this.value)'>";
+		str += featureinfoString;
+		str += "</select></td></tr>";
+		str += "<tr><td>ExceptionFormat: </td><td>";
+		str += "<select onchange='setExceptionformat(this.value)'>"
+		str += exceptionString;
+		str += "</select></td></tr></table>";	
+		str += "<table><tr>";
+
+		//opacity version
+		str += "<tr><td>Opacity:</td><td><input type=\"button\" onclick=\"cambia_opacity('"+visibleWmsIndexArray[i]+"','-10')\" value=\"-\">";
+		str += "<input id=\"valor_opacity_"+visibleWmsIndexArray[i]+"\" type=\"text\" disabled=\"disabled\" size=\"3\" value=\""+my.wms[visibleWmsIndexArray[i]].gui_wms_mapopacity*100+" %\">";
+		str += "<input type=\"button\" onclick=\"cambia_opacity('"+visibleWmsIndexArray[i]+"','+10')\" value=\"+\">";
+		str += "</td></tr>";
+
+		str += "</tr></table><br>";
+	}
+	
+	document.getElementById('data').innerHTML = str;
+}
+
+// -->
+</script>
+</head>
+<body onload='loadWMS()'>
+<div id='data'><div>
+<form>
+<input type='hidden' name='visibility' value=''>
+</form>
+</body>
+</html>

Modified: branches/print_dev/http/php/mod_addWmsFromFeatureInfo.php
===================================================================
--- branches/print_dev/http/php/mod_addWmsFromFeatureInfo.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_addWmsFromFeatureInfo.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,108 +1,108 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/addWMSFromFeatureInfo.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.
-
-import_request_variables("PG");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-include(dirname(__FILE__).'/../include/dyn_js.php');
-
-echo "var mod_target = '".$e_target[0]."';";
-?>
-function mb_swapWmsByIndex(mapObj_ind, indexA, indexB) {
-	if (indexA != indexB && indexA >= 0 && indexA < mb_mapObj[mapObj_ind].wms.length && indexB >= 0 && indexB < mb_mapObj[mapObj_ind].wms.length) {
-		upper = mb_mapObj[mapObj_ind].wms[indexA];
-		mb_mapObj[mapObj_ind].wms[indexA] = mb_mapObj[mapObj_ind].wms[indexB];
-		mb_mapObj[mapObj_ind].wms[indexB] = upper;
-		var upperLayers = mb_mapObj[mapObj_ind].layers[indexA];
-		var upperStyles = mb_mapObj[mapObj_ind].styles[indexA];
-		var upperQuerylayers = mb_mapObj[mapObj_ind].querylayers[indexA];
-		mb_mapObj[mapObj_ind].layers[indexA] = mb_mapObj[mapObj_ind].layers[indexB];
-		mb_mapObj[mapObj_ind].styles[indexA] = mb_mapObj[mapObj_ind].styles[indexB];
-		mb_mapObj[mapObj_ind].querylayers[indexA] = mb_mapObj[mapObj_ind].querylayers[indexB];
-		mb_mapObj[mapObj_ind].layers[indexB] = upperLayers;
-		mb_mapObj[mapObj_ind].styles[indexB] = upperStyles;
-		mb_mapObj[mapObj_ind].querylayers[indexB] = upperQuerylayers;
-		return true;
-	}
-	else {
-		return false;
-	}
-}
-
-
-function mb_wmsMoveByIndex(mapObj_ind, fromIndex, toIndex) {
-	if (fromIndex != toIndex && fromIndex >= 0 && fromIndex < mb_mapObj[mapObj_ind].wms.length && toIndex >= 0 && toIndex < mb_mapObj[mapObj_ind].wms.length) {
-		var changed = false;
-		var i;
-		var result;
-		if (fromIndex > toIndex) {
-			for (i = fromIndex; i > toIndex ; i--) {
-				result = mb_swapWmsByIndex(mapObj_ind, i-1, i);
-				if (result === true) {
-					changed = true;
-				}
-			}
-		}
-		else {
-			for (i = fromIndex; i < toIndex ; i++) {
-				result = mb_swapWmsByIndex(mapObj_ind, i, i+1);
-				if (result === true) {
-					changed = true;
-				}
-			}
-		}
-		return changed;
-	}
-	else {
-		return false;
-	}
-}
-
-function addWmsFromFeatureInfo(pointer_name, version) {
-	mb_registerloadWmsSubFunctions("addWmsFromInfo_pos()");
-	var mywms = pointer_name; 
-	if(mywms.indexOf("?") > -1){pointer_name += "&";}
-	if(mywms.indexOf("?") == -1){pointer_name += "?";}
-	if (version == '1.0.0'){
-		var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
-		var load = cap;
-	}
-	else if (version == '1.1.0'){
-		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
-		var load = cap;
-	}
-	else if (version == '1.1.1'){
-		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
-		var load = cap;
-	}
-	if(load){
-		//if the mapfile WMS ONLINE RESOURCE is set relative, without any host
-		if(load.charAt(0) == '/' && load.charAt(1) == 'c') {
-			mod_addWMS_load('http://localhost' + load);
-        	}
-		else{
-			mod_addWMS_load(load);
-		}
-	}
-}
-function addWmsFromInfo_pos(){
-	if (mod_addWmsFromFeatureInfo_position > 0 && mod_addWmsFromFeatureInfo_position < mb_mapObj[getMapObjIndexByName(mod_target)].wms.length-1) {
-		mb_wmsMoveByIndex(getMapObjIndexByName(mod_target), mb_mapObj[getMapObjIndexByName(mod_target)].wms.length-1, mod_addWmsFromFeatureInfo_position-1);
-	}
-	eventAfterLoadWMS.unregister("addWmsFromInfo_pos()");
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/addWMSFromFeatureInfo.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.
+
+import_request_variables("PG");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+include(dirname(__FILE__).'/../include/dyn_js.php');
+
+echo "var mod_target = '".$e_target[0]."';";
+?>
+function mb_swapWmsByIndex(mapObj_ind, indexA, indexB) {
+	if (indexA != indexB && indexA >= 0 && indexA < mb_mapObj[mapObj_ind].wms.length && indexB >= 0 && indexB < mb_mapObj[mapObj_ind].wms.length) {
+		upper = mb_mapObj[mapObj_ind].wms[indexA];
+		mb_mapObj[mapObj_ind].wms[indexA] = mb_mapObj[mapObj_ind].wms[indexB];
+		mb_mapObj[mapObj_ind].wms[indexB] = upper;
+		var upperLayers = mb_mapObj[mapObj_ind].layers[indexA];
+		var upperStyles = mb_mapObj[mapObj_ind].styles[indexA];
+		var upperQuerylayers = mb_mapObj[mapObj_ind].querylayers[indexA];
+		mb_mapObj[mapObj_ind].layers[indexA] = mb_mapObj[mapObj_ind].layers[indexB];
+		mb_mapObj[mapObj_ind].styles[indexA] = mb_mapObj[mapObj_ind].styles[indexB];
+		mb_mapObj[mapObj_ind].querylayers[indexA] = mb_mapObj[mapObj_ind].querylayers[indexB];
+		mb_mapObj[mapObj_ind].layers[indexB] = upperLayers;
+		mb_mapObj[mapObj_ind].styles[indexB] = upperStyles;
+		mb_mapObj[mapObj_ind].querylayers[indexB] = upperQuerylayers;
+		return true;
+	}
+	else {
+		return false;
+	}
+}
+
+
+function mb_wmsMoveByIndex(mapObj_ind, fromIndex, toIndex) {
+	if (fromIndex != toIndex && fromIndex >= 0 && fromIndex < mb_mapObj[mapObj_ind].wms.length && toIndex >= 0 && toIndex < mb_mapObj[mapObj_ind].wms.length) {
+		var changed = false;
+		var i;
+		var result;
+		if (fromIndex > toIndex) {
+			for (i = fromIndex; i > toIndex ; i--) {
+				result = mb_swapWmsByIndex(mapObj_ind, i-1, i);
+				if (result === true) {
+					changed = true;
+				}
+			}
+		}
+		else {
+			for (i = fromIndex; i < toIndex ; i++) {
+				result = mb_swapWmsByIndex(mapObj_ind, i, i+1);
+				if (result === true) {
+					changed = true;
+				}
+			}
+		}
+		return changed;
+	}
+	else {
+		return false;
+	}
+}
+
+function addWmsFromFeatureInfo(pointer_name, version) {
+	mb_registerloadWmsSubFunctions("addWmsFromInfo_pos()");
+	var mywms = pointer_name; 
+	if(mywms.indexOf("?") > -1){pointer_name += "&";}
+	if(mywms.indexOf("?") == -1){pointer_name += "?";}
+	if (version == '1.0.0'){
+		var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
+		var load = cap;
+	}
+	else if (version == '1.1.0'){
+		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
+		var load = cap;
+	}
+	else if (version == '1.1.1'){
+		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
+		var load = cap;
+	}
+	if(load){
+		//if the mapfile WMS ONLINE RESOURCE is set relative, without any host
+		if(load.charAt(0) == '/' && load.charAt(1) == 'c') {
+			mod_addWMS_load('http://localhost' + load);
+        	}
+		else{
+			mod_addWMS_load(load);
+		}
+	}
+}
+function addWmsFromInfo_pos(){
+	if (mod_addWmsFromFeatureInfo_position > 0 && mod_addWmsFromFeatureInfo_position < mb_mapObj[getMapObjIndexByName(mod_target)].wms.length-1) {
+		mb_wmsMoveByIndex(getMapObjIndexByName(mod_target), mb_mapObj[getMapObjIndexByName(mod_target)].wms.length-1, mod_addWmsFromFeatureInfo_position-1);
+	}
+	eventAfterLoadWMS.unregister("addWmsFromInfo_pos()");
 }
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_category_filteredGUI.php
===================================================================
--- branches/print_dev/http/php/mod_category_filteredGUI.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_category_filteredGUI.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -24,7 +24,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+	echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
 ?>
 <title>Administration</title>
 <?php
@@ -150,10 +150,9 @@
 	$category_description[$cnt_category] = $row["category_description"];
 	$cnt_category++;
 }
-# has to be solved by a function
+
+
 $guiCategories = $admin->getGuiCategories();
-echo "<br>getGuiCategories - mehrere Spalten";
-echo "Noch einbauen getGuiCategories".count($guiCategories);
 
 
 /*
@@ -163,16 +162,7 @@
 */	
 if (count($category_id) == 0 AND count($gui_id) == 0){ die("There is no gui or category available for this user");}
 
-#$sql_category_gui = "SELECT gui.gui_id, gui.gui_name, gui_gui_category.fkey_gui_category_id FROM gui_gui_category ";
-#$sql_category_gui .= "INNER JOIN gui ON gui_gui_category.fkey_gui_id = gui.gui_id ";
-#$sql_category_gui .= "WHERE gui_gui_category.fkey_gui_category_id = $1 ";
-#echo $sql_category_gui;egories);
 
-#if(!$selected_category){$v = array($category_id[0]);}
-#if($selected_category){$v = array($selected_category);}
-#$t = array('i');
-#$sql_category_gui .= " ORDER BY gui.gui_name";
-
 if(!$selected_category){$selectedCategory = $category_id[0];}
 if($selected_category){$selectedCategory = $selected_category;}
 $getGuisByOwnerBySelectedGuiCategory = $admin->getGuisByOwnerByGuiCategory($logged_user_id,$selectedCategory);
@@ -180,12 +170,6 @@
 $cnt_gui_category = count($getGuisByOwnerBySelectedGuiCategory);
 $gui_category_id = $getGuisByOwnerBySelectedGuiCategory;
 
-#$res_category_gui = db_prep_query($sql_category_gui,$v,$t);
-#while($row = db_fetch_array($res_category_gui)){
-#$gui_category_id[$cnt_gui_category] = $row["gui_id"];
-#$gui_category_name[$cnt_gui_category] =  $row["gui_name"];
-#$cnt_gui_category++;
-#}
 
 /*INSERT HTML*/
 echo "<form name='form1' action='" . $self ."' method='post'>";

Modified: branches/print_dev/http/php/mod_createJSObjFromDBByWMS.php
===================================================================
--- branches/print_dev/http/php/mod_createJSObjFromDBByWMS.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_createJSObjFromDBByWMS.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -45,7 +45,9 @@
 	else{
 		$mywms->createObjFromDBNoGui($wms_id);	
 	}
-	$mywms->createJsObjFromWMS(true);
+	$output = $mywms->createJsObjFromWMS_(true);
+	echo administration::convertOutgoingString($output);
+	unset($output);
 	echo "parent.mod_addWMS_refresh();";
 }
 else {
@@ -53,12 +55,7 @@
 }
 ?>
 </script>
-<!--
-<script language="JavaScript" type="text/javascript">
-alert("3/3 mod_createJSObjFromDBByWMS: WMS ID = <?php echo $wms_id;?>, GUI ID = <?php echo $gui_id;?>");
-</script>
--->
 </head>
 <body bgcolor='#ffffff'>
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: branches/print_dev/http/php/mod_createJSObjFromXML.php
===================================================================
--- branches/print_dev/http/php/mod_createJSObjFromXML.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_createJSObjFromXML.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,52 +1,55 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_createJSObjFromXML.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(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_wms.php");
-
-$capabilitiesURL = html_entity_decode($_REQUEST['caps']);
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>Load WMS</title>
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'">	
-<script type='text/javascript'>
-<?php
-
-$mywms = new wms();
-$mywms->createObjFromXML($capabilitiesURL);
-
-$errorMessage = "Error: The Capabilities Document could not be accessed. Please check whether the server is responding and accessible to Mapbender.";
-if (!$mywms->wms_status) { 
-	echo "prompt('" . $errorMessage . "', '" . $capabilitiesURL . "');"; 
-	die; 
-}
-$mywms->createJsObjFromWMS(true);
-?>
-
-parent.mod_addWMS_refresh();
-</script>
-</head>
-<body bgcolor='#ffffff'>
-</body>
-</html>
\ No newline at end of file
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_createJSObjFromXML.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(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_wms.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+
+$capabilitiesURL = html_entity_decode($_REQUEST['caps']);
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Load WMS</title>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<meta http-equiv="Content-Type" content="text/html; charset='<?php echo CHARSET;?>'">	
+<script type='text/javascript'>
+<?php
+
+$mywms = new wms();
+$mywms->createObjFromXML($capabilitiesURL);
+
+$errorMessage = "Error: The Capabilities Document could not be accessed. Please check whether the server is responding and accessible to Mapbender.";
+if (!$mywms->wms_status) { 
+	echo "prompt('" . $errorMessage . "', '" . $capabilitiesURL . "');"; 
+	die; 
+}
+$output = $mywms->createJsObjFromWMS_(true);
+echo administration::convertOutgoingString($output);
+unset($output);
+?>
+
+parent.mod_addWMS_refresh();
+</script>
+</head>
+<body bgcolor='#ffffff'>
+</body>
+</html>

Modified: branches/print_dev/http/php/mod_deleteWFS.php
===================================================================
--- branches/print_dev/http/php/mod_deleteWFS.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_deleteWFS.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,96 +1,96 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/DeleteWFS
-# 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.
-
-import_request_variables("PG");
-require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-?>
-
-<!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>Delete WFS - All Users</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<script type="text/javascript">
-function validate(){
-	var ind = document.form1.wfsList.selectedIndex;
-	if(ind > -1){
-		var permission =  confirm("delete: "  + document.form1.wfsList.options[ind].text + " ?");
-		if(permission === true){
-			document.form1.del.value = 1;
-			document.form1.submit();
-		}
-	}
-}
-</script>
-
-<style type="text/css">
-  	<!--
-  	body{
-      background-color: #ffffff;
-  		font-family: Arial, Helvetica, sans-serif;
-  		font-size : 12px;
-  		color: #808080
-  	}
-  	
-  	-->
-</style>
-</head>
-<body>
-
-<?php
-$logged_user_name=$_SESSION["mb_user_name"];
-$logged_user_id=$_SESSION["mb_user_id"];
-
-###delete
-if($wfsList){
-	 $sql = "DELETE FROM wfs WHERE wfs_id = $1";
-	 $v = array($wfsList);
-	 $t = array("i");
-	 $res = db_prep_query($sql, $v, $t);
-}
-
-$sql_wfs = "SELECT * FROM wfs ORDER BY wfs_id";
-$res_wfs = db_query($sql_wfs);
-$cnt_wfs = 0;
-
-echo "<form name='form1' action='" . $self ."' method='post'>"; 
-echo "<br><b>WFS List: <b><br><br>";
-echo "<select class='wfsList' size='20' name='wfsList' >";
-
-while($row = db_fetch_array($res_wfs)){
-	echo "<option value='".$row["wfs_id"]."'>".$row["wfs_id"]." ".$row["wfs_name"]." - ".$row["wfs_title"]."</option>";
-	$cnt_wfs++;
-}
-echo "</select><br><br>";
-echo "<input class='button_del' type='button' value='delete' onclick='validate()'>";
-?>
-<input type='hidden' name='del'>
-</form>
-</body>
-</html>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/DeleteWFS
+# 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.
+
+import_request_variables("PG");
+require_once(dirname(__FILE__)."/../php/mb_validatePermission.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+?>
+
+<!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>Delete WFS - All Users</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<script type="text/javascript">
+function validate(){
+	var ind = document.form1.wfsList.selectedIndex;
+	if(ind > -1){
+		var permission =  confirm("delete: "  + document.form1.wfsList.options[ind].text + " ?");
+		if(permission === true){
+			document.form1.del.value = 1;
+			document.form1.submit();
+		}
+	}
+}
+</script>
+
+<style type="text/css">
+  	<!--
+  	body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	
+  	-->
+</style>
+</head>
+<body>
+
+<?php
+$logged_user_name=$_SESSION["mb_user_name"];
+$logged_user_id=$_SESSION["mb_user_id"];
+
+###delete
+if($wfsList){
+	 $sql = "DELETE FROM wfs WHERE wfs_id = $1";
+	 $v = array($wfsList);
+	 $t = array("i");
+	 $res = db_prep_query($sql, $v, $t);
+}
+
+$sql_wfs = "SELECT * FROM wfs ORDER BY wfs_id";
+$res_wfs = db_query($sql_wfs);
+$cnt_wfs = 0;
+
+echo "<form name='form1' action='" . $self ."' method='post'>"; 
+echo "<br><b>WFS List: <b><br><br>";
+echo "<select class='wfsList' size='20' name='wfsList' >";
+
+while($row = db_fetch_array($res_wfs)){
+	echo "<option value='".$row["wfs_id"]."'>".$row["wfs_id"]." ".$row["wfs_name"]." - ".$row["wfs_title"]."</option>";
+	$cnt_wfs++;
+}
+echo "</select><br><br>";
+echo "<input class='button_del' type='button' value='delete' onclick='validate()'>";
+?>
+<input type='hidden' name='del'>
+</form>
+</body>
+</html>

Modified: branches/print_dev/http/php/mod_editApplication_server.php
===================================================================
--- branches/print_dev/http/php/mod_editApplication_server.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_editApplication_server.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,58 +1,58 @@
-<?php
-require_once(dirname(__FILE__) . "/../php/mb_validateSession.php");
-require_once(dirname(__FILE__) . "/../classes/class_user.php");
-require_once(dirname(__FILE__) . "/../classes/class_json.php");
-
-/**
- * encodes and delivers the data
- * 
- * @param object the un-encoded object 
- */
-function sendOutput($out){
-	global $json;
-	$output = $json->encode($out);
-	header("Content-Type: text/x-json");
-	echo $output;
-}
-
-
-$json = new Mapbender_JSON();
-$queryObj = $json->decode(stripslashes($_REQUEST['queryObj']));
-$resultObj = array();
-
-$e = new mb_exception("command: " . $queryObj->command);
-
-$userId = $_SESSION[mb_user_id];
-
-switch($queryObj->command){
-
-	// gets available WMCs
-	case 'update':
-		$elementArray = $queryObj->parameters->data;		
-		for ($i = 0; $i < count($elementArray); $i++) {
-			$currentElement = $elementArray[$i];
-			$id = $currentElement->id;
-			$top = $currentElement->top;
-			$left = $currentElement->left;
-			$width = $currentElement->width;
-			$height = $currentElement->height;
-			$app = $queryObj->parameters->applicationId;
-			$sql = "UPDATE gui_element SET e_left = $1, e_top = $2, " .
-					"e_width = $3, e_height = $4 " .  
-					"WHERE e_id = $5 AND fkey_gui_id = $6"; 
-			$v = array($left, $top, $width, $height, $id, $app);
-			$t = array("i", "i", "i", "i", "s", "s");
-			$res = db_prep_query($sql, $v, $t);
-			$e = new mb_notice("updating element '" . $id . "'");
-		}
-		$resultObj["success"] = "Elements have been updated in the database.";
-	break;
-	
-
-	// Invalid command
-	default:
-		$resultObj["error"] = "no action specified...";
-}
-
-sendOutput($resultObj);
+<?php
+require_once(dirname(__FILE__) . "/../php/mb_validateSession.php");
+require_once(dirname(__FILE__) . "/../classes/class_user.php");
+require_once(dirname(__FILE__) . "/../classes/class_json.php");
+
+/**
+ * encodes and delivers the data
+ * 
+ * @param object the un-encoded object 
+ */
+function sendOutput($out){
+	global $json;
+	$output = $json->encode($out);
+	header("Content-Type: text/x-json");
+	echo $output;
+}
+
+
+$json = new Mapbender_JSON();
+$queryObj = $json->decode(stripslashes($_REQUEST['queryObj']));
+$resultObj = array();
+
+$e = new mb_exception("command: " . $queryObj->command);
+
+$userId = $_SESSION[mb_user_id];
+
+switch($queryObj->command){
+
+	// gets available WMCs
+	case 'update':
+		$elementArray = $queryObj->parameters->data;		
+		for ($i = 0; $i < count($elementArray); $i++) {
+			$currentElement = $elementArray[$i];
+			$id = $currentElement->id;
+			$top = $currentElement->top;
+			$left = $currentElement->left;
+			$width = $currentElement->width;
+			$height = $currentElement->height;
+			$app = $queryObj->parameters->applicationId;
+			$sql = "UPDATE gui_element SET e_left = $1, e_top = $2, " .
+					"e_width = $3, e_height = $4 " .  
+					"WHERE e_id = $5 AND fkey_gui_id = $6"; 
+			$v = array($left, $top, $width, $height, $id, $app);
+			$t = array("i", "i", "i", "i", "s", "s");
+			$res = db_prep_query($sql, $v, $t);
+			$e = new mb_notice("updating element '" . $id . "'");
+		}
+		$resultObj["success"] = "Elements have been updated in the database.";
+	break;
+	
+
+	// Invalid command
+	default:
+		$resultObj["error"] = "no action specified...";
+}
+
+sendOutput($resultObj);
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_editElements.php
===================================================================
--- branches/print_dev/http/php/mod_editElements.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_editElements.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -180,6 +180,8 @@
 		if($e_width < 1){$e_width = NULL;}
 		if($e_height < 1){$e_height = NULL;}
 		if($e_z_index < 1){$e_z_index = NULL;}
+		if($e_pos == ''){$e_pos = 2;}
+		if($e_public == ''){$e_public = 1;}	
 		
 		$sql = "INSERT INTO gui_element(fkey_gui_id,e_id,e_pos,e_public,e_comment,e_element,e_src,";
 		$sql .= "e_attributes,e_left,e_top,e_width,e_height,e_z_index,e_more_styles,e_content,";

Modified: branches/print_dev/http/php/mod_editWMS_Metadata.php
===================================================================
--- branches/print_dev/http/php/mod_editWMS_Metadata.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_editWMS_Metadata.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,497 +1,497 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php?title=Edit_WMS_Metadata
-# 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(dirname(__FILE__)."/mb_validatePermission.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-
-include_once '../include/dyn_css.php';
-
-$adm = new administration();
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>Edit WMS Metadata</title>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">   
-<script language="JavaScript">
-var dTarget;
-function save() {
-   document.forms[0].update_content.value=1;
-   document.forms[0].submit();
-}
-
-function deletepreview(layer_id) {
-	var url = String(document.location);
-	url = url.substr(0, url.indexOf('?'));
-	window.open(url+"?<?php echo $urlParameters; ?>&delete_preview=1&layer_id="+layer_id,'delete preview', 'height=50, width=150, dependent=yes');
-	document.getElementById(layer_id+"_dp").style.display="none";
-}
-
-function pick_the_date(obj) {
-    dTarget = obj;
-	var datePickerParameters = "m=Jan_Feb_Mrz_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dez&d=Mo_Di_Mi_Do_Fr_Sa_So&t=heute";
-	var datePickerStyle = "left=200,top=200,width=230,height=210,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0"
-    var dp = window.open('../extensions/datepicker/datepicker.php?' + datePickerParameters,'dp',datePickerStyle);
-    dp.focus();
-    return false;
-}
-</script>
-</head>
-<body>
-<?php
-
-function guessTimestamp($timestr) {
-	
-     if (mb_strpos($timestr, '.')) {
-        list($day, $month, $year) = explode(".", $timestr);
-     }
-     elseif (mb_strpos($timestr, '/')) {
-        list($month, $day, $year) = explode("/", $timestr);
-     }
-     elseif (mb_strpos($timestr, '-')) {
-        list($year, $month, $day) = explode("-", $timestr);
-     }
-     else {
-     	$year = 0;
-        $month = 0;
-        $day = 0;
-     }
-     return mktime(0, 0, 0, $month, $day, intval($year));
-}
-
-#Update handling
-
-if (isset($_REQUEST['update_content']) && $_REQUEST['update_content'] == true) {
-	
-	$update_wms_sql = "UPDATE wms SET "; 
-	$update_wms_sql .= "wms_title = $1, wms_abstract = $2, fees = $3, ";
-	$update_wms_sql .= "accessconstraints = $4, contactperson = $5, ";
-	$update_wms_sql .= "contactposition = $6, contactorganization = $7, ";
-	$update_wms_sql .= "address = $8, city = $9, stateorprovince = $10, ";
-	$update_wms_sql .= "postcode = $11, country = $12, ";
-	$update_wms_sql .= "contactvoicetelephone = $13, ";
-	$update_wms_sql .= "contactfacsimiletelephone = $14, ";
-	$update_wms_sql .= "contactelectronicmailaddress = $15 ";
-
-	$v = array();
-	array_push($v, $_REQUEST['wms_title_box']);
-	array_push($v, $_REQUEST['wms_abstract_box']);
-	array_push($v, $_REQUEST['fees_box']);
-	array_push($v, $_REQUEST['accessconstraints_box']);
-	array_push($v, $_REQUEST['contactperson_box']);
-	array_push($v, $_REQUEST['contactposition_box']);
-	array_push($v, $_REQUEST['contactorganization_box']);
-	array_push($v, $_REQUEST['address_box']);
-	array_push($v, $_REQUEST['city_box']);
-	array_push($v, $_REQUEST['stateorprovince_box']);
-	array_push($v, $_REQUEST['postcode_box']);
-	array_push($v, $_REQUEST['country_box']);
-	array_push($v, $_REQUEST['contactvoicetelephone_box']);
-	array_push($v, $_REQUEST['contactfacsimiletelephone_box']);
-	array_push($v, $_REQUEST['contactelectronicmailaddress_box']);
-	$t = array("s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s");
-
-	if (isset($_REQUEST['wms_timestamp_box']) && $_REQUEST['wms_timestamp_box'] <> "") {
-        $update_wms_sql .= ", wms_timestamp = $16 ";
-		array_push($v, guessTimestamp($_REQUEST['wms_timestamp_box']));
-		array_push($t, "s");
-
-		$update_wms_sql .= "WHERE wms_id = $17";
-	}
-	else {
-		$update_wms_sql .= "WHERE wms_id = $16";
-	}
-	array_push($v, 	$_REQUEST['wms_id']);
-	array_push($t, "s");
-
-    $res_update_wms_sql = db_prep_query($update_wms_sql, $v, $t);
-
-    while(list($key,$val) = each($_REQUEST)) {
-        if(preg_match("/___/", $key)) {
-            $myKey = explode("___", $key);
-            $layer_id = preg_replace("/L_/","",$myKey[0]);
-            if($myKey[1]=="layer_abstract") {
-				$layer_sql = "UPDATE layer SET layer_abstract = $1 ";
-				$layer_sql .= "WHERE layer_id = $2 AND fkey_wms_id = $3";  
-                $v = array($val, $layer_id, $_REQUEST['wms_id']);
-                $t = array("s", "i", "s");
-                $res_keyword_sql = db_prep_query($layer_sql, $v, $t);
-            }
-            if($myKey[1]=="layer_keywords") {
-                #Get all keywords depending on the given layer after user modification
-                $keywords  = explode(",",$val);
-                #delete all blanks from the keywords list
-                for ($j = 0; $j < count($keywords); $j++) {
-                    $word = $keywords[$j];
-                    $word = trim($word);
-                    $keywords[$j] = $word;
-                }
-                #echo "1: Keywords eines Layers: id des Layers: ", $layer_id, ", �bergebener String: ", $val, ";<br>";
-                #Get all keywords depending on this layer from database
-                $keyword_sql = "SELECT keyword_id, keyword FROM keyword, layer_keyword, layer " .
-                               "WHERE keyword.keyword_id = layer_keyword.fkey_keyword_id " .
-                               "AND layer_keyword.fkey_layer_id = layer.layer_id " .
-                               "AND layer.fkey_wms_id = $1 " .
-                               "AND layer.layer_id = $2";
-                
-                $v = array($_REQUEST['wms_id'], $layer_id); 
-                $t = array("s", "i");
-                $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
-                while($keyword_row = db_fetch_array($res_keyword_sql))
-                {
-                    $keyword = $keyword_row['keyword'];
-                    $keyword_id = $keyword_row['keyword_id'];
-                    #keyword has been deleted or has been modified
-                    #keyword exists in database but not in user data
-                    $index = -1;
-                    #echo "1a: Abfrage ob DB Keywords in User Liste: Keyword: ", $keyword, ";<br>";
-                    if(in_array($keyword, $keywords) == false)
-                    {
-                        #echo "1c: Keyword nicht in User Liste: Keyword: ", $keyword, ";<br>";
-                        #Deleting reference to the keyword from the layer_keyword table.
-                        $keyword_sql = "DELETE FROM layer_keyword " .
-                                       "WHERE fkey_layer_id = $1 " .
-                                       "AND fkey_keyword_id = $2";
-                        $v = array($layer_id, $keyword_id);
-                        $t = array("i", "i");
-                        db_prep_query($keyword_sql, $v, $t);
-                        #Checking, if the keyword is in use by any layer
-                        $layer_sql = "SELECT * FROM layer_keyword " .
-                                       "WHERE fkey_keyword_id = $1";
-                        $v = array($keyword_id);
-                        $t = array("i");
-                        $res_layer_sql = db_prep_query($layer_sql, $v, $t);
-                        if(!($row = db_fetch_array($res_layer_sql)))
-                        {
-                            #If keyword will not longer be in use, delete it from keyword table
-                            $keyword_sql = "DELETE FROM keyword " .
-                                           "WHERE keyword_id = $1";
-                            $v = array($keyword_id);
-                            $t = array("i");
-                            db_prep_query($keyword_sql, $v, $t);
-                        }
-                    }
-                    #Keyword exists in the database and in the user data
-                    else
-                    {
-                        #echo "1d: Keyword ist in User Liste: Keyword: ", $keyword, ";<br>";
-                        for($i = 0; $i < count($keywords); $i++)
-                        {
-                            #Delete keyword from the user data list, because the data
-                            #have not to be updated within the database
-                            if($keywords[$i] == $keyword)
-                            {
-                                $keywords[$i] = null;
-                            }
-                        }
-                    }
-                }
-                #Inserting keyword, that are not existing in the database
-                for($i = 0; $i < count($keywords); $i++)
-                {
-                    #echo "2: Alle Eintr�ge des Keyword arrays: Keyword: ", $keywords[$i], "; Index: ", $i, ";<br>";
-                    if($keywords[$i] != null)
-                    {
-                        #echo "3: Eintr�ge ungleich null: Keyword: ", $keywords[$i], "; Index: ", $i, ";<nr>";
-                        $keyword = trim($keywords[$i]);
-                        #Check, if the keyword is exsiting in the database
-                        $keyword_sql = "SELECT keyword_id FROM keyword " .
-                                       "WHERE UPPER(keyword) = UPPER($1)";
-                        $v = array($keyword);
-                        $t = array("s");
-                        $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
-                        $keyword_row = db_fetch_array($res_keyword_sql);
-                        #Keyword exists in the database
-                        if($keyword_row != null)
-                        {
-                            $keyword_id = $keyword_row[0];
-                            #echo "4: Keyword in Datenbank vorhanden: id des Keywords: ", $keyword_id, ";<br>";
-                        }
-                        #Keyword does not exist in the database
-                        else
-                        {
-                            $keyword_sql = "INSERT INTO keyword (keyword) VALUES ($1)";
-                            $v = array($keyword);
-                            $t = array("s");
-                            $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
-                            
-                            $keyword_sql = "SELECT keyword_id FROM keyword WHERE keyword = $1";
-                            $v = array($keyword);
-                            $t = array("s");
-                            $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
-                            $keyword_row = db_fetch_array($res_keyword_sql);
-                            if($keyword_row != null)
-                            {
-                                $keyword_id = $keyword_row[0];
-                                #echo "4: Keyword in der Datenbank nicht vorhanden: id des Keywords: ", $keyword_id, ";<br>";
-                            }
-                        }
-                        #Inserting the reference between layer and keyword in the layer_keyword table
-                        $keyword_sql = "INSERT INTO layer_keyword (fkey_layer_id, fkey_keyword_id) " .
-                                       "VALUES ($1, $2)";
-                        $v = array($layer_id, $keyword_id);
-                        $t = array("s", "s");
-                        $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
-                    }
-                }
-                #Delete all elements from array
-                unset($keywords);
-            }
-        }
-    }
-}
-unset($update_content);
-
-#delete preview
-
-if(isset($_REQUEST['delete_preview']) && $_REQUEST['delete_preview']=='1'
-	&& isset($_REQUEST['layer_id']))
-{
-    $preview_sql = "DELETE FROM layer_preview WHERE fkey_layer_id = $1";
-    $v = array($_REQUEST['layer_id']);
-    $t = array("s");
-    $res_preview_sql = db_prep_query($preview_sql, $v, $t);
-    die("Preview has been deleted!</body></html>");
-}
-?>
-<form name='form1' action='<?php echo $self . "&show_wms_list=true"; ?>' method='post'>
-
-<table border='0'>
-<tr>
-<td WIDTH="300" align="left">
-<B>WMS Metadaten<B/>
-<td/>
-<td WIDTH="160">
-<td/>
-</tr>
-
-<?php  
-
-#Use select box to select a wms
-
-if (isset($_REQUEST['show_wms_list']) && $_REQUEST['show_wms_list'] == true)
-{
-
-    #Querying information from wms data table 
-    $wms_sql = "SELECT wms_id, wms_title FROM wms WHERE wms_owner = $1 ORDER BY wms_title";
-    $v = array($_SESSION["mb_user_id"]);
-    $t = array("i");
-    $res_wms_sql = db_prep_query($wms_sql, $v, $t);
-    #wms-selection
-
-    $selectBox = "";
-    while($row = db_fetch_array($res_wms_sql)) {
-        if ($adm->getWmsPermission($row["wms_id"], $_SESSION['mb_user_id'])) {
-	        $selectBox .= "<option value='".$row["wms_id"]."' ";
-	        if(isset($_REQUEST['wmsList']) && $_REQUEST['wmsList'] == $row["wms_id"]) {
-	            $selectBox .= "selected";
-	        }
-	        $selectBox .= "> ".$row["wms_title"]."</option>";
-        }
-    }
-    
-    if ($selectBox != "") {
-	    echo "<tr><td>";
-	    echo "<select size=6 name='wmsList' onchange='submit()'>".$selectBox."</select>";
-	    echo "</td><td width='160px' align='right'>";
-	    echo "<input type='button' class='sbutton' value='save' onclick='save()'>";
-		echo "</td></tr>";
-    }
-    else {
-    	echo "<div>no wms owner.</div>";
-    	die;
-    }
-
-    if(isset($_REQUEST['wmsList']) == true && $_REQUEST['wmsList'] <>0)
-    editWMSByWMSID ($_REQUEST['wmsList']);
-}
-
-echo "</table>";
-
-//$wms_id;
-function editWMSByWMSID($param_wms_id)
-{
-    global $wms_id;
-    $wms_id = $param_wms_id;
-
-}
-
-
-if(isset($wms_id) == true && $wms_id <>0)
-{ 
-	$selected_wms_sql = "SELECT * FROM wms WHERE wms_id = $1";
-	$v = array($wms_id);
-	$t = array("s");
-    $res_selected_wms_sql = db_prep_query($selected_wms_sql, $v, $t);
-    $selected_row = db_fetch_array($res_selected_wms_sql);
-
-?>
-    
-    <table border='0' class='table_top' >
-    <tr>
-    <td>WMS-Titel:<td><td/>
-    <input type='text' name='wms_title_box' value='<?php echo $selected_row["wms_title"];?>' /><td/>
-
-    <td>WMS- Abstract:<td><td/>
-    <input type='text' name='wms_abstract_box' value='<?php echo $selected_row["wms_abstract"];?>' /><td/>
-
-    <td >Fees:<td><td/>
-    <input type='text' name='fees_box' value='<?php echo $selected_row["fees"]?>'/><td/>
-    <tr/>
-       
-    <tr>
-    <td>Access Constraints:<td><td/>
-    <input type='text' name='accessconstraints_box' value='<?php echo $selected_row["accessconstraints"]?>'/><td/>
-
-    <td>Contact Person:<td><td/>
-    <input type='text' name='contactperson_box' value='<?php echo $selected_row["contactperson"]?>'/><td/>
-
-    <td>Contact Position:<td><td/>
-    <input type='text' name='contactposition_box' value='<?php echo $selected_row["contactposition"]?>'/><td/>
-    <tr/>
-    
-    <tr>
-    <td>Contact Organization:<td><td/>
-    <input type='text' name='contactorganization_box' value='<?php echo $selected_row["contactorganization"]?>'/><td/>
- 
-    <td>Address:<td><td/>
-    <input type='text' name='address_box' value='<?php echo $selected_row["address"]?>'/><td/>
-
-    <td style="width:">City:<td><td/>
-    <input type='text' name='city_box' value='<?php echo $selected_row["city"]?>'/><td/>
-    <tr/>
-    
-    <tr>
-    <td>State or Province:<td><td/>
-    <input type='text' name='stateorprovince_box' value='<?php echo $selected_row["stateorprovince"]?>'/><td/>
-
-    <td>Postcode:<td><td/>
-    <input type='text' name='postcode_box' value='<?php echo $selected_row["postcode"]?>'/><td/>
-    
-    <td>Country:<td><td/>
-    <input type='text' name='country_box' value='<?php echo $selected_row["country"]?>'/><td/>
-    <tr/>
-    
-    <tr>
-    <td>Telephone:<td><td/>
-    <input type='text' name='contactvoicetelephone_box' 
-        value='<?php echo $selected_row["contactvoicetelephone"]?>'/><td/>
-    
-    <td>Fax:<td><td/>
-    <input type='text' name='contactfacsimiletelephone_box' value='<?php echo $selected_row["contactfacsimiletelephone"]?>'/><td/>
-    
-    <td>E-Mail:<td><td/>
-    <input type='text' name='contactelectronicmailaddress_box' value='<?php echo $selected_row["contactelectronicmailaddress"]?>'/><td/>
-    <tr/>
-    <tr>
-    <?php
-  if (isset($selected_row["wms_timestamp"]) && $selected_row["wms_timestamp"] <> "") {
-    $datum = date("d.m.Y",$selected_row["wms_timestamp"]);
-  }
-  else $datum = ""
-?>
-    <td>Date:<td><td/>
-    <input type='text' name='wms_timestamp_box' value='<?php echo $datum?>' onClick='pick_the_date(document.form1.wms_timestamp_box)'/><td/>
-    <tr/>
-    
-    <table class="table_layer">
-    <tr><td>Nr.</td><td>Title</td><td>Abstract</td><td>Keywords</td><td></td></tr>
-
-    
-<?php
-   
-    $layer_sql = "SELECT * FROM layer WHERE layer.fkey_wms_id = $1" .
-                 " ORDER BY layer_pos";
-    $v = array($wms_id);
-    $t = array("s");
-    $res_layer_sql = db_prep_query($layer_sql, $v, $t);
-    
-    while($layer_row = db_fetch_array($res_layer_sql))
-    {
-    ?>
-        <tr align='center'>
-        <td><input type='text' size='1' name='L_<?php echo $layer_row['layer_id']?>___layer_nr' 
-            value='<?php echo $layer_row['layer_pos']?>' readonly></td>
-        <td><input type='text' size='15' name='L_<?php echo $layer_row['layer_id']?>___layer_title' 
-            value='<?php echo $layer_row['layer_title']?>' readonly></td>
-        <td><input type='text' size='42' name='L_<?php echo $layer_row['layer_id']?>___layer_abstract'
-            value='<?php echo $layer_row['layer_abstract']?>'>
-
-    <?php
-        $keyword_sql = "SELECT keyword FROM keyword, layer_keyword, layer " .
-                       "WHERE keyword.keyword_id = layer_keyword.fkey_keyword_id " .
-                       "AND layer_keyword.fkey_layer_id = layer.layer_id " .
-                       "AND layer.fkey_wms_id = $1 " .
-                       "AND layer.layer_id = $2";
-        $v = array($wms_id, $layer_row['layer_id']);
-        $t = array("s", "i");
-        $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
-        $keywordList = "";
-        $seperator = "";
-        while($keyword_row = db_fetch_array($res_keyword_sql))
-        {
-            if($keywordList != "")
-            {    
-                $seperator = ",";
-            }
-            $keywordList .= $seperator.$keyword_row["keyword"];
-        }
-        ?>
-        <td><input type='text' size='42' name='L_<?php echo $layer_row['layer_id']?>___layer_keywords' 
-             value='<?php echo $keywordList?>'>        
-        </td>
-        <td>
-        <!--
-        <input type="button" value='preview' onclick="window.open('../frames/index.php?&gui_id=layer_preview&layer_preview=1&portal_services=<?php echo $layer_row['layer_id'];?>', 'mini_mapbender', 'height=370, width=370, dependent=yes');">
-        -->
-        </td>
-        <td>
-<?php 
-/*
-    $preview_sql = "SELECT * FROM layer_preview " .
-                   "WHERE fkey_layer_id = ".$layer_row['layer_id']."";
-    $res_preview_sql = db_query($preview_sql);
-	if(db_numrows($res_preview_sql)>0){?>
-        <!--
-        <input id="<?php echo $layer_row['layer_id'];?>_dp" type="button" value='delete preview' onclick="deletepreview('<?php echo $layer_row['layer_id'];?>');">
-        -->
-<?php }else{?>
-		<!--
-        <input id="<?php echo $layer_row['layer_id'];?>_dp" type="button" value='delete preview' style="display:none;" onclick="deletepreview('<?php echo $layer_row['layer_id'];?>');">
-        -->
-<?php }*/?>
-        </td>
-        </tr>
-    <?php
-    }
-    #editWMSByWMSID(961);
-    ?>
-    </table>
-    <input type='hidden' name='update_content' value=''/>
-    <input type='hidden' name='wms_id' value='<?php echo $wms_id ?>'/>
-	<!--
-    <input type="hidden" value='' name='delete_preview'>
-    -->
-    <input type="hidden" value='' name='layer_id'>
-    </form>
-    </body>
-    </html>
-<?php
-}
+<?php
+# $Id$
+# http://www.mapbender.org/index.php?title=Edit_WMS_Metadata
+# 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(dirname(__FILE__)."/mb_validatePermission.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+
+include_once '../include/dyn_css.php';
+
+$adm = new administration();
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>Edit WMS Metadata</title>
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">   
+<script language="JavaScript">
+var dTarget;
+function save() {
+   document.forms[0].update_content.value=1;
+   document.forms[0].submit();
+}
+
+function deletepreview(layer_id) {
+	var url = String(document.location);
+	url = url.substr(0, url.indexOf('?'));
+	window.open(url+"?<?php echo $urlParameters; ?>&delete_preview=1&layer_id="+layer_id,'delete preview', 'height=50, width=150, dependent=yes');
+	document.getElementById(layer_id+"_dp").style.display="none";
+}
+
+function pick_the_date(obj) {
+    dTarget = obj;
+	var datePickerParameters = "m=Jan_Feb_Mrz_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dez&d=Mo_Di_Mi_Do_Fr_Sa_So&t=heute";
+	var datePickerStyle = "left=200,top=200,width=230,height=210,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0"
+    var dp = window.open('../extensions/datepicker/datepicker.php?' + datePickerParameters,'dp',datePickerStyle);
+    dp.focus();
+    return false;
+}
+</script>
+</head>
+<body>
+<?php
+
+function guessTimestamp($timestr) {
+	
+     if (mb_strpos($timestr, '.')) {
+        list($day, $month, $year) = explode(".", $timestr);
+     }
+     elseif (mb_strpos($timestr, '/')) {
+        list($month, $day, $year) = explode("/", $timestr);
+     }
+     elseif (mb_strpos($timestr, '-')) {
+        list($year, $month, $day) = explode("-", $timestr);
+     }
+     else {
+     	$year = 0;
+        $month = 0;
+        $day = 0;
+     }
+     return mktime(0, 0, 0, $month, $day, intval($year));
+}
+
+#Update handling
+
+if (isset($_REQUEST['update_content']) && $_REQUEST['update_content'] == true) {
+	
+	$update_wms_sql = "UPDATE wms SET "; 
+	$update_wms_sql .= "wms_title = $1, wms_abstract = $2, fees = $3, ";
+	$update_wms_sql .= "accessconstraints = $4, contactperson = $5, ";
+	$update_wms_sql .= "contactposition = $6, contactorganization = $7, ";
+	$update_wms_sql .= "address = $8, city = $9, stateorprovince = $10, ";
+	$update_wms_sql .= "postcode = $11, country = $12, ";
+	$update_wms_sql .= "contactvoicetelephone = $13, ";
+	$update_wms_sql .= "contactfacsimiletelephone = $14, ";
+	$update_wms_sql .= "contactelectronicmailaddress = $15 ";
+
+	$v = array();
+	array_push($v, $_REQUEST['wms_title_box']);
+	array_push($v, $_REQUEST['wms_abstract_box']);
+	array_push($v, $_REQUEST['fees_box']);
+	array_push($v, $_REQUEST['accessconstraints_box']);
+	array_push($v, $_REQUEST['contactperson_box']);
+	array_push($v, $_REQUEST['contactposition_box']);
+	array_push($v, $_REQUEST['contactorganization_box']);
+	array_push($v, $_REQUEST['address_box']);
+	array_push($v, $_REQUEST['city_box']);
+	array_push($v, $_REQUEST['stateorprovince_box']);
+	array_push($v, $_REQUEST['postcode_box']);
+	array_push($v, $_REQUEST['country_box']);
+	array_push($v, $_REQUEST['contactvoicetelephone_box']);
+	array_push($v, $_REQUEST['contactfacsimiletelephone_box']);
+	array_push($v, $_REQUEST['contactelectronicmailaddress_box']);
+	$t = array("s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s", "s");
+
+	if (isset($_REQUEST['wms_timestamp_box']) && $_REQUEST['wms_timestamp_box'] <> "") {
+        $update_wms_sql .= ", wms_timestamp = $16 ";
+		array_push($v, guessTimestamp($_REQUEST['wms_timestamp_box']));
+		array_push($t, "s");
+
+		$update_wms_sql .= "WHERE wms_id = $17";
+	}
+	else {
+		$update_wms_sql .= "WHERE wms_id = $16";
+	}
+	array_push($v, 	$_REQUEST['wms_id']);
+	array_push($t, "s");
+
+    $res_update_wms_sql = db_prep_query($update_wms_sql, $v, $t);
+
+    while(list($key,$val) = each($_REQUEST)) {
+        if(preg_match("/___/", $key)) {
+            $myKey = explode("___", $key);
+            $layer_id = preg_replace("/L_/","",$myKey[0]);
+            if($myKey[1]=="layer_abstract") {
+				$layer_sql = "UPDATE layer SET layer_abstract = $1 ";
+				$layer_sql .= "WHERE layer_id = $2 AND fkey_wms_id = $3";  
+                $v = array($val, $layer_id, $_REQUEST['wms_id']);
+                $t = array("s", "i", "s");
+                $res_keyword_sql = db_prep_query($layer_sql, $v, $t);
+            }
+            if($myKey[1]=="layer_keywords") {
+                #Get all keywords depending on the given layer after user modification
+                $keywords  = explode(",",$val);
+                #delete all blanks from the keywords list
+                for ($j = 0; $j < count($keywords); $j++) {
+                    $word = $keywords[$j];
+                    $word = trim($word);
+                    $keywords[$j] = $word;
+                }
+                #echo "1: Keywords eines Layers: id des Layers: ", $layer_id, ", �bergebener String: ", $val, ";<br>";
+                #Get all keywords depending on this layer from database
+                $keyword_sql = "SELECT keyword_id, keyword FROM keyword, layer_keyword, layer " .
+                               "WHERE keyword.keyword_id = layer_keyword.fkey_keyword_id " .
+                               "AND layer_keyword.fkey_layer_id = layer.layer_id " .
+                               "AND layer.fkey_wms_id = $1 " .
+                               "AND layer.layer_id = $2";
+                
+                $v = array($_REQUEST['wms_id'], $layer_id); 
+                $t = array("s", "i");
+                $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
+                while($keyword_row = db_fetch_array($res_keyword_sql))
+                {
+                    $keyword = $keyword_row['keyword'];
+                    $keyword_id = $keyword_row['keyword_id'];
+                    #keyword has been deleted or has been modified
+                    #keyword exists in database but not in user data
+                    $index = -1;
+                    #echo "1a: Abfrage ob DB Keywords in User Liste: Keyword: ", $keyword, ";<br>";
+                    if(in_array($keyword, $keywords) == false)
+                    {
+                        #echo "1c: Keyword nicht in User Liste: Keyword: ", $keyword, ";<br>";
+                        #Deleting reference to the keyword from the layer_keyword table.
+                        $keyword_sql = "DELETE FROM layer_keyword " .
+                                       "WHERE fkey_layer_id = $1 " .
+                                       "AND fkey_keyword_id = $2";
+                        $v = array($layer_id, $keyword_id);
+                        $t = array("i", "i");
+                        db_prep_query($keyword_sql, $v, $t);
+                        #Checking, if the keyword is in use by any layer
+                        $layer_sql = "SELECT * FROM layer_keyword " .
+                                       "WHERE fkey_keyword_id = $1";
+                        $v = array($keyword_id);
+                        $t = array("i");
+                        $res_layer_sql = db_prep_query($layer_sql, $v, $t);
+                        if(!($row = db_fetch_array($res_layer_sql)))
+                        {
+                            #If keyword will not longer be in use, delete it from keyword table
+                            $keyword_sql = "DELETE FROM keyword " .
+                                           "WHERE keyword_id = $1";
+                            $v = array($keyword_id);
+                            $t = array("i");
+                            db_prep_query($keyword_sql, $v, $t);
+                        }
+                    }
+                    #Keyword exists in the database and in the user data
+                    else
+                    {
+                        #echo "1d: Keyword ist in User Liste: Keyword: ", $keyword, ";<br>";
+                        for($i = 0; $i < count($keywords); $i++)
+                        {
+                            #Delete keyword from the user data list, because the data
+                            #have not to be updated within the database
+                            if($keywords[$i] == $keyword)
+                            {
+                                $keywords[$i] = null;
+                            }
+                        }
+                    }
+                }
+                #Inserting keyword, that are not existing in the database
+                for($i = 0; $i < count($keywords); $i++)
+                {
+                    #echo "2: Alle Eintr�ge des Keyword arrays: Keyword: ", $keywords[$i], "; Index: ", $i, ";<br>";
+                    if($keywords[$i] != null)
+                    {
+                        #echo "3: Eintr�ge ungleich null: Keyword: ", $keywords[$i], "; Index: ", $i, ";<nr>";
+                        $keyword = trim($keywords[$i]);
+                        #Check, if the keyword is exsiting in the database
+                        $keyword_sql = "SELECT keyword_id FROM keyword " .
+                                       "WHERE UPPER(keyword) = UPPER($1)";
+                        $v = array($keyword);
+                        $t = array("s");
+                        $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
+                        $keyword_row = db_fetch_array($res_keyword_sql);
+                        #Keyword exists in the database
+                        if($keyword_row != null)
+                        {
+                            $keyword_id = $keyword_row[0];
+                            #echo "4: Keyword in Datenbank vorhanden: id des Keywords: ", $keyword_id, ";<br>";
+                        }
+                        #Keyword does not exist in the database
+                        else
+                        {
+                            $keyword_sql = "INSERT INTO keyword (keyword) VALUES ($1)";
+                            $v = array($keyword);
+                            $t = array("s");
+                            $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
+                            
+                            $keyword_sql = "SELECT keyword_id FROM keyword WHERE keyword = $1";
+                            $v = array($keyword);
+                            $t = array("s");
+                            $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
+                            $keyword_row = db_fetch_array($res_keyword_sql);
+                            if($keyword_row != null)
+                            {
+                                $keyword_id = $keyword_row[0];
+                                #echo "4: Keyword in der Datenbank nicht vorhanden: id des Keywords: ", $keyword_id, ";<br>";
+                            }
+                        }
+                        #Inserting the reference between layer and keyword in the layer_keyword table
+                        $keyword_sql = "INSERT INTO layer_keyword (fkey_layer_id, fkey_keyword_id) " .
+                                       "VALUES ($1, $2)";
+                        $v = array($layer_id, $keyword_id);
+                        $t = array("s", "s");
+                        $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
+                    }
+                }
+                #Delete all elements from array
+                unset($keywords);
+            }
+        }
+    }
+}
+unset($update_content);
+
+#delete preview
+
+if(isset($_REQUEST['delete_preview']) && $_REQUEST['delete_preview']=='1'
+	&& isset($_REQUEST['layer_id']))
+{
+    $preview_sql = "DELETE FROM layer_preview WHERE fkey_layer_id = $1";
+    $v = array($_REQUEST['layer_id']);
+    $t = array("s");
+    $res_preview_sql = db_prep_query($preview_sql, $v, $t);
+    die("Preview has been deleted!</body></html>");
+}
+?>
+<form name='form1' action='<?php echo $self . "&show_wms_list=true"; ?>' method='post'>
+
+<table border='0'>
+<tr>
+<td WIDTH="300" align="left">
+<B>WMS Metadaten<B/>
+<td/>
+<td WIDTH="160">
+<td/>
+</tr>
+
+<?php  
+
+#Use select box to select a wms
+
+if (isset($_REQUEST['show_wms_list']) && $_REQUEST['show_wms_list'] == true)
+{
+
+    #Querying information from wms data table 
+    $wms_sql = "SELECT wms_id, wms_title FROM wms WHERE wms_owner = $1 ORDER BY wms_title";
+    $v = array($_SESSION["mb_user_id"]);
+    $t = array("i");
+    $res_wms_sql = db_prep_query($wms_sql, $v, $t);
+    #wms-selection
+
+    $selectBox = "";
+    while($row = db_fetch_array($res_wms_sql)) {
+        if ($adm->getWmsPermission($row["wms_id"], $_SESSION['mb_user_id'])) {
+	        $selectBox .= "<option value='".$row["wms_id"]."' ";
+	        if(isset($_REQUEST['wmsList']) && $_REQUEST['wmsList'] == $row["wms_id"]) {
+	            $selectBox .= "selected";
+	        }
+	        $selectBox .= "> ".$row["wms_title"]."</option>";
+        }
+    }
+    
+    if ($selectBox != "") {
+	    echo "<tr><td>";
+	    echo "<select size=6 name='wmsList' onchange='submit()'>".$selectBox."</select>";
+	    echo "</td><td width='160px' align='right'>";
+	    echo "<input type='button' class='sbutton' value='save' onclick='save()'>";
+		echo "</td></tr>";
+    }
+    else {
+    	echo "<div>no wms owner.</div>";
+    	die;
+    }
+
+    if(isset($_REQUEST['wmsList']) == true && $_REQUEST['wmsList'] <>0)
+    editWMSByWMSID ($_REQUEST['wmsList']);
+}
+
+echo "</table>";
+
+//$wms_id;
+function editWMSByWMSID($param_wms_id)
+{
+    global $wms_id;
+    $wms_id = $param_wms_id;
+
+}
+
+
+if(isset($wms_id) == true && $wms_id <>0)
+{ 
+	$selected_wms_sql = "SELECT * FROM wms WHERE wms_id = $1";
+	$v = array($wms_id);
+	$t = array("s");
+    $res_selected_wms_sql = db_prep_query($selected_wms_sql, $v, $t);
+    $selected_row = db_fetch_array($res_selected_wms_sql);
+
+?>
+    
+    <table border='0' class='table_top' >
+    <tr>
+    <td>WMS-Titel:<td><td/>
+    <input type='text' name='wms_title_box' value='<?php echo $selected_row["wms_title"];?>' /><td/>
+
+    <td>WMS- Abstract:<td><td/>
+    <input type='text' name='wms_abstract_box' value='<?php echo $selected_row["wms_abstract"];?>' /><td/>
+
+    <td >Fees:<td><td/>
+    <input type='text' name='fees_box' value='<?php echo $selected_row["fees"]?>'/><td/>
+    <tr/>
+       
+    <tr>
+    <td>Access Constraints:<td><td/>
+    <input type='text' name='accessconstraints_box' value='<?php echo $selected_row["accessconstraints"]?>'/><td/>
+
+    <td>Contact Person:<td><td/>
+    <input type='text' name='contactperson_box' value='<?php echo $selected_row["contactperson"]?>'/><td/>
+
+    <td>Contact Position:<td><td/>
+    <input type='text' name='contactposition_box' value='<?php echo $selected_row["contactposition"]?>'/><td/>
+    <tr/>
+    
+    <tr>
+    <td>Contact Organization:<td><td/>
+    <input type='text' name='contactorganization_box' value='<?php echo $selected_row["contactorganization"]?>'/><td/>
+ 
+    <td>Address:<td><td/>
+    <input type='text' name='address_box' value='<?php echo $selected_row["address"]?>'/><td/>
+
+    <td style="width:">City:<td><td/>
+    <input type='text' name='city_box' value='<?php echo $selected_row["city"]?>'/><td/>
+    <tr/>
+    
+    <tr>
+    <td>State or Province:<td><td/>
+    <input type='text' name='stateorprovince_box' value='<?php echo $selected_row["stateorprovince"]?>'/><td/>
+
+    <td>Postcode:<td><td/>
+    <input type='text' name='postcode_box' value='<?php echo $selected_row["postcode"]?>'/><td/>
+    
+    <td>Country:<td><td/>
+    <input type='text' name='country_box' value='<?php echo $selected_row["country"]?>'/><td/>
+    <tr/>
+    
+    <tr>
+    <td>Telephone:<td><td/>
+    <input type='text' name='contactvoicetelephone_box' 
+        value='<?php echo $selected_row["contactvoicetelephone"]?>'/><td/>
+    
+    <td>Fax:<td><td/>
+    <input type='text' name='contactfacsimiletelephone_box' value='<?php echo $selected_row["contactfacsimiletelephone"]?>'/><td/>
+    
+    <td>E-Mail:<td><td/>
+    <input type='text' name='contactelectronicmailaddress_box' value='<?php echo $selected_row["contactelectronicmailaddress"]?>'/><td/>
+    <tr/>
+    <tr>
+    <?php
+  if (isset($selected_row["wms_timestamp"]) && $selected_row["wms_timestamp"] <> "") {
+    $datum = date("d.m.Y",$selected_row["wms_timestamp"]);
+  }
+  else $datum = ""
+?>
+    <td>Date:<td><td/>
+    <input type='text' name='wms_timestamp_box' value='<?php echo $datum?>' onClick='pick_the_date(document.form1.wms_timestamp_box)'/><td/>
+    <tr/>
+    
+    <table class="table_layer">
+    <tr><td>Nr.</td><td>Title</td><td>Abstract</td><td>Keywords</td><td></td></tr>
+
+    
+<?php
+   
+    $layer_sql = "SELECT * FROM layer WHERE layer.fkey_wms_id = $1" .
+                 " ORDER BY layer_pos";
+    $v = array($wms_id);
+    $t = array("s");
+    $res_layer_sql = db_prep_query($layer_sql, $v, $t);
+    
+    while($layer_row = db_fetch_array($res_layer_sql))
+    {
+    ?>
+        <tr align='center'>
+        <td><input type='text' size='1' name='L_<?php echo $layer_row['layer_id']?>___layer_nr' 
+            value='<?php echo $layer_row['layer_pos']?>' readonly></td>
+        <td><input type='text' size='15' name='L_<?php echo $layer_row['layer_id']?>___layer_title' 
+            value='<?php echo $layer_row['layer_title']?>' readonly></td>
+        <td><input type='text' size='42' name='L_<?php echo $layer_row['layer_id']?>___layer_abstract'
+            value='<?php echo $layer_row['layer_abstract']?>'>
+
+    <?php
+        $keyword_sql = "SELECT keyword FROM keyword, layer_keyword, layer " .
+                       "WHERE keyword.keyword_id = layer_keyword.fkey_keyword_id " .
+                       "AND layer_keyword.fkey_layer_id = layer.layer_id " .
+                       "AND layer.fkey_wms_id = $1 " .
+                       "AND layer.layer_id = $2";
+        $v = array($wms_id, $layer_row['layer_id']);
+        $t = array("s", "i");
+        $res_keyword_sql = db_prep_query($keyword_sql, $v, $t);
+        $keywordList = "";
+        $seperator = "";
+        while($keyword_row = db_fetch_array($res_keyword_sql))
+        {
+            if($keywordList != "")
+            {    
+                $seperator = ",";
+            }
+            $keywordList .= $seperator.$keyword_row["keyword"];
+        }
+        ?>
+        <td><input type='text' size='42' name='L_<?php echo $layer_row['layer_id']?>___layer_keywords' 
+             value='<?php echo $keywordList?>'>        
+        </td>
+        <td>
+        <!--
+        <input type="button" value='preview' onclick="window.open('../frames/index.php?&gui_id=layer_preview&layer_preview=1&portal_services=<?php echo $layer_row['layer_id'];?>', 'mini_mapbender', 'height=370, width=370, dependent=yes');">
+        -->
+        </td>
+        <td>
+<?php 
+/*
+    $preview_sql = "SELECT * FROM layer_preview " .
+                   "WHERE fkey_layer_id = ".$layer_row['layer_id']."";
+    $res_preview_sql = db_query($preview_sql);
+	if(db_numrows($res_preview_sql)>0){?>
+        <!--
+        <input id="<?php echo $layer_row['layer_id'];?>_dp" type="button" value='delete preview' onclick="deletepreview('<?php echo $layer_row['layer_id'];?>');">
+        -->
+<?php }else{?>
+		<!--
+        <input id="<?php echo $layer_row['layer_id'];?>_dp" type="button" value='delete preview' style="display:none;" onclick="deletepreview('<?php echo $layer_row['layer_id'];?>');">
+        -->
+<?php }*/?>
+        </td>
+        </tr>
+    <?php
+    }
+    #editWMSByWMSID(961);
+    ?>
+    </table>
+    <input type='hidden' name='update_content' value=''/>
+    <input type='hidden' name='wms_id' value='<?php echo $wms_id ?>'/>
+	<!--
+    <input type="hidden" value='' name='delete_preview'>
+    -->
+    <input type="hidden" value='' name='layer_id'>
+    </form>
+    </body>
+    </html>
+<?php
+}
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_exportMapImage_server.php
===================================================================
--- branches/print_dev/http/php/mod_exportMapImage_server.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_exportMapImage_server.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,54 +1,54 @@
-<?php
-# $Id$
-# http://www.mapbender.org/ExportMapimage
-# 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(dirname(__FILE__) . "/../php/mb_validateSession.php");
-include_once(dirname(__FILE__)."/../classes/class_weldMaps2Image.php");
-
-$imageType = "";
-if(isset($_REQUEST["imagetype"])){
-	
-	$imageType = $_REQUEST["imagetype"];
-	
-}
-
-$urls = "";
-if(isset($_REQUEST["wms_urls"])){
-	
-	$wms_urls = $_REQUEST["wms_urls"];
-	
-}
-
-$array_file = array();
-$array_file["dir"]  = TMPDIR; 
-$array_file["filename"] = "image"; 
-
-$array_urls = explode("___", $wms_urls);
-foreach ($array_urls as $key => $value) {
-      if (is_null($value) || $value=="") {
-        unset($array_urls[$key]);
-      }
-}
-
-$new_array = array_values($array_urls); 
-		
-$image = new weldMaps2Image($new_array, $array_file);
-$image->getImage($imageType, 'file');
-
- 
+<?php
+# $Id$
+# http://www.mapbender.org/ExportMapimage
+# 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(dirname(__FILE__) . "/../php/mb_validateSession.php");
+include_once(dirname(__FILE__)."/../classes/class_weldMaps2Image.php");
+
+$imageType = "";
+if(isset($_REQUEST["imagetype"])){
+	
+	$imageType = $_REQUEST["imagetype"];
+	
+}
+
+$urls = "";
+if(isset($_REQUEST["wms_urls"])){
+	
+	$wms_urls = $_REQUEST["wms_urls"];
+	
+}
+
+$array_file = array();
+$array_file["dir"]  = TMPDIR; 
+$array_file["filename"] = "image"; 
+
+$array_urls = explode("___", $wms_urls);
+foreach ($array_urls as $key => $value) {
+      if (is_null($value) || $value=="") {
+        unset($array_urls[$key]);
+      }
+}
+
+$new_array = array_values($array_urls); 
+		
+$image = new weldMaps2Image($new_array, $array_file);
+$image->getImage($imageType, 'file');
+
+ 
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_featuretypeMetadata.php
===================================================================
--- branches/print_dev/http/php/mod_featuretypeMetadata.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_featuretypeMetadata.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,136 +1,136 @@
-<?php
-# $Id: mod_featuretypeMetadata.php 235 2007-09-20 verenadiewald $
-# http://www.mapbender.org/index.php/Administration
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-function display_text($string) {
-    $string = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
-    $string = eregi_replace("\n", "<br>", $string);
-    return $string;
-}  
-
-?>
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
-	<head>
-		<title>WFS Metadata</title>
-		<meta name="description" content="Metadata" xml:lang="en" />
-		<meta name="keywords" content="Metadaten" xml:lang="en" />		
-		<meta http-equiv="cache-control" content="no-cache">
-		<meta http-equiv="pragma" content="no-cache">
-		<meta http-equiv="expires" content="0">
-		<meta http-equiv="content-language" content="de" />
-		<meta http-equiv="content-style-type" content="text/css" />	
-		<link rel="stylesheet" type="text/css" href="../css/metadata.css" />		
-<?php
-	echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-	</head>
-	<body id="top">
-
-	
-
-<?php
-	$wfs_conf_id = $_GET['wfs_conf_id'];
-	//for testing only
-	#$wfs_conf_id = 1;
-	
-	$sql_id = "SELECT fkey_wfs_id, fkey_featuretype_id FROM wfs_conf WHERE wfs_conf_id = $1";
-	$v_id = array($wfs_conf_id);
-	$t_id = array('i');
-	$res_id = db_prep_query($sql_id,$v_id,$t_id);
-	$row_id = db_fetch_array($res_id);
-	$wfs_id = $row_id['fkey_wfs_id'];
-	$featuretype_id = $row_id['fkey_featuretype_id'];
-		
-	// retrieve the geometry type
-	$sql_geom = "SELECT a.element_type AS geom_type ";
-	$sql_geom .= "FROM wfs_element AS a, wfs_conf AS b, wfs_conf_element AS c ";
-	$sql_geom .= "WHERE a.fkey_featuretype_id = b.fkey_featuretype_id AND b.wfs_conf_id = $1 ";
-	$sql_geom .= "AND b.wfs_conf_id = c.fkey_wfs_conf_id AND c.f_geom = 1 AND c.f_id = a.element_id";
-	$v_geom = array($wfs_conf_id);
-	$t_geom = array('i');
-	$res_geom = db_prep_query($sql_geom, $v_geom, $t_geom);
-	$row_geom = db_fetch_array($res_geom);
-	$geomType = $row_geom['geom_type'];
-
-	$sql = "SELECT ";
-	$sql .= "ft.featuretype_id, ft.featuretype_title, ft.featuretype_srs, ft.featuretype_abstract, ";
-	$sql .= "wfs.wfs_title, wfs.wfs_abstract, wfs.wfs_id, wfs.fees, wfs.accessconstraints, wfs.individualname, ";
-	$sql .= "wfs.positionname, wfs.providername, wfs.deliverypoint, wfs.city, wfs.wfs_timestamp, wfs.wfs_owner, ";
-	$sql .= "wfs.country, wfs.postalcode, wfs.voice, wfs.facsimile, ";
-	$sql .= "wfs.electronicmailaddress, wfs.wfs_getcapabilities ";
-	$sql .= "FROM wfs, wfs_featuretype ft WHERE wfs.wfs_id = $1 AND ft.featuretype_id = $2 AND wfs.wfs_id = ft.fkey_wfs_id LIMIT 1";
-	$v = array($wfs_id,$featuretype_id);
-	$t = array('i','i');
-	$res = db_prep_query($sql,$v,$t);
-	echo db_error();
-	$wfs = array();
-	$row = db_fetch_array($res);
-	
-	$sql_dep = "SELECT mb_group_name FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND b.mb_user_department = a.mb_group_description LIMIT 1";
-	$v_dep = array($row['wfs_owner']);
-	$t_dep = array('i');
-	$res_dep = db_prep_query($sql_dep, $v_dep, $t_dep);
-	$row_dep = db_fetch_array($res_dep);
-	
-	$featuretype['ID'] = $featuretype_id;
-	$featuretype['Titel'] = $row['featuretype_title'];
-	$featuretype['Zusammenfassung'] = $row['featuretype_abstract'];
-	$featuretype['Koordinatensysteme'] = $row['featuretype_srs'];
-	$featuretype['Geometrietyp'] = $geomType;
-	$featuretype['Capabilities-Dokument'] = $row['wfs_getcapabilities'];
-	#$featuretype['Capabilities-Dokument'] = "<a href='".$row['wfs_getcapabilities']."' target=_blank>Capabilities-Dokument</a>";
-	if ($row['wfs_timestamp']) {
-		$layer['Datum der Registrierung'] = date("d.m.Y",$row['wfs_timestamp']); 
-	}
-	else {
-		$layer['Datum der Registrierung'] = "Keine Angabe"; 
-	}
-	$featuretype['Registrierende Stelle'] = $row_dep['mb_group_name'];
-	$featuretype['WFS ID'] = $row['wfs_id'];
-	$featuretype['WFS Titel'] = $row['wfs_title'];
-	$featuretype['WFS Zusammenfassung'] = $row['wfs_abstract'];
-	$featuretype['Geb&uuml;hren'] = $row['fees'];
-	$featuretype['Zugriffsbeschr&auml;nkung'] = $row['accessconstraints'];
-	$featuretype['Ansprechpartner'] = $row['individualname'];
-	$featuretype['Organisation'] = $row['providername'];
-	$featuretype['Adresse'] = $row['deliverypoint'];
-	$featuretype['Stadt'] = $row['city'];
-	$featuretype['PLZ'] = $row['postalcode'];
-	$featuretype['Telefon'] = $row['voice'];
-	$featuretype['Fax'] = $row['facsimile'];
-	$featuretype['E-Mail'] = $row['electronicmailaddress'];
-	$featuretype['Land'] = $row['country'];
-	
-	echo "<table >\n";
-	$t_a = "\t<tr>\n\t\t<th>\n\t\t\t";
-	$t_b = "\n\t\t</th>\n\t\t<td>\n\t\t\t";
-	$t_c = "\n\t\t</td>\n\t</tr>\n";
-
-	$keys = array_keys($featuretype);
-	for ($j=0; $j<count($featuretype); $j++) {
-		echo $t_a . utf8_encode($keys[$j]) . $t_b . display_text($featuretype[$keys[$j]]) . $t_c;
-	}
-	
-	echo "</td></tr></table>\n";
-?>
-
-	</body>
-</html>
+<?php
+# $Id: mod_featuretypeMetadata.php 235 2007-09-20 verenadiewald $
+# http://www.mapbender.org/index.php/Administration
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+function display_text($string) {
+    $string = eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    $string = eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    $string = eregi_replace("\n", "<br>", $string);
+    return $string;
+}  
+
+?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
+	<head>
+		<title>WFS Metadata</title>
+		<meta name="description" content="Metadata" xml:lang="en" />
+		<meta name="keywords" content="Metadaten" xml:lang="en" />		
+		<meta http-equiv="cache-control" content="no-cache">
+		<meta http-equiv="pragma" content="no-cache">
+		<meta http-equiv="expires" content="0">
+		<meta http-equiv="content-language" content="de" />
+		<meta http-equiv="content-style-type" content="text/css" />	
+		<link rel="stylesheet" type="text/css" href="../css/metadata.css" />		
+<?php
+	echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+	</head>
+	<body id="top">
+
+	
+
+<?php
+	$wfs_conf_id = $_GET['wfs_conf_id'];
+	//for testing only
+	#$wfs_conf_id = 1;
+	
+	$sql_id = "SELECT fkey_wfs_id, fkey_featuretype_id FROM wfs_conf WHERE wfs_conf_id = $1";
+	$v_id = array($wfs_conf_id);
+	$t_id = array('i');
+	$res_id = db_prep_query($sql_id,$v_id,$t_id);
+	$row_id = db_fetch_array($res_id);
+	$wfs_id = $row_id['fkey_wfs_id'];
+	$featuretype_id = $row_id['fkey_featuretype_id'];
+		
+	// retrieve the geometry type
+	$sql_geom = "SELECT a.element_type AS geom_type ";
+	$sql_geom .= "FROM wfs_element AS a, wfs_conf AS b, wfs_conf_element AS c ";
+	$sql_geom .= "WHERE a.fkey_featuretype_id = b.fkey_featuretype_id AND b.wfs_conf_id = $1 ";
+	$sql_geom .= "AND b.wfs_conf_id = c.fkey_wfs_conf_id AND c.f_geom = 1 AND c.f_id = a.element_id";
+	$v_geom = array($wfs_conf_id);
+	$t_geom = array('i');
+	$res_geom = db_prep_query($sql_geom, $v_geom, $t_geom);
+	$row_geom = db_fetch_array($res_geom);
+	$geomType = $row_geom['geom_type'];
+
+	$sql = "SELECT ";
+	$sql .= "ft.featuretype_id, ft.featuretype_title, ft.featuretype_srs, ft.featuretype_abstract, ";
+	$sql .= "wfs.wfs_title, wfs.wfs_abstract, wfs.wfs_id, wfs.fees, wfs.accessconstraints, wfs.individualname, ";
+	$sql .= "wfs.positionname, wfs.providername, wfs.deliverypoint, wfs.city, wfs.wfs_timestamp, wfs.wfs_owner, ";
+	$sql .= "wfs.country, wfs.postalcode, wfs.voice, wfs.facsimile, ";
+	$sql .= "wfs.electronicmailaddress, wfs.wfs_getcapabilities ";
+	$sql .= "FROM wfs, wfs_featuretype ft WHERE wfs.wfs_id = $1 AND ft.featuretype_id = $2 AND wfs.wfs_id = ft.fkey_wfs_id LIMIT 1";
+	$v = array($wfs_id,$featuretype_id);
+	$t = array('i','i');
+	$res = db_prep_query($sql,$v,$t);
+	echo db_error();
+	$wfs = array();
+	$row = db_fetch_array($res);
+	
+	$sql_dep = "SELECT mb_group_name FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND b.mb_user_department = a.mb_group_description LIMIT 1";
+	$v_dep = array($row['wfs_owner']);
+	$t_dep = array('i');
+	$res_dep = db_prep_query($sql_dep, $v_dep, $t_dep);
+	$row_dep = db_fetch_array($res_dep);
+	
+	$featuretype['ID'] = $featuretype_id;
+	$featuretype['Titel'] = $row['featuretype_title'];
+	$featuretype['Zusammenfassung'] = $row['featuretype_abstract'];
+	$featuretype['Koordinatensysteme'] = $row['featuretype_srs'];
+	$featuretype['Geometrietyp'] = $geomType;
+	$featuretype['Capabilities-Dokument'] = $row['wfs_getcapabilities'];
+	#$featuretype['Capabilities-Dokument'] = "<a href='".$row['wfs_getcapabilities']."' target=_blank>Capabilities-Dokument</a>";
+	if ($row['wfs_timestamp']) {
+		$layer['Datum der Registrierung'] = date("d.m.Y",$row['wfs_timestamp']); 
+	}
+	else {
+		$layer['Datum der Registrierung'] = "Keine Angabe"; 
+	}
+	$featuretype['Registrierende Stelle'] = $row_dep['mb_group_name'];
+	$featuretype['WFS ID'] = $row['wfs_id'];
+	$featuretype['WFS Titel'] = $row['wfs_title'];
+	$featuretype['WFS Zusammenfassung'] = $row['wfs_abstract'];
+	$featuretype['Geb&uuml;hren'] = $row['fees'];
+	$featuretype['Zugriffsbeschr&auml;nkung'] = $row['accessconstraints'];
+	$featuretype['Ansprechpartner'] = $row['individualname'];
+	$featuretype['Organisation'] = $row['providername'];
+	$featuretype['Adresse'] = $row['deliverypoint'];
+	$featuretype['Stadt'] = $row['city'];
+	$featuretype['PLZ'] = $row['postalcode'];
+	$featuretype['Telefon'] = $row['voice'];
+	$featuretype['Fax'] = $row['facsimile'];
+	$featuretype['E-Mail'] = $row['electronicmailaddress'];
+	$featuretype['Land'] = $row['country'];
+	
+	echo "<table >\n";
+	$t_a = "\t<tr>\n\t\t<th>\n\t\t\t";
+	$t_b = "\n\t\t</th>\n\t\t<td>\n\t\t\t";
+	$t_c = "\n\t\t</td>\n\t</tr>\n";
+
+	$keys = array_keys($featuretype);
+	for ($j=0; $j<count($featuretype); $j++) {
+		echo $t_a . utf8_encode($keys[$j]) . $t_b . display_text($featuretype[$keys[$j]]) . $t_c;
+	}
+	
+	echo "</td></tr></table>\n";
+?>
+
+	</body>
+</html>

Modified: branches/print_dev/http/php/mod_gazetteerMetadata.php
===================================================================
--- branches/print_dev/http/php/mod_gazetteerMetadata.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_gazetteerMetadata.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,268 +1,268 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/gazetteerMetadata
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-
-$user_id = $_SESSION["mb_user_id"]; 
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta name="author" content="V. Diewald">
-<meta http-equiv="cache-control" content="no-cache">
-<meta http-equiv="pragma" content="no-cache">
-<meta http-equiv="expires" content="0">
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<meta name="DC.Rights" content="WhereGroup GmbH & Co.KG, Bonn">
-<title>Metadata search</title>
-<?
-include_once(dirname(__FILE__) . "/../include/dyn_css.php");
-?>
-<style type="text/css">
-<!--
-	body{
-		font-family : Arial, Helvetica, sans-serif;
-		font-size : 12px;
-		font-weight : bold;
-		color: #808080;
-	}
-
-	a:link{
-		font-family : Arial, Helvetica, sans-serif;
-		text-decoration : none;
-		color: #808080;
-		font-size : 12px;
-		font-weight : normal;
-	}
-	a:visited{
-		font-family : Arial, Helvetica, sans-serif;
-		text-decoration : none;
-		color: #808080;
-		font-size : 12px;
-		font-weight : normal;
-	}
-	a:hover{
-		font-family : Arial, Helvetica, sans-serif;
-		color: #808080;
-		text-decoration : none;
-		font-weight : normal;
-	}
-	a:active{
-		font-family : Arial, Helvetica, sans-serif;
-		color: #808080;
-		text-decoration : none;
-		font-weight : normal;
-	}
-
-	.textfield{
-		border : 2 solid #D3D3D3;
-		font-family : Arial, Helvetica, sans-serif;
-		font-size : 12px;
-		font-weight : normal;
-		color: #000000;
-		width: 120px;
-	}
-	
-	.result{
-		position: absolute;
-		top: 40px;
-		left: 0px;
-	}
--->
-</style>
-<script type="text/javascript">
-<!--
-
-function validate(){
-
-   if(document.form1.search.value.length < 1){
-      alert("Please insert a keyword!");
-      document.form1.search.focus();
-      return false;
-   }
-   else{   
-		document.getElementById("resultDivTag").innerHTML = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
-		var ind = parent.getMapObjIndexByName('mapframe1');
-		
-		parent.mb_ajax_json(
-			"../php/mod_gazetteerMetadata_search.php", 
-			{
-				"search" : document.form1.search.value,
-				"srs" : parent.mb_mapObj[ind].epsg
-			}, 
-			function(jsonObj, status){
-				document.getElementById("resultDivTag").innerHTML = displayTable(jsonObj);
-			}
-		);
-		return false;
-   }
-}
-
-function displayTable(obj) {
-	var text = "<table>";
-	for (var attr in obj) {
-		var resultObj = obj[attr];
-		if (typeof(resultObj) != 'function') {
-			text += "<tr><td valign='top'>";
-			var imgUrl = "";
-			var onclickFunction = "";
-			if (typeof(resultObj.layer_name) !== "undefined") {
-				imgUrl = "../img/button_gray/metadata_layer.gif";
-				onclickFunction = "mod_addWMSLayerfromfilteredList(\"" + 
-					resultObj.wms_getcapabilities + "\",\"" + 
-					resultObj.wms_version + "\", \"" + 
-					resultObj.layer_name+"\");";
-			}
-			else {
-				imgUrl = "../img/button_gray/metadata_wms.gif";
-				onclickFunction = "mod_addWMSfromfilteredList(\"" + 
-					resultObj.wms_getcapabilities + "\",\"" + 
-					resultObj.wms_version+"\");";
-			}
-			text += "<img name='add_wms' src='" + imgUrl + "' ";
-			text += "border='0' title='Load' ";
-			text += "onclick='" + onclickFunction + "'>";
-			if (resultObj.extent && resultObj.extent[0] !== null) {
-				text += "<img src='../img/tree_new/zoom.png' " + 
-					"onclick='" + 
-					"parent.mb_calculateExtent(\"mapframe1\", " + 
-					resultObj.extent[0] + "," + 
-					resultObj.extent[1] + "," + 
-					resultObj.extent[2] + "," + 
-					resultObj.extent[3] + ");" + 
-					"parent.zoom(\"mapframe1\", \"true\", 1.0);" + 
-					"'>";
-			}
-			text += "</td><td>";
-			text += "<a href='#' ";
-			text += "onclick='javascript:window.open(\"mod_layerMetadata.php?id=" + 
-				resultObj.layer_id + 
-				"\", \"metadata\", \"width=450, height=600\");' title='Info'>"; 
-			text += resultObj.title+"</a>";	
-			text += "</td></tr>";
-		}
-	}
-	text += "</table>";
-	return text;
-}
-
-
-function handleLayer(sel_lay, wms_title){
-    
-	//var wms_title = document.forms[0].wmsTitle.value
-
-	var x = new Array();
-
-    x[0] = sel_lay;
-
-    var y = new Array();
-    
-    if (backlink =='parent'){
-		var wms_ID = parent.parent.getWMSIDByTitle('mapframe1',wms_title);
-	}
-	else{
-		var wms_ID = parent.getWMSIDByTitle('mapframe1',wms_title);
-	}
-
-    y[0] = wms_ID;
-    
-	//alert(wms_title + " -- X "+ x + "wms_id" + wms_ID);
-	
-	if (backlink =='parent'){
-		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
-		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);
-	}
-	else{
-		parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
-		parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);		
-	}
-
-}
-
-function mod_addWMSfromfilteredList(pointer_name,version){
-
-	pointer_name=pointer_name + parent.parent.mb_getConjunctionCharacter(pointer_name);
-	if (version == '1.0.0'){
-		var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
-		var load = cap;
-	}
-	else if (version == '1.1.0'){
-		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
-		var load = cap;
-	}
-	else if (version == '1.1.1'){
-		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
-		var load = cap;
-	}  
-	//alert (load);
-
-	if(load){
-		if(load.charAt(0) == '/' && load.charAt(1) == 'c'){
-			parent.parent.mod_addWMS_load('http://localhost' + load);
-		}
-		else{
-			parent.parent.mod_addWMS_load(load);
-		}  
-	}
-}
-
-function mod_addWMSLayerfromfilteredList(pointer_name,version,layer_name){
-
-	pointer_name=pointer_name + parent.parent.mb_getConjunctionCharacter(pointer_name);
-	if (version == '1.0.0'){
-		var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
-		var load = cap;
-		var layer_name = layer_name;
-	}
-	else if (version == '1.1.0'){
-		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
-		var load = cap;
-		var layer_name = layer_name;
-	}
-	else if (version == '1.1.1'){
-		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
-		var load = cap;
-		var layer_name = layer_name;
-	}  
-	//alert (load);
-
-	if(load){
-		if(load.charAt(0) == '/' && load.charAt(1) == 'c'){
-			parent.parent.mod_addLayer_load('http://localhost' + load, layer_name);
-		}
-		else{
-			parent.parent.mod_addLayer_load(load, layer_name);
-		}  
-	}
-}
-// -->
-</script>
-</head>
-<body leftmargin="2" topmargin="0" bgcolor="#ffffff">
-<form name='form1' target='result' onsubmit='return validate();'>
-<p>
-<input class='textfield' name='search' type='text' style='width:110px'>
-<img src="../img/add.png" title="keywords" onclick="window.open('mod_SelectKeyword.php','SelectKeyword','width=600,height=400,status=no');">
-<input type='submit' name='send' value='ok'>
-</p>
-</form>
-<div id='resultDivTag' class='result'></div>
-</body>
-</html>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/gazetteerMetadata
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+
+$user_id = $_SESSION["mb_user_id"]; 
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta name="author" content="V. Diewald">
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="0">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta name="DC.Rights" content="WhereGroup GmbH & Co.KG, Bonn">
+<title>Metadata search</title>
+<?
+include_once(dirname(__FILE__) . "/../include/dyn_css.php");
+?>
+<style type="text/css">
+<!--
+	body{
+		font-family : Arial, Helvetica, sans-serif;
+		font-size : 12px;
+		font-weight : bold;
+		color: #808080;
+	}
+
+	a:link{
+		font-family : Arial, Helvetica, sans-serif;
+		text-decoration : none;
+		color: #808080;
+		font-size : 12px;
+		font-weight : normal;
+	}
+	a:visited{
+		font-family : Arial, Helvetica, sans-serif;
+		text-decoration : none;
+		color: #808080;
+		font-size : 12px;
+		font-weight : normal;
+	}
+	a:hover{
+		font-family : Arial, Helvetica, sans-serif;
+		color: #808080;
+		text-decoration : none;
+		font-weight : normal;
+	}
+	a:active{
+		font-family : Arial, Helvetica, sans-serif;
+		color: #808080;
+		text-decoration : none;
+		font-weight : normal;
+	}
+
+	.textfield{
+		border : 2 solid #D3D3D3;
+		font-family : Arial, Helvetica, sans-serif;
+		font-size : 12px;
+		font-weight : normal;
+		color: #000000;
+		width: 120px;
+	}
+	
+	.result{
+		position: absolute;
+		top: 40px;
+		left: 0px;
+	}
+-->
+</style>
+<script type="text/javascript">
+<!--
+
+function validate(){
+
+   if(document.form1.search.value.length < 1){
+      alert("Please insert a keyword!");
+      document.form1.search.focus();
+      return false;
+   }
+   else{   
+		document.getElementById("resultDivTag").innerHTML = "<table><tr><td><img src='../img/indicator_wheel.gif'></td><td>Searching...</td></tr></table>";
+		var ind = parent.getMapObjIndexByName('mapframe1');
+		
+		parent.mb_ajax_json(
+			"../php/mod_gazetteerMetadata_search.php", 
+			{
+				"search" : document.form1.search.value,
+				"srs" : parent.mb_mapObj[ind].epsg
+			}, 
+			function(jsonObj, status){
+				document.getElementById("resultDivTag").innerHTML = displayTable(jsonObj);
+			}
+		);
+		return false;
+   }
+}
+
+function displayTable(obj) {
+	var text = "<table>";
+	for (var attr in obj) {
+		var resultObj = obj[attr];
+		if (typeof(resultObj) != 'function') {
+			text += "<tr><td valign='top'>";
+			var imgUrl = "";
+			var onclickFunction = "";
+			if (typeof(resultObj.layer_name) !== "undefined") {
+				imgUrl = "../img/button_gray/metadata_layer.gif";
+				onclickFunction = "mod_addWMSLayerfromfilteredList(\"" + 
+					resultObj.wms_getcapabilities + "\",\"" + 
+					resultObj.wms_version + "\", \"" + 
+					resultObj.layer_name+"\");";
+			}
+			else {
+				imgUrl = "../img/button_gray/metadata_wms.gif";
+				onclickFunction = "mod_addWMSfromfilteredList(\"" + 
+					resultObj.wms_getcapabilities + "\",\"" + 
+					resultObj.wms_version+"\");";
+			}
+			text += "<img name='add_wms' src='" + imgUrl + "' ";
+			text += "border='0' title='Load' ";
+			text += "onclick='" + onclickFunction + "'>";
+			if (resultObj.extent && resultObj.extent[0] !== null) {
+				text += "<img src='../img/tree_new/zoom.png' " + 
+					"onclick='" + 
+					"parent.mb_calculateExtent(\"mapframe1\", " + 
+					resultObj.extent[0] + "," + 
+					resultObj.extent[1] + "," + 
+					resultObj.extent[2] + "," + 
+					resultObj.extent[3] + ");" + 
+					"parent.zoom(\"mapframe1\", \"true\", 1.0);" + 
+					"'>";
+			}
+			text += "</td><td>";
+			text += "<a href='#' ";
+			text += "onclick='javascript:window.open(\"mod_layerMetadata.php?id=" + 
+				resultObj.layer_id + 
+				"\", \"metadata\", \"width=450, height=600\");' title='Info'>"; 
+			text += resultObj.title+"</a>";	
+			text += "</td></tr>";
+		}
+	}
+	text += "</table>";
+	return text;
+}
+
+
+function handleLayer(sel_lay, wms_title){
+    
+	//var wms_title = document.forms[0].wmsTitle.value
+
+	var x = new Array();
+
+    x[0] = sel_lay;
+
+    var y = new Array();
+    
+    if (backlink =='parent'){
+		var wms_ID = parent.parent.getWMSIDByTitle('mapframe1',wms_title);
+	}
+	else{
+		var wms_ID = parent.getWMSIDByTitle('mapframe1',wms_title);
+	}
+
+    y[0] = wms_ID;
+    
+	//alert(wms_title + " -- X "+ x + "wms_id" + wms_ID);
+	
+	if (backlink =='parent'){
+		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
+		parent.parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);
+	}
+	else{
+		parent.handleSelectedLayer_array('mapframe1',y,x,'querylayer',1);
+		parent.handleSelectedLayer_array('mapframe1',y,x,'visible',1);		
+	}
+
+}
+
+function mod_addWMSfromfilteredList(pointer_name,version){
+
+	pointer_name=pointer_name + parent.parent.mb_getConjunctionCharacter(pointer_name);
+	if (version == '1.0.0'){
+		var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
+		var load = cap;
+	}
+	else if (version == '1.1.0'){
+		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
+		var load = cap;
+	}
+	else if (version == '1.1.1'){
+		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
+		var load = cap;
+	}  
+	//alert (load);
+
+	if(load){
+		if(load.charAt(0) == '/' && load.charAt(1) == 'c'){
+			parent.parent.mod_addWMS_load('http://localhost' + load);
+		}
+		else{
+			parent.parent.mod_addWMS_load(load);
+		}  
+	}
+}
+
+function mod_addWMSLayerfromfilteredList(pointer_name,version,layer_name){
+
+	pointer_name=pointer_name + parent.parent.mb_getConjunctionCharacter(pointer_name);
+	if (version == '1.0.0'){
+		var cap = pointer_name + "REQUEST=capabilities&WMTVER=1.0.0";
+		var load = cap;
+		var layer_name = layer_name;
+	}
+	else if (version == '1.1.0'){
+		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0";
+		var load = cap;
+		var layer_name = layer_name;
+	}
+	else if (version == '1.1.1'){
+		var cap = pointer_name + "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1";
+		var load = cap;
+		var layer_name = layer_name;
+	}  
+	//alert (load);
+
+	if(load){
+		if(load.charAt(0) == '/' && load.charAt(1) == 'c'){
+			parent.parent.mod_addLayer_load('http://localhost' + load, layer_name);
+		}
+		else{
+			parent.parent.mod_addLayer_load(load, layer_name);
+		}  
+	}
+}
+// -->
+</script>
+</head>
+<body leftmargin="2" topmargin="0" bgcolor="#ffffff">
+<form name='form1' target='result' onsubmit='return validate();'>
+<p>
+<input class='textfield' name='search' type='text' style='width:110px'>
+<img src="../img/add.png" title="keywords" onclick="window.open('mod_SelectKeyword.php','SelectKeyword','width=600,height=400,status=no');">
+<input type='submit' name='send' value='ok'>
+</p>
+</form>
+<div id='resultDivTag' class='result'></div>
+</body>
+</html>

Modified: branches/print_dev/http/php/mod_gazetteerMetadata_search.php
===================================================================
--- branches/print_dev/http/php/mod_gazetteerMetadata_search.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_gazetteerMetadata_search.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,125 +1,125 @@
-<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-require_once(dirname(__FILE__)."/../classes/class_json.php");
-
-$json = new Mapbender_JSON();
-
-$user_id = $_SESSION["mb_user_id"];
-$query = stripslashes($_REQUEST["search"]);
-$srs = stripslashes($_REQUEST["srs"]);
-
-if (!preg_match("/^[a-zA-Z_\- ]+$/", $query)) {
-	echo "[]"; die;
-}
-
-if (!preg_match("/^[a-zA-Z_\-:0-9 ]+$/", $srs)) {
-	echo "[]"; die;
-}
-
-$n = new administration();
-$myguis = $n->getGuisByPermission($user_id, true);
-$mywms = $n->getWmsByOwnGuis($myguis);
-
-if($mywms == false){
-	$mywms = array();	
-}
-$mylayer = array();
-
-for($i = 0; $i < count($mywms); $i++){
-	$mylayer = array_merge($mylayer,$n->getLayerByWms($mywms[$i]));
-}
-
-$res_container_wms = array();
-$res_container_layer = array();
-$obj = array();
-
-if(preg_match("/\*/",$_REQUEST["search"])){
-	$search = trim(preg_replace("/\*/i","", $_REQUEST["search"]));
-}
-
-if (count($mywms) > 0) {
-	$v = array();   
-	$t = array();   
-
-	$sql_wms = "SELECT DISTINCT layer.layer_id, wms.wms_title, " . 
-		"wms.wms_getcapabilities, wms.wms_version, " . 
-		"e.minx, e.miny, e.maxx, e.maxy " . 
-		"FROM wms LEFT JOIN layer ON wms.wms_id = layer.fkey_wms_id " . 
-		"LEFT JOIN layer_epsg e ON layer.layer_id = e.fkey_layer_id " . 
-		"AND e.epsg = '$srs' " . 
-		"WHERE layer.layer_pos = 0 AND wms.wms_id IN ("; 
-	for($i=0; $i<count($mywms); $i++){
-		if ($i > 0) {$sql_wms .= ",";}
-		$sql_wms .= "$".($i+1);
-		array_push($v, $mywms[$i]);
-		array_push($t, 'i');   
-	}
-	$sql_wms .= ") AND (wms_title ILIKE '%".$query."%' OR wms_abstract ILIKE '%".$query."%') ORDER BY wms_title";
-	$res_wms = db_prep_query($sql_wms,$v,$t);
-
-	while ($row = db_fetch_array($res_wms)) {
-		array_push($obj, array(
-			'wms_getcapabilities' => $row['wms_getcapabilities'], 
-			'wms_version' => $row['wms_version'], 
-			'layer_id' => $row['layer_id'], 
-			'title' => $row['wms_title'],
-			'extent' => array(
-				$row['minx'],
-				$row['miny'],
-				$row['maxx'],
-				$row['maxy']
-			)
-		));
-	}
-}
-
-if (count($mylayer) > 0) {
-	$v = array();   
-	$t = array();   
-	$sql_layer = "SELECT DISTINCT l.layer_id, l.fkey_wms_id, l.layer_title, " . 
-		"l.layer_name, w.wms_getcapabilities, w.wms_version, " . 
-		"e.minx, e.miny, e.maxx, e.maxy " . 
-		"FROM layer l LEFT JOIN layer_keyword lkw " . 
-		"LEFT JOIN keyword kw ON kw.keyword_id = lkw.fkey_keyword_id " . 
-		"ON l.layer_id = lkw.fkey_layer_id " . 
-		"LEFT JOIN wms w ON l.fkey_wms_id = w.wms_id " . 
-		"LEFT JOIN layer_epsg e ON l.layer_id = e.fkey_layer_id " . 
-		"AND e.epsg = '$srs' " . 
-		"WHERE l.layer_id IN (";
-
-	for($i = 0; $i < count($mylayer); $i++){
-		if ($i > 0) {$sql_layer .= ",";}
-		$sql_layer .= "$".($i+1);
-		array_push($v, $mylayer[$i]);
-		array_push($t, 'i');   
-	}
-
-	$sql_layer .= ") AND (" . 
-		"layer_title ILIKE '%".$query."%' OR " . 
-		"layer_name ILIKE '%".$query."%' OR " . 
-		"layer_abstract ILIKE '%".$query."%' OR " . 
-		"kw.keyword ILIKE '%".$query."%') ";
-	$sql_layer .= "ORDER BY l.layer_title;";
-	$res_layer = db_prep_query($sql_layer,$v,$t);
-
-
-	while ($row = db_fetch_array($res_layer)) {
-		array_push($obj, array(
-			'wms_getcapabilities' => $row['wms_getcapabilities'], 
-			'wms_version' => $row['wms_version'], 
-			'layer_name' => $row['layer_name'], 
-			'layer_id' => $row['layer_id'], 
-			'title' => $row['layer_title'],
-			'extent' => array(
-				$row['minx'],
-				$row['miny'],
-				$row['maxx'],
-				$row['maxy']
-			)
-		));
-	}
-}
-$output = $json->encode($obj);
-echo $output;
-?>
+<?php
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_json.php");
+
+$json = new Mapbender_JSON();
+
+$user_id = $_SESSION["mb_user_id"];
+$query = stripslashes($_REQUEST["search"]);
+$srs = stripslashes($_REQUEST["srs"]);
+
+if (!preg_match("/^[a-zA-Z_\- ]+$/", $query)) {
+	echo "[]"; die;
+}
+
+if (!preg_match("/^[a-zA-Z_\-:0-9 ]+$/", $srs)) {
+	echo "[]"; die;
+}
+
+$n = new administration();
+$myguis = $n->getGuisByPermission($user_id, true);
+$mywms = $n->getWmsByOwnGuis($myguis);
+
+if($mywms == false){
+	$mywms = array();	
+}
+$mylayer = array();
+
+for($i = 0; $i < count($mywms); $i++){
+	$mylayer = array_merge($mylayer,$n->getLayerByWms($mywms[$i]));
+}
+
+$res_container_wms = array();
+$res_container_layer = array();
+$obj = array();
+
+if(preg_match("/\*/",$_REQUEST["search"])){
+	$search = trim(preg_replace("/\*/i","", $_REQUEST["search"]));
+}
+
+if (count($mywms) > 0) {
+	$v = array();   
+	$t = array();   
+
+	$sql_wms = "SELECT DISTINCT layer.layer_id, wms.wms_title, " . 
+		"wms.wms_getcapabilities, wms.wms_version, " . 
+		"e.minx, e.miny, e.maxx, e.maxy " . 
+		"FROM wms LEFT JOIN layer ON wms.wms_id = layer.fkey_wms_id " . 
+		"LEFT JOIN layer_epsg e ON layer.layer_id = e.fkey_layer_id " . 
+		"AND e.epsg = '$srs' " . 
+		"WHERE layer.layer_pos = 0 AND wms.wms_id IN ("; 
+	for($i=0; $i<count($mywms); $i++){
+		if ($i > 0) {$sql_wms .= ",";}
+		$sql_wms .= "$".($i+1);
+		array_push($v, $mywms[$i]);
+		array_push($t, 'i');   
+	}
+	$sql_wms .= ") AND (wms_title ILIKE '%".$query."%' OR wms_abstract ILIKE '%".$query."%') ORDER BY wms_title";
+	$res_wms = db_prep_query($sql_wms,$v,$t);
+
+	while ($row = db_fetch_array($res_wms)) {
+		array_push($obj, array(
+			'wms_getcapabilities' => $row['wms_getcapabilities'], 
+			'wms_version' => $row['wms_version'], 
+			'layer_id' => $row['layer_id'], 
+			'title' => $row['wms_title'],
+			'extent' => array(
+				$row['minx'],
+				$row['miny'],
+				$row['maxx'],
+				$row['maxy']
+			)
+		));
+	}
+}
+
+if (count($mylayer) > 0) {
+	$v = array();   
+	$t = array();   
+	$sql_layer = "SELECT DISTINCT l.layer_id, l.fkey_wms_id, l.layer_title, " . 
+		"l.layer_name, w.wms_getcapabilities, w.wms_version, " . 
+		"e.minx, e.miny, e.maxx, e.maxy " . 
+		"FROM layer l LEFT JOIN layer_keyword lkw " . 
+		"LEFT JOIN keyword kw ON kw.keyword_id = lkw.fkey_keyword_id " . 
+		"ON l.layer_id = lkw.fkey_layer_id " . 
+		"LEFT JOIN wms w ON l.fkey_wms_id = w.wms_id " . 
+		"LEFT JOIN layer_epsg e ON l.layer_id = e.fkey_layer_id " . 
+		"AND e.epsg = '$srs' " . 
+		"WHERE l.layer_id IN (";
+
+	for($i = 0; $i < count($mylayer); $i++){
+		if ($i > 0) {$sql_layer .= ",";}
+		$sql_layer .= "$".($i+1);
+		array_push($v, $mylayer[$i]);
+		array_push($t, 'i');   
+	}
+
+	$sql_layer .= ") AND (" . 
+		"layer_title ILIKE '%".$query."%' OR " . 
+		"layer_name ILIKE '%".$query."%' OR " . 
+		"layer_abstract ILIKE '%".$query."%' OR " . 
+		"kw.keyword ILIKE '%".$query."%') ";
+	$sql_layer .= "ORDER BY l.layer_title;";
+	$res_layer = db_prep_query($sql_layer,$v,$t);
+
+
+	while ($row = db_fetch_array($res_layer)) {
+		array_push($obj, array(
+			'wms_getcapabilities' => $row['wms_getcapabilities'], 
+			'wms_version' => $row['wms_version'], 
+			'layer_name' => $row['layer_name'], 
+			'layer_id' => $row['layer_id'], 
+			'title' => $row['layer_title'],
+			'extent' => array(
+				$row['minx'],
+				$row['miny'],
+				$row['maxx'],
+				$row['maxy']
+			)
+		));
+	}
+}
+$output = $json->encode($obj);
+echo $output;
+?>

Modified: branches/print_dev/http/php/mod_gazetteerSQL_server.php
===================================================================
--- branches/print_dev/http/php/mod_gazetteerSQL_server.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_gazetteerSQL_server.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,199 +1,199 @@
-<?php
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_json.php");
-require_once(dirname(__FILE__)."/../../conf/gazetteerSQL.conf");
-
-$con = 	pg_connect($connstring);		
-
-$command = $_GET["command"];
-$communeId = $_GET["communeId"];
-$streetName = $_GET["streetName"];
-$districtId = $_GET["districtId"];
-$parcelNumber1 = $_GET["parcelNumber1"];
-$parcelNumber2 = $_GET["parcelNumber2"];
-$ownerQueryString = $_GET["ownerQueryString"];
-$numberOfResults = $_GET["numberOfResults"];
-
-if (isLimited($numberOfResults)) {
-	$limit = $numberOfResults + 1; 
-}
-else {
-	$limit = 0;
-}
-
-$obj = array();
-
-function isLimited($numberOfResults) {
-	if (isset($numberOfResults) && $numberOfResults > 0) {
-		return true;
-	}
-	return false;
-}
-
-function isUnderLimit($counter, $numberOfResults, $max) {
-	return (!isLimited($numberOfResults) || $counter <= $max);
-}
-
-function isOverLimit($counter, $numberOfResults, $max) {
-	return (isLimited($numberOfResults) && $counter > $max);
-}
-
-if ($command == "getCommunes") {
-	$obj["communes"] = array();
-
-	$sql = "SELECT DISTINCT gkz, name FROM public.gemeinden ORDER BY name";
-	$v = array();
-	$t = array();
-	$res = db_prep_query($sql, $v, $t);
-	while($row = db_fetch_array($res)){
-		$communeId = trim($row["gkz"]);
-		$communeName = trim($row["name"]);
-		$obj["communes"][$communeId] = $communeName;
-	}
-	$obj["limited"] = false;
-}
-else if ($command == "getStreets") {
-	$obj["streets"] = array();
-
-	if (!empty($communeId)) {
-		$sql = "SELECT DISTINCT strk_schl, str_name FROM alb.navigation WHERE gkz = $1 ORDER BY str_name";
-		$v = array($communeId);
-		$t = array("i");
-	}
-	else {
-		$sql = "SELECT DISTINCT strk_schl, str_name FROM alb.navigation ORDER BY str_name";
-		$v = array();
-		$t = array();
-	}
-	$res = db_prep_query($sql, $v, $t);
-	while($row = db_fetch_array($res)){
-		$streetId = trim($row["strk_schl"]);
-		$streetName = trim($row["str_name"]);
-		$obj["streets"][$streetId] = $streetName;
-	}
-	$obj["limited"] = false;
-}
-else if ($command == "getNumbers") {
-	$obj["houseNumbers"] = array();
-	$paramCounter = 0;
-	
-	if (!empty($communeId)) {
-		$sql = "SELECT DISTINCT hnr, hnrzu, rw, hw FROM alb.navigation WHERE gkz = $". ++$paramCount ." AND str_name ILIKE $". ++$paramCount ." ORDER BY hnr, hnrzu";
-		$v = array($communeId, $streetName."%");
-		$t = array("i", "s");
-	}
-	else {
-		$sql = "SELECT DISTINCT hnr, hnrzu, rw, hw FROM alb.navigation WHERE str_name ILIKE $". ++$paramCount ." ORDER BY hnr, hnrzu";
-		$v = array($streetName."%");
-		$t = array("s");
-	}
-
-	if (isLimited($numberOfResults)) {
-		$sql .= " LIMIT $". ++$paramCount;
-		array_push($v, $limit);
-		array_push($t, "i");
-	}
-
-	$res = db_prep_query($sql, $v, $t);
-
-	$counter = 0;
-	while($row = db_fetch_array($res)){
-		$counter++;
-		if (isUnderLimit($counter, $numberOfResults, $numberOfResults)) {
-			$houseNumber = trim($row["hnr"] . $row["hnrzu"]);
-			$x = trim(floatval($row["rw"]));
-			$y = trim(floatval($row["hw"]));
-			$obj["houseNumbers"][$houseNumber] = array("x" => $x, "y" => $y);
-		}
-	}
-	$obj["limited"] = isOverLimit($counter, $numberOfResults, $numberOfResults);
-}
-else if ($command == "getLandparcelsByOwner") {
-	$obj["landparcels"] = array();
-
-	$sql = "SELECT DISTINCT eig.e_name, flst.flst_kennz, flst.rechtsw, flst.hochw FROM alb.albflst AS flst JOIN alb.albeig AS eig ON (flst.gemschl = eig.gemschl AND flst.flur = eig.flur AND flst.flstz = eig.flstz AND flst.flstn = eig.flstn) JOIN public.gemarkungen AS gem ON (flst.gemschl = gem.gemschl) WHERE gem.gkz = $1 AND eig.e_name ILIKE $2 ORDER BY flst.flst_kennz";
-	$v = array($communeId, "%".$ownerQueryString."%");
-	$t = array("i", "s");
-
-	if (isLimited($numberOfResults)) {
-		$sql .= " LIMIT $3";
-		array_push($v, $limit);
-		array_push($t, "i");
-	}
-	$res = db_prep_query($sql, $v, $t);
-
-	$counter = 0;
-	while($row = db_fetch_array($res)){
-		$counter++;
-		if (isUnderLimit($counter, $numberOfResults, $numberOfResults)) {
-			$landparcelId = $row["flst_kennz"];
-			$x = trim(floatval($row["rechtsw"]));
-			$y = trim(floatval($row["hochw"]));
-			$owner = trim($row["e_name"]);
-			array_push($obj["landparcels"], array("landparcelId" => $landparcelId, "owner" => $owner, "x" => $x, "y" => $y));
-		}
-	}
-	$obj["limited"] = isOverLimit($counter, $numberOfResults, $numberOfResults);
-}
-else if ($command == "getLandparcelsByDistrict") {
-	$obj["landparcels"] = array();
-	$paramCounter = 0;
-
-	$sql = "SELECT DISTINCT flst_kennz, rechtsw, hochw FROM alb.albflst WHERE gemschl = $" . ++$paramCounter;
-	$v = array($districtId);
-	$t = array("i");
-	if (!empty($parcelNumber1)) {
-		$sql .= " AND flur = $" . ++$paramCounter;
-		array_push($v, $parcelNumber1);
-		array_push($t, "i");
-	}
-	if (!empty($parcelNumber2)) {
-		$sql .= " AND flstz = $" . ++$paramCounter;
-		array_push($v, $parcelNumber2);
-		array_push($t, "i");
-	}
-	$sql .= " ORDER BY flst_kennz";
-	if (isLimited($numberOfResults)) {
-		$sql .= " LIMIT $" . ++$paramCounter;
-		array_push($v, $limit);
-		array_push($t, "i");
-	}
-	$res = db_prep_query($sql, $v, $t);
-
-	$counter = 0;
-	while($row = db_fetch_array($res)){
-		$counter++;
-		if (isUnderLimit($counter, $numberOfResults, $numberOfResults)) {
-			$landparcelId = $row["flst_kennz"];
-			$x = trim(floatval($row["rechtsw"]));
-			$y = trim(floatval($row["hochw"]));
-
-			$obj["landparcels"][$landparcelId] = array("x" => $x, "y" => $y);
-		}
-	}
-	$obj["limited"] = isOverLimit($counter, $numberOfResults, $numberOfResults);
-}
-else if ($command == "getDistricts") {
-	$obj["districts"] = array();
-
-	$sql = "SELECT DISTINCT gemschl, name FROM public.gemarkungen WHERE gkz = $1 ORDER BY name";
-	$v = array($communeId);
-	$t = array("i");
-	$res = db_prep_query($sql, $v, $t);
-
-	while($row = db_fetch_array($res)){
-		$districtID = trim($row["gemschl"]);
-		$districtName = trim($row["name"]);
-		$obj["districts"][$districtID] = $districtName;
-	}
-	$obj["limited"] = false;
-}
-else {
-	// unknown command
-	$e = new mb_exception("unknown command: " . $command);
-}
-
-$json = new Mapbender_JSON();
-$output = $json->encode($obj);
-echo $output;
+<?php
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_json.php");
+require_once(dirname(__FILE__)."/../../conf/gazetteerSQL.conf");
+
+$con = 	pg_connect($connstring);		
+
+$command = $_GET["command"];
+$communeId = $_GET["communeId"];
+$streetName = $_GET["streetName"];
+$districtId = $_GET["districtId"];
+$parcelNumber1 = $_GET["parcelNumber1"];
+$parcelNumber2 = $_GET["parcelNumber2"];
+$ownerQueryString = $_GET["ownerQueryString"];
+$numberOfResults = $_GET["numberOfResults"];
+
+if (isLimited($numberOfResults)) {
+	$limit = $numberOfResults + 1; 
+}
+else {
+	$limit = 0;
+}
+
+$obj = array();
+
+function isLimited($numberOfResults) {
+	if (isset($numberOfResults) && $numberOfResults > 0) {
+		return true;
+	}
+	return false;
+}
+
+function isUnderLimit($counter, $numberOfResults, $max) {
+	return (!isLimited($numberOfResults) || $counter <= $max);
+}
+
+function isOverLimit($counter, $numberOfResults, $max) {
+	return (isLimited($numberOfResults) && $counter > $max);
+}
+
+if ($command == "getCommunes") {
+	$obj["communes"] = array();
+
+	$sql = "SELECT DISTINCT gkz, name FROM public.gemeinden ORDER BY name";
+	$v = array();
+	$t = array();
+	$res = db_prep_query($sql, $v, $t);
+	while($row = db_fetch_array($res)){
+		$communeId = trim($row["gkz"]);
+		$communeName = trim($row["name"]);
+		$obj["communes"][$communeId] = $communeName;
+	}
+	$obj["limited"] = false;
+}
+else if ($command == "getStreets") {
+	$obj["streets"] = array();
+
+	if (!empty($communeId)) {
+		$sql = "SELECT DISTINCT strk_schl, str_name FROM alb.navigation WHERE gkz = $1 ORDER BY str_name";
+		$v = array($communeId);
+		$t = array("i");
+	}
+	else {
+		$sql = "SELECT DISTINCT strk_schl, str_name FROM alb.navigation ORDER BY str_name";
+		$v = array();
+		$t = array();
+	}
+	$res = db_prep_query($sql, $v, $t);
+	while($row = db_fetch_array($res)){
+		$streetId = trim($row["strk_schl"]);
+		$streetName = trim($row["str_name"]);
+		$obj["streets"][$streetId] = $streetName;
+	}
+	$obj["limited"] = false;
+}
+else if ($command == "getNumbers") {
+	$obj["houseNumbers"] = array();
+	$paramCounter = 0;
+	
+	if (!empty($communeId)) {
+		$sql = "SELECT DISTINCT hnr, hnrzu, rw, hw FROM alb.navigation WHERE gkz = $". ++$paramCount ." AND str_name ILIKE $". ++$paramCount ." ORDER BY hnr, hnrzu";
+		$v = array($communeId, $streetName."%");
+		$t = array("i", "s");
+	}
+	else {
+		$sql = "SELECT DISTINCT hnr, hnrzu, rw, hw FROM alb.navigation WHERE str_name ILIKE $". ++$paramCount ." ORDER BY hnr, hnrzu";
+		$v = array($streetName."%");
+		$t = array("s");
+	}
+
+	if (isLimited($numberOfResults)) {
+		$sql .= " LIMIT $". ++$paramCount;
+		array_push($v, $limit);
+		array_push($t, "i");
+	}
+
+	$res = db_prep_query($sql, $v, $t);
+
+	$counter = 0;
+	while($row = db_fetch_array($res)){
+		$counter++;
+		if (isUnderLimit($counter, $numberOfResults, $numberOfResults)) {
+			$houseNumber = trim($row["hnr"] . $row["hnrzu"]);
+			$x = trim(floatval($row["rw"]));
+			$y = trim(floatval($row["hw"]));
+			$obj["houseNumbers"][$houseNumber] = array("x" => $x, "y" => $y);
+		}
+	}
+	$obj["limited"] = isOverLimit($counter, $numberOfResults, $numberOfResults);
+}
+else if ($command == "getLandparcelsByOwner") {
+	$obj["landparcels"] = array();
+
+	$sql = "SELECT DISTINCT eig.e_name, flst.flst_kennz, flst.rechtsw, flst.hochw FROM alb.albflst AS flst JOIN alb.albeig AS eig ON (flst.gemschl = eig.gemschl AND flst.flur = eig.flur AND flst.flstz = eig.flstz AND flst.flstn = eig.flstn) JOIN public.gemarkungen AS gem ON (flst.gemschl = gem.gemschl) WHERE gem.gkz = $1 AND eig.e_name ILIKE $2 ORDER BY flst.flst_kennz";
+	$v = array($communeId, "%".$ownerQueryString."%");
+	$t = array("i", "s");
+
+	if (isLimited($numberOfResults)) {
+		$sql .= " LIMIT $3";
+		array_push($v, $limit);
+		array_push($t, "i");
+	}
+	$res = db_prep_query($sql, $v, $t);
+
+	$counter = 0;
+	while($row = db_fetch_array($res)){
+		$counter++;
+		if (isUnderLimit($counter, $numberOfResults, $numberOfResults)) {
+			$landparcelId = $row["flst_kennz"];
+			$x = trim(floatval($row["rechtsw"]));
+			$y = trim(floatval($row["hochw"]));
+			$owner = trim($row["e_name"]);
+			array_push($obj["landparcels"], array("landparcelId" => $landparcelId, "owner" => $owner, "x" => $x, "y" => $y));
+		}
+	}
+	$obj["limited"] = isOverLimit($counter, $numberOfResults, $numberOfResults);
+}
+else if ($command == "getLandparcelsByDistrict") {
+	$obj["landparcels"] = array();
+	$paramCounter = 0;
+
+	$sql = "SELECT DISTINCT flst_kennz, rechtsw, hochw FROM alb.albflst WHERE gemschl = $" . ++$paramCounter;
+	$v = array($districtId);
+	$t = array("i");
+	if (!empty($parcelNumber1)) {
+		$sql .= " AND flur = $" . ++$paramCounter;
+		array_push($v, $parcelNumber1);
+		array_push($t, "i");
+	}
+	if (!empty($parcelNumber2)) {
+		$sql .= " AND flstz = $" . ++$paramCounter;
+		array_push($v, $parcelNumber2);
+		array_push($t, "i");
+	}
+	$sql .= " ORDER BY flst_kennz";
+	if (isLimited($numberOfResults)) {
+		$sql .= " LIMIT $" . ++$paramCounter;
+		array_push($v, $limit);
+		array_push($t, "i");
+	}
+	$res = db_prep_query($sql, $v, $t);
+
+	$counter = 0;
+	while($row = db_fetch_array($res)){
+		$counter++;
+		if (isUnderLimit($counter, $numberOfResults, $numberOfResults)) {
+			$landparcelId = $row["flst_kennz"];
+			$x = trim(floatval($row["rechtsw"]));
+			$y = trim(floatval($row["hochw"]));
+
+			$obj["landparcels"][$landparcelId] = array("x" => $x, "y" => $y);
+		}
+	}
+	$obj["limited"] = isOverLimit($counter, $numberOfResults, $numberOfResults);
+}
+else if ($command == "getDistricts") {
+	$obj["districts"] = array();
+
+	$sql = "SELECT DISTINCT gemschl, name FROM public.gemarkungen WHERE gkz = $1 ORDER BY name";
+	$v = array($communeId);
+	$t = array("i");
+	$res = db_prep_query($sql, $v, $t);
+
+	while($row = db_fetch_array($res)){
+		$districtID = trim($row["gemschl"]);
+		$districtName = trim($row["name"]);
+		$obj["districts"][$districtID] = $districtName;
+	}
+	$obj["limited"] = false;
+}
+else {
+	// unknown command
+	$e = new mb_exception("unknown command: " . $command);
+}
+
+$json = new Mapbender_JSON();
+$output = $json->encode($obj);
+echo $output;
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_layerMetadata.php
===================================================================
--- branches/print_dev/http/php/mod_layerMetadata.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_layerMetadata.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,181 +1,181 @@
-<?php
-# $Id: mod_layerMetadata.php 235 2006-05-11 08:34:48Z uli $
-# http://www.mapbender.org/index.php/Administration
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-
-$redirectToMetadataUrl = $_GET["redirectToMetadataUrl"];
-
-function display_text($string) {
-    $string = mb_eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
-    $string = mb_eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
-    $string = mb_eregi_replace("\n", "<br>", $string);
-    return $string;
-}  
-
-function getEpsgByLayerId ($layer_id) { // from merge_layer.php
-	$epsg_list = "";
-	$sql = "SELECT DISTINCT epsg FROM layer_epsg WHERE fkey_layer_id = $1";
-	$v = array($layer_id);
-	$t = array('i');
-	$res = db_prep_query($sql, $v, $t);
-	while($row = db_fetch_array($res)){
-		$epsg_list .= $row['epsg'] . " ";
-	}
-	return trim($epsg_list);
-}
-$metadataStr = "";
-$metadataStr .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">' . 
-	'<head>' . 
-		'<title>Metadaten</title>' . 
-		'<meta name="description" content="Metadaten" xml:lang="de" />'.
-		'<meta name="keywords" content="Metadaten" xml:lang="de" />'	.	
-		'<meta http-equiv="cache-control" content="no-cache">'.
-		'<meta http-equiv="pragma" content="no-cache">'.
-		'<meta http-equiv="expires" content="0">'.
-		'<meta http-equiv="content-language" content="de" />'.
-		'<meta http-equiv="content-style-type" content="text/css" />'.
-		'<link rel="stylesheet" type="text/css" href="../css/metadata.css" />' .
-		'<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">' . 	
-	'</head>'.
-	'<body>';
-	$layer_id = $_GET['id'];
-	$wms_getmap = urldecode($_GET['wms']); 
-	$layer_name = urldecode($_GET['name']); 
-	
-	if ($layer_id) {
-		$sql = "SELECT ";
-		$sql .= "layer.layer_id, layer.layer_title, layer.layer_abstract, layer.layer_pos, layer.layer_parent, ";
-		$sql .= "layer.layer_minscale, layer.layer_maxscale, layer_dataurl, layer_metadataurl, ";
-		$sql .= "wms.wms_title, wms.wms_abstract, wms.wms_id, wms.fees, wms.accessconstraints, wms.contactperson, ";
-		$sql .= "wms.contactposition, wms.contactorganization, wms.address, wms.city, wms_timestamp, wms_owner, ";
-		$sql .= "wms.stateorprovince, wms.postcode, wms.contactvoicetelephone, wms.contactfacsimiletelephone, ";
-		$sql .= "wms.contactelectronicmailaddress, wms.country ";
-		$sql .= "FROM layer, wms WHERE layer.layer_id = $1 AND layer.fkey_wms_id = wms.wms_id LIMIT 1";
-		$v = array($layer_id);
-		$t = array('i');
-	}
-	else if ($wms_getmap && $layer_name) {
-		$sql = "SELECT ";
-		$sql .= "layer.layer_id, layer.layer_title, layer.layer_abstract, layer.layer_pos, layer.layer_parent, ";
-		$sql .= "layer.layer_minscale, layer.layer_maxscale, layer_dataurl, layer_metadataurl, ";
-		$sql .= "wms.wms_title, wms.wms_abstract, wms.wms_id, wms.fees, wms.accessconstraints, wms.contactperson, ";
-		$sql .= "wms.contactposition, wms.contactorganization, wms.address, wms.city, wms_timestamp, wms_owner, ";
-		$sql .= "wms.stateorprovince, wms.postcode, wms.contactvoicetelephone, wms.contactfacsimiletelephone, ";
-		$sql .= "wms.contactelectronicmailaddress, wms.country ";
-		$sql .= "FROM layer, wms WHERE layer.layer_pos <> 0 AND layer.layer_name = $1 AND layer.fkey_wms_id = wms.wms_id AND wms.wms_getmap LIKE $2 LIMIT 1";
-		$v = array($layer_name, $wms_getmap."%");
-		$t = array('s', 's');
-	}
-	else die("layer not specified!");
-	$res = db_prep_query($sql,$v,$t);
-	$metadataStr .=  db_error();
-	$layer = array();
-	$row = db_fetch_array($res);
-	$layer_id = $row['layer_id'];
-
-	$sql_dep = "SELECT mb_group_name FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND b.mb_user_department = a.mb_group_description LIMIT 1";
-	$v_dep = array($row['wms_owner']);
-	$t_dep = array('i');
-	$res_dep = db_prep_query($sql_dep, $v_dep, $t_dep);
-	$row_dep = db_fetch_array($res_dep);
-	
-
-	$layer['ID'] = $row['layer_id'];
-	$layer['Titel'] = $row['layer_title'];
-	$layer['Zusammenfassung'] = $row['layer_abstract'];
-	if ($row['layer_pos'] || $row['layer_parent']) {
-	  if ($row['layer_minscale'] > 0)
-		{
-		$layer['Minscale'] = "1 : ". $row['layer_minscale'];
-		}
-		else
-		{$layer['Minscale'] = "-";}
-		if ($row['layer_maxscale'] > 0)
-		{
-		$layer['Maxscale'] = "1 : ". $row['layer_maxscale'];
-		}
-		else
-		{$layer['Maxscale'] = "-";}
-	}
-	$layer['Koordinatensysteme'] = preg_replace("/ /", ", ", getEpsgByLayerId($row['layer_id']));
-//	$layer['Capabilities-Dokument'] = "<a href = '../x_geoportal/getCapabilities_document.php?wms_request=".$row['wms_id']."&layer_request=".$row['layer_pos']."' target=_blank>Capabilities-Dokument</a>";
-	if ($row['wms_timestamp']) {
-		$layer['Datum der Registrierung'] = date("d.m.Y",$row['wms_timestamp']); 
-	}
-	else {
-		$layer['Datum der Registrierung'] = "Keine Angabe"; 
-	}
-	$layer['Registrierende Stelle'] = $row_dep['mb_group_name'];
-	$layer['WMS ID'] = $row['wms_id'];
-	$layer['WMS Titel'] = $row['wms_title'];
-	$layer['WMS Zusammenfassung'] = $row['wms_abstract'];
-	$layer['Geb&uuml;hren'] = $row['fees'];
-	$layer['Zugriffsbeschr&auml;nkung'] = $row['accessconstraints'];
-	$layer['Ansprechpartner'] = $row['contactperson'];
-	$layer['Organisation'] = $row['contactorganization'];
-	$layer['Adresse'] = $row['address'];
-	$layer['Stadt'] = $row['city'];
-	$layer['Bundesland'] = $row['stateorprovince'];
-	$layer['PLZ'] = $row['postcode'];
-	$layer['Telefon'] = $row['contactvoicetelephone'];
-	$layer['Fax'] = $row['contactfacsimiletelephone'];
-	$layer['E-Mail'] = $row['contactelectronicmailaddress'];
-	$layer['Land'] = $row['country'];
-	$layer['Metadaten'] = $row['layer_metadataurl'];
-	$metadataUrl = $row['layer_metadataurl'];
-
-	if ($layer['Metadaten'] && $redirectToMetadataUrl) {
-		header("Location: " . $layer['Metadaten']);		
-	}	
-	else {
-		$metadataStr .=  "<table >\n";
-		$t_a = "\t<tr>\n\t\t<th>\n\t\t\t";
-		$t_b = "\n\t\t</th>\n\t\t<td>\n\t\t\t";
-		$t_c = "\n\t\t</td>\n\t</tr>\n";
-	
-		$keys = array_keys($layer);
-		for ($j=0; $j<count($layer); $j++) {
-			$metadataStr .=  $t_a . $keys[$j] . $t_b . display_text($layer[$keys[$j]]) . $t_c;
-		}
-	
-		if (!$row['layer_pos'] && !$row['layer_parent']) {
-			$wms_id = $row['wms_id'];
-			$sql = "SELECT layer.layer_title, layer.layer_id FROM layer WHERE fkey_wms_id = $1 AND layer_pos <> 0";
-			$v = array($wms_id);
-			$t = array('i');
-			$res = db_prep_query($sql,$v,$t);
-			$i=0;
-			$layer = array();
-			while ($row = db_fetch_array($res)) {
-				$layer[$i] = array();
-				$layer[$i]['Titel'] = $row['layer_title'];
-				$layer[$i]['id'] = $row['layer_id'];
-				$i++;
-			}
-			$metadataStr .=  "<tr><th>Ebenen</th><td>";
-			for ($i=0; $i<count($layer); $i++) {
-				if ($i >0) $metadataStr .=  ", ";
-				$metadataStr .=  "<a href='mod_layerMetadata.php?id=".$layer[$i]['id']."'>" . $layer[$i]['Titel'] . "</a>";
-			}
-		}	
-		$metadataStr .=  "</td></tr></table>\n";
-		$metadataStr .=  '</div></body></html>';
-		echo $metadataStr;
-	}
-?>
+<?php
+# $Id: mod_layerMetadata.php 235 2006-05-11 08:34:48Z uli $
+# http://www.mapbender.org/index.php/Administration
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+
+$redirectToMetadataUrl = $_GET["redirectToMetadataUrl"];
+
+function display_text($string) {
+    $string = mb_eregi_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\" target=_blank>\\0</a>", $string);   
+    $string = mb_eregi_replace("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$", "<a href=\"mailto:\\0\" target=_blank>\\0</a>", $string);   
+    $string = mb_eregi_replace("\n", "<br>", $string);
+    return $string;
+}  
+
+function getEpsgByLayerId ($layer_id) { // from merge_layer.php
+	$epsg_list = "";
+	$sql = "SELECT DISTINCT epsg FROM layer_epsg WHERE fkey_layer_id = $1";
+	$v = array($layer_id);
+	$t = array('i');
+	$res = db_prep_query($sql, $v, $t);
+	while($row = db_fetch_array($res)){
+		$epsg_list .= $row['epsg'] . " ";
+	}
+	return trim($epsg_list);
+}
+$metadataStr = "";
+$metadataStr .= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">' . 
+	'<head>' . 
+		'<title>Metadaten</title>' . 
+		'<meta name="description" content="Metadaten" xml:lang="de" />'.
+		'<meta name="keywords" content="Metadaten" xml:lang="de" />'	.	
+		'<meta http-equiv="cache-control" content="no-cache">'.
+		'<meta http-equiv="pragma" content="no-cache">'.
+		'<meta http-equiv="expires" content="0">'.
+		'<meta http-equiv="content-language" content="de" />'.
+		'<meta http-equiv="content-style-type" content="text/css" />'.
+		'<link rel="stylesheet" type="text/css" href="../css/metadata.css" />' .
+		'<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">' . 	
+	'</head>'.
+	'<body>';
+	$layer_id = $_GET['id'];
+	$wms_getmap = urldecode($_GET['wms']); 
+	$layer_name = urldecode($_GET['name']); 
+	
+	if ($layer_id) {
+		$sql = "SELECT ";
+		$sql .= "layer.layer_id, layer.layer_title, layer.layer_abstract, layer.layer_pos, layer.layer_parent, ";
+		$sql .= "layer.layer_minscale, layer.layer_maxscale, layer_dataurl, layer_metadataurl, ";
+		$sql .= "wms.wms_title, wms.wms_abstract, wms.wms_id, wms.fees, wms.accessconstraints, wms.contactperson, ";
+		$sql .= "wms.contactposition, wms.contactorganization, wms.address, wms.city, wms_timestamp, wms_owner, ";
+		$sql .= "wms.stateorprovince, wms.postcode, wms.contactvoicetelephone, wms.contactfacsimiletelephone, ";
+		$sql .= "wms.contactelectronicmailaddress, wms.country ";
+		$sql .= "FROM layer, wms WHERE layer.layer_id = $1 AND layer.fkey_wms_id = wms.wms_id LIMIT 1";
+		$v = array($layer_id);
+		$t = array('i');
+	}
+	else if ($wms_getmap && $layer_name) {
+		$sql = "SELECT ";
+		$sql .= "layer.layer_id, layer.layer_title, layer.layer_abstract, layer.layer_pos, layer.layer_parent, ";
+		$sql .= "layer.layer_minscale, layer.layer_maxscale, layer_dataurl, layer_metadataurl, ";
+		$sql .= "wms.wms_title, wms.wms_abstract, wms.wms_id, wms.fees, wms.accessconstraints, wms.contactperson, ";
+		$sql .= "wms.contactposition, wms.contactorganization, wms.address, wms.city, wms_timestamp, wms_owner, ";
+		$sql .= "wms.stateorprovince, wms.postcode, wms.contactvoicetelephone, wms.contactfacsimiletelephone, ";
+		$sql .= "wms.contactelectronicmailaddress, wms.country ";
+		$sql .= "FROM layer, wms WHERE layer.layer_pos <> 0 AND layer.layer_name = $1 AND layer.fkey_wms_id = wms.wms_id AND wms.wms_getmap LIKE $2 LIMIT 1";
+		$v = array($layer_name, $wms_getmap."%");
+		$t = array('s', 's');
+	}
+	else die("layer not specified!");
+	$res = db_prep_query($sql,$v,$t);
+	$metadataStr .=  db_error();
+	$layer = array();
+	$row = db_fetch_array($res);
+	$layer_id = $row['layer_id'];
+
+	$sql_dep = "SELECT mb_group_name FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND b.mb_user_department = a.mb_group_description LIMIT 1";
+	$v_dep = array($row['wms_owner']);
+	$t_dep = array('i');
+	$res_dep = db_prep_query($sql_dep, $v_dep, $t_dep);
+	$row_dep = db_fetch_array($res_dep);
+	
+
+	$layer['ID'] = $row['layer_id'];
+	$layer['Titel'] = $row['layer_title'];
+	$layer['Zusammenfassung'] = $row['layer_abstract'];
+	if ($row['layer_pos'] || $row['layer_parent']) {
+	  if ($row['layer_minscale'] > 0)
+		{
+		$layer['Minscale'] = "1 : ". $row['layer_minscale'];
+		}
+		else
+		{$layer['Minscale'] = "-";}
+		if ($row['layer_maxscale'] > 0)
+		{
+		$layer['Maxscale'] = "1 : ". $row['layer_maxscale'];
+		}
+		else
+		{$layer['Maxscale'] = "-";}
+	}
+	$layer['Koordinatensysteme'] = preg_replace("/ /", ", ", getEpsgByLayerId($row['layer_id']));
+//	$layer['Capabilities-Dokument'] = "<a href = '../x_geoportal/getCapabilities_document.php?wms_request=".$row['wms_id']."&layer_request=".$row['layer_pos']."' target=_blank>Capabilities-Dokument</a>";
+	if ($row['wms_timestamp']) {
+		$layer['Datum der Registrierung'] = date("d.m.Y",$row['wms_timestamp']); 
+	}
+	else {
+		$layer['Datum der Registrierung'] = "Keine Angabe"; 
+	}
+	$layer['Registrierende Stelle'] = $row_dep['mb_group_name'];
+	$layer['WMS ID'] = $row['wms_id'];
+	$layer['WMS Titel'] = $row['wms_title'];
+	$layer['WMS Zusammenfassung'] = $row['wms_abstract'];
+	$layer['Geb&uuml;hren'] = $row['fees'];
+	$layer['Zugriffsbeschr&auml;nkung'] = $row['accessconstraints'];
+	$layer['Ansprechpartner'] = $row['contactperson'];
+	$layer['Organisation'] = $row['contactorganization'];
+	$layer['Adresse'] = $row['address'];
+	$layer['Stadt'] = $row['city'];
+	$layer['Bundesland'] = $row['stateorprovince'];
+	$layer['PLZ'] = $row['postcode'];
+	$layer['Telefon'] = $row['contactvoicetelephone'];
+	$layer['Fax'] = $row['contactfacsimiletelephone'];
+	$layer['E-Mail'] = $row['contactelectronicmailaddress'];
+	$layer['Land'] = $row['country'];
+	$layer['Metadaten'] = $row['layer_metadataurl'];
+	$metadataUrl = $row['layer_metadataurl'];
+
+	if ($layer['Metadaten'] && $redirectToMetadataUrl) {
+		header("Location: " . $layer['Metadaten']);		
+	}	
+	else {
+		$metadataStr .=  "<table >\n";
+		$t_a = "\t<tr>\n\t\t<th>\n\t\t\t";
+		$t_b = "\n\t\t</th>\n\t\t<td>\n\t\t\t";
+		$t_c = "\n\t\t</td>\n\t</tr>\n";
+	
+		$keys = array_keys($layer);
+		for ($j=0; $j<count($layer); $j++) {
+			$metadataStr .=  $t_a . $keys[$j] . $t_b . display_text($layer[$keys[$j]]) . $t_c;
+		}
+	
+		if (!$row['layer_pos'] && !$row['layer_parent']) {
+			$wms_id = $row['wms_id'];
+			$sql = "SELECT layer.layer_title, layer.layer_id FROM layer WHERE fkey_wms_id = $1 AND layer_pos <> 0";
+			$v = array($wms_id);
+			$t = array('i');
+			$res = db_prep_query($sql,$v,$t);
+			$i=0;
+			$layer = array();
+			while ($row = db_fetch_array($res)) {
+				$layer[$i] = array();
+				$layer[$i]['Titel'] = $row['layer_title'];
+				$layer[$i]['id'] = $row['layer_id'];
+				$i++;
+			}
+			$metadataStr .=  "<tr><th>Ebenen</th><td>";
+			for ($i=0; $i<count($layer); $i++) {
+				if ($i >0) $metadataStr .=  ", ";
+				$metadataStr .=  "<a href='mod_layerMetadata.php?id=".$layer[$i]['id']."'>" . $layer[$i]['Titel'] . "</a>";
+			}
+		}	
+		$metadataStr .=  "</td></tr></table>\n";
+		$metadataStr .=  '</div></body></html>';
+		echo $metadataStr;
+	}
+?>

Modified: branches/print_dev/http/php/mod_loadCapabilitiesList.php
===================================================================
--- branches/print_dev/http/php/mod_loadCapabilitiesList.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_loadCapabilitiesList.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,307 +1,307 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Administration
-# 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.
-
-import_request_variables("PG");
-require(dirname(__FILE__)."/../php/mb_validatePermission.php");
-?>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-
-<html>
-<head>
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>Load WMS from Catalog</title>
-<?php
-include '../include/dyn_css.php';
-?>
-<style type="text/css">
-  	<!--
-  	body{
-      background-color: #ffffff;
-  		font-family: Arial, Helvetica, sans-serif;
-  		font-size : 12px;
-  		color: #808080
-  	}
-  	.list_guis{
-  		font-family: Arial, Helvetica, sans-serif;
-  		font-size : 12px;
-  		color: #808080;
-  	}
-.text1{
-   font-family: Arial, Helvetica, sans-serif;
-   font-size : 15px;
-   position:absolute;
-   top:190px;
-}
-.select1{
-   position:absolute;
-   top:210px;
-   width:270px;
-}
-.text2{
-   font-family: Arial, Helvetica, sans-serif;
-   font-size : 15px;
-   position:absolute;
-   top:190px;
-   left:300px;
-}
-.select2{
-   position:absolute;
-   top:210px;
-   left:300px;
-}
-.getcapabilities{
-   font-family: Arial, Helvetica, sans-serif;
-   font-size : 15px;
-   position:absolute;
-   top:570px;
-}
-
-  	-->
-</style>
-<script language="JavaScript">
-function validate(wert){
-   if(wert == 'guiList'){
-      var listIndex = document.form1.guiList.selectedIndex;
-      if(listIndex<0){
-		   alert("Please select a GUI.");
-			return false;
-      }
-      else{
-         var gui_id=document.form1.guiList.options[listIndex].value;
-			document.form1.action='../php/mod_loadwms.php<?php echo SID;?>';
-			document.form1.submit();
-      }
-   }
-}
-function load(){
-      if(document.form1.guiList.selectedIndex<0){
-		   alert("Please select a GUI.");
-			return false;
-      }
-      var gui_ind = document.form1.guiList.selectedIndex;
-      var ind = document.form1.wmsID.selectedIndex;
-      var ind2 = document.form1.guiID_.selectedIndex;
-			var indexWMSList = document.form1.wmsID.selectedIndex;
-			var permission = true;
-
-			var selectedWmsId = document.form1.wmsID.options[document.form1.wmsID.selectedIndex].value;
-			for (i = 0; i < document.form1.wmsList.length; i++) {
-						if (document.form1.wmsList.options[i].value == selectedWmsId){
-							 permission = false;							 
-							 alert ('The WMS (' + selectedWmsId + ') is already loaded in this application.');
-							 break;
-						}
-			}			 
-			
-  			if (permission) { // only check if permission is not false 
-        	var loadConfirmed = confirm("Load " + document.form1.wmsID.options[ind].text + " FROM " + document.form1.guiID_.options[ind2].value + " INTO "+document.form1.guiList.options[gui_ind].value+" ?");
-          if(loadConfirmed){
-             document.form1.submit();
-          }
-          else{
-             document.form1.guiID_.selectedIndex = -1;
-          }
-			}	
-			
-}
-</script>
-</head>
-<body>
-
-<?php
-
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-$admin = new administration();
-$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"],true);
-
-
-
-###INSERT
-if(isset($wmsID) && isset($guiID_)){
-	$sql_pos = "SELECT MAX(gui_wms_position) AS my_gui_wms_position FROM gui_wms WHERE fkey_gui_id = $1";
-	$v = array($guiList);
-	$t = array('s');
-	$res_pos = db_prep_query($sql_pos,$v,$t);
-	if(db_result($res_pos,0,"my_gui_wms_position") > -1){
-		$gui_wms_position = db_result($res_pos,0,"my_gui_wms_position") + 1;
-	}
-	else{
-		$gui_wms_position = 0;
-	}
-
-	$sql = "SELECT * FROM gui_wms WHERE fkey_gui_id = $1 AND fkey_wms_id = $2";
-	$v = array($guiID_,$wmsID);
-	$t = array('s','i');
-	$res = db_prep_query($sql,$v,$t);
-	$cnt = 0;
-	while($row = db_fetch_array($res)){
-		$sql_ins = "INSERT INTO gui_wms (fkey_gui_id,fkey_wms_id,gui_wms_position,gui_wms_mapformat,";
-		$sql_ins .= "gui_wms_featureinfoformat,gui_wms_exceptionformat,gui_wms_epsg,gui_wms_visible,gui_wms_opacity,gui_wms_sldurl) ";
-		$sql_ins .= "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)";
-		$v = array($guiList,$wmsID,$gui_wms_position,$row["gui_wms_mapformat"],$row["gui_wms_featureinfoformat"],
-		$row["gui_wms_exceptionformat"],$row["gui_wms_epsg"],$row["gui_wms_visible"],$row["gui_wms_opacity"],$row["gui_wms_sldurl"]);
-		$t = array('s','i','i','s','s','s','s','i','i','s');
-		db_prep_query($sql_ins,$v,$t);
-		$cnt++;
-	}
-
-	$sql = "SELECT * FROM gui_layer WHERE fkey_gui_id = $1 AND gui_layer_wms_id = $2";
-	$v = array($guiID_, $wmsID);
-	$t = array("s", "i");
-	$res = db_prep_query($sql, $v, $t);
-	$cnt = 0;
-	while($row = db_fetch_array($res)){
-		$sql_ins = "INSERT INTO gui_layer (fkey_gui_id,fkey_layer_id,gui_layer_wms_id,gui_layer_status,gui_layer_selectable,";
-		$sql_ins .= "gui_layer_visible,gui_layer_queryable,gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale,gui_layer_priority,gui_layer_style,gui_layer_wfs_featuretype) ";
-		$sql_ins .= "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)";
-		$v = array($guiList,$row["fkey_layer_id"],$wmsID,$row["gui_layer_status"],$row["gui_layer_selectable"],
-		$row["gui_layer_visible"],$row["gui_layer_queryable"],$row["gui_layer_querylayer"],$row["gui_layer_minscale"],
-		$row["gui_layer_maxscale"],$row["gui_layer_priority"],$row["gui_layer_style"],$row["gui_layer_wfs_featuretype"]);
-		$t = array('s','i','i','i','i','i','i','i','i','i','i','s','s');
-		db_prep_query($sql_ins,$v,$t);
-		$cnt++;
-	}
-}
-
-echo "<form name='form1' action='" . $self."' method='post'>";
-
-echo "<table cellpadding='0' cellspacing='0' border='0'>";
-echo "<tr>";
-echo "<td>";
-if (count($ownguis)>0){
-	echo"GUI";
-	echo"<br>";
-	 
-	$sql = "SELECT * FROM gui WHERE gui_id IN (";
-	$v = $ownguis;
-	$t = array();
-	for ($i = 1; $i <= count($ownguis); $i++){
-		if ($i > 1) { 
-			$sql .= ",";
-		}
-		$sql .= "$".$i;
-		array_push($t, "s");
-	}
-	$sql .= ") ORDER BY gui_name";	
-	$res = db_prep_query($sql, $v, $t);
-	$count=0;
-	echo"<select size='8' name='guiList' style='width:200px' onClick='submit()'>";
-	while($row = db_fetch_array($res)){
-		$gui_name[$count]=$row["gui_name"];
-		$gui_description[$count]=$row["gui_description"];
-		$count++;
-		echo "<option value='".$row["gui_id"]."' ";
-		if($guiList && $guiList == $row["gui_name"]){
-			echo "selected";
-		}
-		echo ">".$row["gui_name"]."</option>";
-	}
-	
-	$arrayGUIs=$_SESSION["mb_user_guis"];
-	echo count($arrayGUIs);
-	echo "</select><br><br>";
-	
-	echo "</td>";
-	echo "<td>";
-	echo"WMS";
-	echo"<br>";
-	if(isset($guiList) && $guiList!=""){
-		$sql = "SELECT DISTINCT wms_id, wms.wms_title, gui_wms_position FROM gui_wms ";
-		$sql .= "JOIN gui ON gui_wms.fkey_gui_id = gui.gui_id JOIN wms ON gui_wms.fkey_wms_id=wms.wms_id ";
-		$sql .= "AND gui_wms.fkey_gui_id=gui.gui_id WHERE gui.gui_name = $1 ORDER BY gui_wms_position";
-		$v = array($guiList);
-		$t = array('s');
-		$res = db_prep_query($sql,$v,$t);	
-		$count=0;
-		echo"<select size='8' name='wmsList' style='width:200px'>";
-	
-		while($row = db_fetch_array($res)){
-			if ($row["wms_title"]!=""){
-				echo "<option value='".$row["wms_id"]."' ";
-				echo ">".$row["wms_title"]."</option>";
-			}
-			$count++;
-		}
-		echo "</select><br><br>";
-	}else{
-		echo"<select size='8' name='wmsList' style='width:200px' on Click='submit()'>";
-		echo "</select><br><br>";
-	}
-	echo "</td>";
-	echo "<tr></table><br>";
-	
-	echo"<div class='text1'>Load WMS</div>";
-	$sql = "SELECT DISTINCT wms.wms_id,wms.wms_title,wms.wms_abstract,wms.wms_owner FROM gui_wms JOIN wms ON ";
-	$sql .= "wms.wms_id = gui_wms.fkey_wms_id WHERE gui_wms.fkey_gui_id IN(";
-	$v = $arrayGUIs;
-	$t = array();
-	for ($i = 1; $i <= count($arrayGUIs); $i++){
-		if ($i > 1) {
-			$sql .= ",";
-		}
-		$sql .= "$" . $i;
-		array_push($t, "s");
-	}
-	$sql .= ") ORDER BY wms.wms_title";
-	$res = db_prep_query($sql, $v, $t);
-	echo "<select class='select1' name='wmsID' size='20' onchange='submit()'>";
-	$cnt = 0;
-	while($row = db_fetch_array($res)){
-		echo "<option value='".$row["wms_id"]."' ";
-		if($row["wms_owner"] == $_SESSION["mb_user_id"]){
-			echo "style='color:green' ";	
-		}
-		else{
-			echo "style='color:red' ";
-		}
-		if(isset($wmsID) && $wmsID == $row["wms_id"]){
-			echo "selected";
-			$wms_getcapabilities = $row["wms_getcapabilities"];
-		}
-		echo ">".$row["wms_title"]."</option>";
-		$cnt++;
-	}
-	echo "</select>";
-	
-	if(isset($wmsID)){
-		echo "<div class='text2'>FROM:</div>";
-		$sql = "SELECT * from gui_wms WHERE fkey_wms_id = $1 ORDER BY fkey_gui_id";
-		$v = array($wmsID);
-		$t = array("s");
-		$res = db_prep_query($sql, $v, $t);
-		echo "<select class='select2' name='guiID_' size='20' onchange='load()'>";
-		$cnt = 0;
-		while($row = db_fetch_array($res)){
-			echo "<option value='".$row["fkey_gui_id"]."' ";
-			echo ">".$row["fkey_gui_id"]."</option>";
-			$cnt++;
-		}
-	echo "</select>";
-}
-echo "</form>";
-}else{
-	echo "There are no guis available for this user. Please create a gui first.";
-}
-echo "<div class='getcapabilities'>" . $wms_getcapabilities . "</div>";
-?>
-</body>
-</html>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/Administration
+# 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.
+
+import_request_variables("PG");
+require(dirname(__FILE__)."/../php/mb_validatePermission.php");
+?>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>Load WMS from Catalog</title>
+<?php
+include '../include/dyn_css.php';
+?>
+<style type="text/css">
+  	<!--
+  	body{
+      background-color: #ffffff;
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080
+  	}
+  	.list_guis{
+  		font-family: Arial, Helvetica, sans-serif;
+  		font-size : 12px;
+  		color: #808080;
+  	}
+.text1{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:190px;
+}
+.select1{
+   position:absolute;
+   top:210px;
+   width:270px;
+}
+.text2{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:190px;
+   left:300px;
+}
+.select2{
+   position:absolute;
+   top:210px;
+   left:300px;
+}
+.getcapabilities{
+   font-family: Arial, Helvetica, sans-serif;
+   font-size : 15px;
+   position:absolute;
+   top:570px;
+}
+
+  	-->
+</style>
+<script language="JavaScript">
+function validate(wert){
+   if(wert == 'guiList'){
+      var listIndex = document.form1.guiList.selectedIndex;
+      if(listIndex<0){
+		   alert("Please select a GUI.");
+			return false;
+      }
+      else{
+         var gui_id=document.form1.guiList.options[listIndex].value;
+			document.form1.action='../php/mod_loadwms.php<?php echo SID;?>';
+			document.form1.submit();
+      }
+   }
+}
+function load(){
+      if(document.form1.guiList.selectedIndex<0){
+		   alert("Please select a GUI.");
+			return false;
+      }
+      var gui_ind = document.form1.guiList.selectedIndex;
+      var ind = document.form1.wmsID.selectedIndex;
+      var ind2 = document.form1.guiID_.selectedIndex;
+			var indexWMSList = document.form1.wmsID.selectedIndex;
+			var permission = true;
+
+			var selectedWmsId = document.form1.wmsID.options[document.form1.wmsID.selectedIndex].value;
+			for (i = 0; i < document.form1.wmsList.length; i++) {
+						if (document.form1.wmsList.options[i].value == selectedWmsId){
+							 permission = false;							 
+							 alert ('The WMS (' + selectedWmsId + ') is already loaded in this application.');
+							 break;
+						}
+			}			 
+			
+  			if (permission) { // only check if permission is not false 
+        	var loadConfirmed = confirm("Load " + document.form1.wmsID.options[ind].text + " FROM " + document.form1.guiID_.options[ind2].value + " INTO "+document.form1.guiList.options[gui_ind].value+" ?");
+          if(loadConfirmed){
+             document.form1.submit();
+          }
+          else{
+             document.form1.guiID_.selectedIndex = -1;
+          }
+			}	
+			
+}
+</script>
+</head>
+<body>
+
+<?php
+
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+$admin = new administration();
+$ownguis = $admin->getGuisByOwner($_SESSION["mb_user_id"],true);
+
+
+
+###INSERT
+if(isset($wmsID) && isset($guiID_)){
+	$sql_pos = "SELECT MAX(gui_wms_position) AS my_gui_wms_position FROM gui_wms WHERE fkey_gui_id = $1";
+	$v = array($guiList);
+	$t = array('s');
+	$res_pos = db_prep_query($sql_pos,$v,$t);
+	if(db_result($res_pos,0,"my_gui_wms_position") > -1){
+		$gui_wms_position = db_result($res_pos,0,"my_gui_wms_position") + 1;
+	}
+	else{
+		$gui_wms_position = 0;
+	}
+
+	$sql = "SELECT * FROM gui_wms WHERE fkey_gui_id = $1 AND fkey_wms_id = $2";
+	$v = array($guiID_,$wmsID);
+	$t = array('s','i');
+	$res = db_prep_query($sql,$v,$t);
+	$cnt = 0;
+	while($row = db_fetch_array($res)){
+		$sql_ins = "INSERT INTO gui_wms (fkey_gui_id,fkey_wms_id,gui_wms_position,gui_wms_mapformat,";
+		$sql_ins .= "gui_wms_featureinfoformat,gui_wms_exceptionformat,gui_wms_epsg,gui_wms_visible,gui_wms_opacity,gui_wms_sldurl) ";
+		$sql_ins .= "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)";
+		$v = array($guiList,$wmsID,$gui_wms_position,$row["gui_wms_mapformat"],$row["gui_wms_featureinfoformat"],
+		$row["gui_wms_exceptionformat"],$row["gui_wms_epsg"],$row["gui_wms_visible"],$row["gui_wms_opacity"],$row["gui_wms_sldurl"]);
+		$t = array('s','i','i','s','s','s','s','i','i','s');
+		db_prep_query($sql_ins,$v,$t);
+		$cnt++;
+	}
+
+	$sql = "SELECT * FROM gui_layer WHERE fkey_gui_id = $1 AND gui_layer_wms_id = $2";
+	$v = array($guiID_, $wmsID);
+	$t = array("s", "i");
+	$res = db_prep_query($sql, $v, $t);
+	$cnt = 0;
+	while($row = db_fetch_array($res)){
+		$sql_ins = "INSERT INTO gui_layer (fkey_gui_id,fkey_layer_id,gui_layer_wms_id,gui_layer_status,gui_layer_selectable,";
+		$sql_ins .= "gui_layer_visible,gui_layer_queryable,gui_layer_querylayer,gui_layer_minscale,gui_layer_maxscale,gui_layer_priority,gui_layer_style,gui_layer_wfs_featuretype) ";
+		$sql_ins .= "VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)";
+		$v = array($guiList,$row["fkey_layer_id"],$wmsID,$row["gui_layer_status"],$row["gui_layer_selectable"],
+		$row["gui_layer_visible"],$row["gui_layer_queryable"],$row["gui_layer_querylayer"],$row["gui_layer_minscale"],
+		$row["gui_layer_maxscale"],$row["gui_layer_priority"],$row["gui_layer_style"],$row["gui_layer_wfs_featuretype"]);
+		$t = array('s','i','i','i','i','i','i','i','i','i','i','s','s');
+		db_prep_query($sql_ins,$v,$t);
+		$cnt++;
+	}
+}
+
+echo "<form name='form1' action='" . $self."' method='post'>";
+
+echo "<table cellpadding='0' cellspacing='0' border='0'>";
+echo "<tr>";
+echo "<td>";
+if (count($ownguis)>0){
+	echo"GUI";
+	echo"<br>";
+	 
+	$sql = "SELECT * FROM gui WHERE gui_id IN (";
+	$v = $ownguis;
+	$t = array();
+	for ($i = 1; $i <= count($ownguis); $i++){
+		if ($i > 1) { 
+			$sql .= ",";
+		}
+		$sql .= "$".$i;
+		array_push($t, "s");
+	}
+	$sql .= ") ORDER BY gui_name";	
+	$res = db_prep_query($sql, $v, $t);
+	$count=0;
+	echo"<select size='8' name='guiList' style='width:200px' onClick='submit()'>";
+	while($row = db_fetch_array($res)){
+		$gui_name[$count]=$row["gui_name"];
+		$gui_description[$count]=$row["gui_description"];
+		$count++;
+		echo "<option value='".$row["gui_id"]."' ";
+		if($guiList && $guiList == $row["gui_name"]){
+			echo "selected";
+		}
+		echo ">".$row["gui_name"]."</option>";
+	}
+	
+	$arrayGUIs=$_SESSION["mb_user_guis"];
+	echo count($arrayGUIs);
+	echo "</select><br><br>";
+	
+	echo "</td>";
+	echo "<td>";
+	echo"WMS";
+	echo"<br>";
+	if(isset($guiList) && $guiList!=""){
+		$sql = "SELECT DISTINCT wms_id, wms.wms_title, gui_wms_position FROM gui_wms ";
+		$sql .= "JOIN gui ON gui_wms.fkey_gui_id = gui.gui_id JOIN wms ON gui_wms.fkey_wms_id=wms.wms_id ";
+		$sql .= "AND gui_wms.fkey_gui_id=gui.gui_id WHERE gui.gui_name = $1 ORDER BY gui_wms_position";
+		$v = array($guiList);
+		$t = array('s');
+		$res = db_prep_query($sql,$v,$t);	
+		$count=0;
+		echo"<select size='8' name='wmsList' style='width:200px'>";
+	
+		while($row = db_fetch_array($res)){
+			if ($row["wms_title"]!=""){
+				echo "<option value='".$row["wms_id"]."' ";
+				echo ">".$row["wms_title"]."</option>";
+			}
+			$count++;
+		}
+		echo "</select><br><br>";
+	}else{
+		echo"<select size='8' name='wmsList' style='width:200px' on Click='submit()'>";
+		echo "</select><br><br>";
+	}
+	echo "</td>";
+	echo "<tr></table><br>";
+	
+	echo"<div class='text1'>Load WMS</div>";
+	$sql = "SELECT DISTINCT wms.wms_id,wms.wms_title,wms.wms_abstract,wms.wms_owner FROM gui_wms JOIN wms ON ";
+	$sql .= "wms.wms_id = gui_wms.fkey_wms_id WHERE gui_wms.fkey_gui_id IN(";
+	$v = $arrayGUIs;
+	$t = array();
+	for ($i = 1; $i <= count($arrayGUIs); $i++){
+		if ($i > 1) {
+			$sql .= ",";
+		}
+		$sql .= "$" . $i;
+		array_push($t, "s");
+	}
+	$sql .= ") ORDER BY wms.wms_title";
+	$res = db_prep_query($sql, $v, $t);
+	echo "<select class='select1' name='wmsID' size='20' onchange='submit()'>";
+	$cnt = 0;
+	while($row = db_fetch_array($res)){
+		echo "<option value='".$row["wms_id"]."' ";
+		if($row["wms_owner"] == $_SESSION["mb_user_id"]){
+			echo "style='color:green' ";	
+		}
+		else{
+			echo "style='color:red' ";
+		}
+		if(isset($wmsID) && $wmsID == $row["wms_id"]){
+			echo "selected";
+			$wms_getcapabilities = $row["wms_getcapabilities"];
+		}
+		echo ">".$row["wms_title"]."</option>";
+		$cnt++;
+	}
+	echo "</select>";
+	
+	if(isset($wmsID)){
+		echo "<div class='text2'>FROM:</div>";
+		$sql = "SELECT * from gui_wms WHERE fkey_wms_id = $1 ORDER BY fkey_gui_id";
+		$v = array($wmsID);
+		$t = array("s");
+		$res = db_prep_query($sql, $v, $t);
+		echo "<select class='select2' name='guiID_' size='20' onchange='load()'>";
+		$cnt = 0;
+		while($row = db_fetch_array($res)){
+			echo "<option value='".$row["fkey_gui_id"]."' ";
+			echo ">".$row["fkey_gui_id"]."</option>";
+			$cnt++;
+		}
+	echo "</select>";
+}
+echo "</form>";
+}else{
+	echo "There are no guis available for this user. Please create a gui first.";
+}
+echo "<div class='getcapabilities'>" . $wms_getcapabilities . "</div>";
+?>
+</body>
+</html>

Modified: branches/print_dev/http/php/mod_loadwfs.php
===================================================================
--- branches/print_dev/http/php/mod_loadwfs.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_loadwfs.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -28,12 +28,12 @@
 $guiList = mb_validateInput($_REQUEST["guiList"]);
 $url = mb_validateInput($_REQUEST["xml_file"]);
 
-
 $myWfsFactory = new UniversalWfsFactory();
 $myWfs = $myWfsFactory->createFromUrl($url);      
 
 if (is_null($myWfs)) {
 	echo "WFS could not be uploaded.";
+	die;
 }
 $myWfs->insertOrUpdate();
 

Modified: branches/print_dev/http/php/mod_log.php
===================================================================
--- branches/print_dev/http/php/mod_log.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_log.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,34 +1,34 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Administration
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-require(dirname(__FILE__)."/../include/dyn_php.php");
-
-if($_REQUEST['req']){
-	ignore_user_abort();
-	$req = array();
-	$req[0] = urldecode($_REQUEST['req']);
-	$time_client = $_REQUEST['time_client'];
-	
-	if(empty($req)){$req = "init";}
-	include(dirname(__FILE__)."/../classes/class_log.php");
-	$log = new log("default", $req, $time_client, $logtype);
-}
-echo "log into $logtype successful!";
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/Administration
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+require(dirname(__FILE__)."/../include/dyn_php.php");
+
+if($_REQUEST['req']){
+	ignore_user_abort();
+	$req = array();
+	$req[0] = urldecode($_REQUEST['req']);
+	$time_client = $_REQUEST['time_client'];
+	
+	if(empty($req)){$req = "init";}
+	include(dirname(__FILE__)."/../classes/class_log.php");
+	$log = new log("default", $req, $time_client, $logtype);
+}
+echo "log into $logtype successful!";
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_owsproxy_conf.php
===================================================================
--- branches/print_dev/http/php/mod_owsproxy_conf.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_owsproxy_conf.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,66 +1,66 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/mod_owsproxy_conf.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(dirname(__FILE__)."/../php/mb_validatePermission.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-$admin = new administration();
-$ownwms = $admin->getWmsByOwner($_SESSION["mb_user_id"]);
-if(isset($_REQUEST["wms_id"]) && isset($_REQUEST["status"])){
-	$admin->setWMSOWSstring(intval($_REQUEST["wms_id"]),$_REQUEST["status"]);	
-}
-?>
-<html>
-<head>
-<?php
-echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
-?>
-<title>OWS Security Proxy</title>
-<style type="text/css">
-
-body{
-	font-family: Arial, Helvetica, sans-serif;	
-}
-</style>
-<script language="JavaScript" type="text/javascript">
-function set(wms_id, status){
-	document.location.href = "<?php echo $self; ?>&wms_id="+wms_id+"&status="+status; 
-}
-</script>
-  
-</head>
-<body>
-<form>
-<table>
-<?php
-for($i=0; $i<count($ownwms); $i++){
-	echo "<tr>";
-	echo "<td>";
-	echo "<input type='checkbox' onclick='if(this.checked){set(\"".$ownwms[$i]."\",\"on\")}else{set(\"".$ownwms[$i]."\",\"off\")}' ";
-	if($admin->getWMSOWSstring($ownwms[$i]) != false){ echo "checked";  }
-	echo ">";
-	echo "</td>";
-	echo "<td>".$ownwms[$i]."</td>";
-	echo "<td>".$admin->getWmsTitleByWmsId($ownwms[$i])."</td>";
-	echo "</tr>";	
-}
-?>
-</table>
-</form>
-</body>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_owsproxy_conf.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(dirname(__FILE__)."/../php/mb_validatePermission.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+$admin = new administration();
+$ownwms = $admin->getWmsByOwner($_SESSION["mb_user_id"]);
+if(isset($_REQUEST["wms_id"]) && isset($_REQUEST["status"])){
+	$admin->setWMSOWSstring(intval($_REQUEST["wms_id"]),$_REQUEST["status"]);	
+}
+?>
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';	
+?>
+<title>OWS Security Proxy</title>
+<style type="text/css">
+
+body{
+	font-family: Arial, Helvetica, sans-serif;	
+}
+</style>
+<script language="JavaScript" type="text/javascript">
+function set(wms_id, status){
+	document.location.href = "<?php echo $self; ?>&wms_id="+wms_id+"&status="+status; 
+}
+</script>
+  
+</head>
+<body>
+<form>
+<table>
+<?php
+for($i=0; $i<count($ownwms); $i++){
+	echo "<tr>";
+	echo "<td>";
+	echo "<input type='checkbox' onclick='if(this.checked){set(\"".$ownwms[$i]."\",\"on\")}else{set(\"".$ownwms[$i]."\",\"off\")}' ";
+	if($admin->getWMSOWSstring($ownwms[$i]) != false){ echo "checked";  }
+	echo ">";
+	echo "</td>";
+	echo "<td>".$ownwms[$i]."</td>";
+	echo "<td>".$admin->getWmsTitleByWmsId($ownwms[$i])."</td>";
+	echo "</tr>";	
+}
+?>
+</table>
+</form>
+</body>
 </html>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_wfs.php
===================================================================
--- branches/print_dev/http/php/mod_wfs.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_wfs.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -66,6 +66,11 @@
 var iamready = false;
 </script>
 <?php
+
+function myNl2br ($str) {
+	return preg_replace('#\r?\n#', '\\n', $str);
+}
+
 echo "<script language='JavaScript' type='text/javascript'>";
 if(isset($_REQUEST['id']) && $_REQUEST['id']!=""){
 	$wfs = mb_split(",",$_REQUEST['id']);
@@ -154,18 +159,21 @@
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_label'] = '".htmlentities($row["f_label"], ENT_QUOTES, "UTF-8")."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_label_id'] = '".$row["f_label_id"]."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_show'] = '".$row["f_show"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_show_detail'] = '".$row["f_show_detail"]."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_respos'] = '".$row["f_respos"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_show_detail'] = '".$row["f_show_detail"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_detailpos'] = '".$row["f_detailpos"]."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['element_name'] = '".htmlentities($row["element_name"], ENT_QUOTES, "UTF-8")."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['element_type'] = '".htmlentities($row["element_type"], ENT_QUOTES, "UTF-8")."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_geom'] = '".$row["f_geom"]."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_gid'] = '".$row["f_gid"]."';";
-			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_form_element_html'] = \"".(preg_replace("/\n/", "", preg_replace("/\r/", "", htmlentities($row["f_form_element_html"], ENT_QUOTES, "UTF-8"))))."\";";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_form_element_html'] = \"".(preg_replace("/\n/", "", preg_replace("/\r/", "", $row["f_form_element_html"])))."\";";
 //			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_form_element_html'] = \"\";";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_edit'] = '".$row["f_edit"]."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_mandatory'] = '".$row["f_mandatory"]."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_auth_varname'] = '".htmlentities($row["f_auth_varname"], ENT_QUOTES, "UTF-8")."';";
 			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_operator'] = '".$row["f_operator"]."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_helptext'] = '".myNl2br(htmlentities($row["f_helptext"], ENT_QUOTES, "UTF-8"))."';";
+			echo "wfs_conf[".$i."]['element'][".$cnt."]['f_category_name'] = '".htmlentities($row["f_category_name"], ENT_QUOTES, "UTF-8")."';";
 			$cnt++;
 		}
 		if($cnt == 0){die("wfs_conf data not available");}		

Modified: branches/print_dev/http/php/mod_wfsSpatialRequest_messages.php
===================================================================
--- branches/print_dev/http/php/mod_wfsSpatialRequest_messages.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_wfsSpatialRequest_messages.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,42 +1,42 @@
-<?php
-#$Id: mod_insertWmcIntoDb.php 507 2006-11-20 10:55:57Z christoph $
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein 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.
-
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_json.php");
-
-$e = new mb_notice("locale: " . $_SESSION["mb_locale"] . "; lang: " . $_SESSION["mb_lang"]);
-setlocale(LC_ALL, $_SESSION["mb_locale"]);
-
-//
-// Messages
-//
-$msg_obj = array();
-$msg_obj["buttonLabelRectangle"] = _mb("select by rectangle");
-$msg_obj["buttonLabelPolygon"] = _mb("select by polygon");
-$msg_obj["buttonLabelPoint"] = _mb("select by point");
-$msg_obj["buttonLabelExtent"] = _mb("select by extent");
-$msg_obj["buttonLabelDialogue"] = _mb("open dialogue form");
-$msg_obj["errorMessageInvalidExtent"] = _mb("Invalid box!");
-
-$json = new Mapbender_JSON();
-$output = $json->encode($msg_obj);
-
-header("Content-type:application/x-json; charset=utf-8");
-echo $output;
+<?php
+#$Id: mod_insertWmcIntoDb.php 507 2006-11-20 10:55:57Z christoph $
+#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_insertWmcIntoDb.php,v 1.19 2006/03/09 14:02:42 uli_rothstein 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.
+
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_json.php");
+
+$e = new mb_notice("locale: " . $_SESSION["mb_locale"] . "; lang: " . $_SESSION["mb_lang"]);
+setlocale(LC_ALL, $_SESSION["mb_locale"]);
+
+//
+// Messages
+//
+$msg_obj = array();
+$msg_obj["buttonLabelRectangle"] = _mb("select by rectangle");
+$msg_obj["buttonLabelPolygon"] = _mb("select by polygon");
+$msg_obj["buttonLabelPoint"] = _mb("select by point");
+$msg_obj["buttonLabelExtent"] = _mb("select by extent");
+$msg_obj["buttonLabelDialogue"] = _mb("open dialogue form");
+$msg_obj["errorMessageInvalidExtent"] = _mb("Invalid box!");
+
+$json = new Mapbender_JSON();
+$output = $json->encode($msg_obj);
+
+header("Content-type:application/x-json; charset=utf-8");
+echo $output;
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- branches/print_dev/http/php/mod_wfs_gazetteer_server.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_wfs_gazetteer_server.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,139 +1,139 @@
-<?php
-# $Id: mod_wfs_gazetteer_server.php 1190 2007-10-18 10:38:38Z baudson $
-# http://www.mapbender.org/index.php/Administration
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__)."/../classes/class_json.php");
-require_once(dirname(__FILE__)."/../classes/class_administration.php");
-require_once(dirname(__FILE__)."/../classes/class_wfs_conf.php");
-require_once(dirname(__FILE__)."/../classes/class_universal_wfs_factory.php");
-require_once(dirname(__FILE__)."/../classes/class_universal_gml_factory.php");
-require_once(dirname(__FILE__)."/../classes/class_wfs_configuration.php");
-
-$command = $_REQUEST["command"];
-
-/**
- * checks if a variable name is valid.
- * Currently a valid name would be sth. like $_SESSION["mb_user_id"]
- * TODO: this function is also in mod_wfs_result!! Maybe merge someday.
- */
-function isValidVarName ($varname) {
-	if (preg_match("/[\$]{1}_[a-z]+\[\"[a-z_]+\"\]/i", $varname) != 0) {
-		return true;
-	}
-	return false;
-}
-
-/**
- * If access to the WFS conf is restricted, modify the filter.
- * TODO: this function is also in mod_wfs_result!! Maybe merge someday.
- */
- function checkAccessConstraint($filter, $wfs_conf_id) {
-	/* wfs_conf_element */
-	$sql = "SELECT * FROM wfs_conf_element ";
-	$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
-	$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = $1 ";
-	$sql .= "ORDER BY wfs_conf_element.f_respos";
-			
-	$v = array($wfs_conf_id);
-	$t = array('i');
-	$res = db_prep_query($sql,$v,$t);
-	while($row = db_fetch_array($res)){
-
-		if (!empty($row["f_auth_varname"])) {
-			$auth_varname = $row["f_auth_varname"];
-			$element_name = $row["element_name"];
-		}
-	}
-	if (!empty($auth_varname)) {
-
-		if (isValidVarName($auth_varname)) {
-			$user = eval("return " . $auth_varname . ";");
-			if ($user) {
-				$pattern = "(<ogc:Filter[^>]*>)(.*)(</ogc:Filter>)";
-				$replacement = "\\1<And>\\2<ogc:PropertyIsEqualTo><ogc:PropertyName>" . $element_name . "</ogc:PropertyName><ogc:Literal>" . $user . "</ogc:Literal></ogc:PropertyIsEqualTo></And>\\3"; 
-				$filter = mb_eregi_replace($pattern, $replacement, $filter);
-			}
-			else {
-				$e = new mb_exception("mod_wfs_gazetteer_server: checkAccessConstraint: invalid value of variable containing user information!");
-			}
-		}
-		else {
-			$e = new mb_exception("mod_wfs_gazetteer_server: checkAccessConstraint: var name is not valid! (" . $auth_varname . ")");
-		}
-	}
-	return $filter;
-}
-
-
-if ($command == "getWfsConf") {
-	
-	$wfsConfIdString = $_GET["wfsConfIdString"];
-	
-	if ($wfsConfIdString != "") {
-		//array_keys(array_flip()) produces an array with unique entries
-		$wfsConfIdArray = array_keys(array_flip(mb_split(",", $wfsConfIdString)));
-	}
-	else {
-		echo "please specify wfs conf id.";
-		die();
-	}
-	
-	$obj = new WfsConf();
-	$obj->load($wfsConfIdArray);
-	$json = new Mapbender_JSON();
-	$output = $json->encode($obj->confArray);
-	echo $output;
-}
-else if ($command == "getSearchResults") {
-	$wfs_conf_id = $_REQUEST["wfs_conf_id"];
-	$backlink = $_REQUEST["backlink"];
-	$frame = $_REQUEST["frame"];
-	$filter = $_REQUEST["filter"];
-	$url = $_REQUEST["url"];
-	$typename = $_REQUEST["typename"];
-
-	$wfsConf = WfsConfiguration::createFromDb($wfs_conf_id);
-	if (is_null($wfsConf)) {
-		sendErrorMessage("Invalid WFS conf: " . $wfs_conf_id);
-	}
-	
-	$admin = new administration();
-	
-	$filter = $admin->char_decode(stripslashes($filter));
-
-	$wfsId = $wfsConf->wfsId;
-
-	$myWfsFactory = new UniversalWfsFactory();
-	$myWfs = $myWfsFactory->createFromDb($wfsId);
-	$data = $myWfs->getFeature($typename, $filter);
-	if ($data === null) die('{}');
-	
-//	$geomColumn = WfsConf::getGeomColumnNameByConfId($wfs_conf_id);
-
-	$gmlFactory = new UniversalGmlFactory();
-	$myGml = $gmlFactory->createFromXml($data, $wfsConf);
-	$geoJson = $myGml->toGeoJSON();
-	
-	header("Content-type:application/x-json; charset=utf-8");
-	echo $geoJson;
-}
-else {
-	echo "please enter a valid command.";
-}
+<?php
+# $Id: mod_wfs_gazetteer_server.php 1190 2007-10-18 10:38:38Z baudson $
+# http://www.mapbender.org/index.php/Administration
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../classes/class_json.php");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_wfs_conf.php");
+require_once(dirname(__FILE__)."/../classes/class_universal_wfs_factory.php");
+require_once(dirname(__FILE__)."/../classes/class_universal_gml_factory.php");
+require_once(dirname(__FILE__)."/../classes/class_wfs_configuration.php");
+
+$command = $_REQUEST["command"];
+
+/**
+ * checks if a variable name is valid.
+ * Currently a valid name would be sth. like $_SESSION["mb_user_id"]
+ * TODO: this function is also in mod_wfs_result!! Maybe merge someday.
+ */
+function isValidVarName ($varname) {
+	if (preg_match("/[\$]{1}_[a-z]+\[\"[a-z_]+\"\]/i", $varname) != 0) {
+		return true;
+	}
+	return false;
+}
+
+/**
+ * If access to the WFS conf is restricted, modify the filter.
+ * TODO: this function is also in mod_wfs_result!! Maybe merge someday.
+ */
+ function checkAccessConstraint($filter, $wfs_conf_id) {
+	/* wfs_conf_element */
+	$sql = "SELECT * FROM wfs_conf_element ";
+	$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
+	$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = $1 ";
+	$sql .= "ORDER BY wfs_conf_element.f_respos";
+			
+	$v = array($wfs_conf_id);
+	$t = array('i');
+	$res = db_prep_query($sql,$v,$t);
+	while($row = db_fetch_array($res)){
+
+		if (!empty($row["f_auth_varname"])) {
+			$auth_varname = $row["f_auth_varname"];
+			$element_name = $row["element_name"];
+		}
+	}
+	if (!empty($auth_varname)) {
+
+		if (isValidVarName($auth_varname)) {
+			$user = eval("return " . $auth_varname . ";");
+			if ($user) {
+				$pattern = "(<ogc:Filter[^>]*>)(.*)(</ogc:Filter>)";
+				$replacement = "\\1<And>\\2<ogc:PropertyIsEqualTo><ogc:PropertyName>" . $element_name . "</ogc:PropertyName><ogc:Literal>" . $user . "</ogc:Literal></ogc:PropertyIsEqualTo></And>\\3"; 
+				$filter = mb_eregi_replace($pattern, $replacement, $filter);
+			}
+			else {
+				$e = new mb_exception("mod_wfs_gazetteer_server: checkAccessConstraint: invalid value of variable containing user information!");
+			}
+		}
+		else {
+			$e = new mb_exception("mod_wfs_gazetteer_server: checkAccessConstraint: var name is not valid! (" . $auth_varname . ")");
+		}
+	}
+	return $filter;
+}
+
+
+if ($command == "getWfsConf") {
+	
+	$wfsConfIdString = $_GET["wfsConfIdString"];
+	
+	if ($wfsConfIdString != "") {
+		//array_keys(array_flip()) produces an array with unique entries
+		$wfsConfIdArray = array_keys(array_flip(mb_split(",", $wfsConfIdString)));
+	}
+	else {
+		echo "please specify wfs conf id.";
+		die();
+	}
+	
+	$obj = new WfsConf();
+	$obj->load($wfsConfIdArray);
+	$json = new Mapbender_JSON();
+	$output = $json->encode($obj->confArray);
+	echo $output;
+}
+else if ($command == "getSearchResults") {
+	$wfs_conf_id = $_REQUEST["wfs_conf_id"];
+	$backlink = $_REQUEST["backlink"];
+	$frame = $_REQUEST["frame"];
+	$filter = $_REQUEST["filter"];
+	$url = $_REQUEST["url"];
+	$typename = $_REQUEST["typename"];
+
+	$wfsConf = WfsConfiguration::createFromDb($wfs_conf_id);
+	if (is_null($wfsConf)) {
+		sendErrorMessage("Invalid WFS conf: " . $wfs_conf_id);
+	}
+	
+	$admin = new administration();
+	
+	$filter = $admin->char_decode(stripslashes($filter));
+
+	$wfsId = $wfsConf->wfsId;
+
+	$myWfsFactory = new UniversalWfsFactory();
+	$myWfs = $myWfsFactory->createFromDb($wfsId);
+	$data = $myWfs->getFeature($typename, $filter);
+	if ($data === null) die('{}');
+	
+//	$geomColumn = WfsConf::getGeomColumnNameByConfId($wfs_conf_id);
+
+	$gmlFactory = new UniversalGmlFactory();
+	$myGml = $gmlFactory->createFromXml($data, $wfsConf);
+	$geoJson = $myGml->toGeoJSON();
+	
+	header("Content-type:application/x-json; charset=utf-8");
+	echo $geoJson;
+}
+else {
+	echo "please enter a valid command.";
+}
 ?>
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_wfs_result.php
===================================================================
--- branches/print_dev/http/php/mod_wfs_result.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_wfs_result.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,105 +1,105 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/Administration
-# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
-require_once(dirname(__FILE__) . "/../classes/class_stripRequest.php");
-require_once(dirname(__FILE__) . "/../classes/class_connector.php");
-require_once(dirname(__FILE__)."/../classes/class_wfs_configuration.php");
-require_once(dirname(__FILE__)."/../classes/class_wfs.php");
-require_once(dirname(__FILE__)."/../classes/class_universal_wfs_factory.php");
-require_once(dirname(__FILE__)."/../classes/class_universal_gml_factory.php");
-
-$filter = stripslashes($_REQUEST["filter"]);
-$db_wfs_conf_id = $_REQUEST["db_wfs_conf_id"];
-$typename = $_REQUEST["typename"];
-
-/**
- * checks if a variable name is valid.
- * Currently a valid name would be sth. like $_SESSION["mb_user_id"]
- * TODO: this function is also in mod_wfs_result!! Maybe merge someday.
- */
-function isValidVarName ($varname) {
-	if (preg_match("/[\$]{1}_[a-z]+\[\"[a-z_]+\"\]/i", $varname) != 0) {
-		return true;
-	}
-	return false;
-}
-/**
- * If access to the WFS conf is restricted, modify the filter.
- * TODO: this function is also in mod_wfs_result!! Maybe merge someday.
- */
-function checkAccessConstraint($filter, $wfs_conf_id) {
-	/* wfs_conf_element */
-	$sql = "SELECT * FROM wfs_conf_element ";
-	$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
-	$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = $1 ";
-	$sql .= "ORDER BY wfs_conf_element.f_respos";
-			
-	$v = array($wfs_conf_id);
-	$t = array('i');
-	$res = db_prep_query($sql,$v,$t);
-	while($row = db_fetch_array($res)){
-
-		if (!empty($row["f_auth_varname"])) {
-			$auth_varname = $row["f_auth_varname"];
-			$element_name = $row["element_name"];
-		}
-	}
-	$e = new mb_exception($auth_varname . " " . $element_name);
-	if (!empty($auth_varname)) {
-
-		if (isValidVarName($auth_varname)) {
-			$user = eval("return " . $auth_varname . ";");
-			$pattern = "(<ogc:Filter[^>]*>)(.*)(</ogc:Filter>)";
-			$replacement = "\\1<And>\\2<ogc:PropertyIsEqualTo><ogc:PropertyName>" . $element_name . "</ogc:PropertyName><ogc:Literal>" . $user . "</ogc:Literal></ogc:PropertyIsEqualTo></And>\\3"; 
-			$filter = eregi_replace($pattern, $replacement, $filter);
-		}
-	}
-	return $filter;
-}
-
-$filter = checkAccessConstraint($filter, $db_wfs_conf_id);
-
-$sql = "SELECT fkey_wfs_id FROM wfs_conf WHERE wfs_conf_id = $1";
-$v = array($db_wfs_conf_id);
-$t = array('i');
-$res = db_prep_query($sql, $v, $t);
-$row = db_fetch_array($res);
-$wfsId = $row["fkey_wfs_id"];
-
-
-$myWfsFactory = new UniversalWfsFactory();
-$myWfs = $myWfsFactory->createFromDb($wfsId);
-$data = $myWfs->getFeature($typename, $filter);
-
-if ($data === null) die('{}');
-
-$myWfsConf = WfsConfiguration::createFromDb($db_wfs_conf_id);
-if (is_null($myWfsConf)) {
-	die("{}");
-}
-
-$gmlFactory = new UniversalGmlFactory();
-$myGml = $gmlFactory->createFromXml($data, $myWfsConf);
-
-$geoJson = $myGml->toGeoJSON();
-
-header('Content-type: text/html');
-echo $geoJson;
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/Administration
+# 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(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__) . "/../classes/class_stripRequest.php");
+require_once(dirname(__FILE__) . "/../classes/class_connector.php");
+require_once(dirname(__FILE__)."/../classes/class_wfs_configuration.php");
+require_once(dirname(__FILE__)."/../classes/class_wfs.php");
+require_once(dirname(__FILE__)."/../classes/class_universal_wfs_factory.php");
+require_once(dirname(__FILE__)."/../classes/class_universal_gml_factory.php");
+
+$filter = stripslashes($_REQUEST["filter"]);
+$db_wfs_conf_id = $_REQUEST["db_wfs_conf_id"];
+$typename = $_REQUEST["typename"];
+
+/**
+ * checks if a variable name is valid.
+ * Currently a valid name would be sth. like $_SESSION["mb_user_id"]
+ * TODO: this function is also in mod_wfs_result!! Maybe merge someday.
+ */
+function isValidVarName ($varname) {
+	if (preg_match("/[\$]{1}_[a-z]+\[\"[a-z_]+\"\]/i", $varname) != 0) {
+		return true;
+	}
+	return false;
+}
+/**
+ * If access to the WFS conf is restricted, modify the filter.
+ * TODO: this function is also in mod_wfs_result!! Maybe merge someday.
+ */
+function checkAccessConstraint($filter, $wfs_conf_id) {
+	/* wfs_conf_element */
+	$sql = "SELECT * FROM wfs_conf_element ";
+	$sql .= "JOIN wfs_element ON wfs_conf_element.f_id = wfs_element.element_id ";
+	$sql .= "WHERE wfs_conf_element.fkey_wfs_conf_id = $1 ";
+	$sql .= "ORDER BY wfs_conf_element.f_respos";
+			
+	$v = array($wfs_conf_id);
+	$t = array('i');
+	$res = db_prep_query($sql,$v,$t);
+	while($row = db_fetch_array($res)){
+
+		if (!empty($row["f_auth_varname"])) {
+			$auth_varname = $row["f_auth_varname"];
+			$element_name = $row["element_name"];
+		}
+	}
+	$e = new mb_exception($auth_varname . " " . $element_name);
+	if (!empty($auth_varname)) {
+
+		if (isValidVarName($auth_varname)) {
+			$user = eval("return " . $auth_varname . ";");
+			$pattern = "(<ogc:Filter[^>]*>)(.*)(</ogc:Filter>)";
+			$replacement = "\\1<And>\\2<ogc:PropertyIsEqualTo><ogc:PropertyName>" . $element_name . "</ogc:PropertyName><ogc:Literal>" . $user . "</ogc:Literal></ogc:PropertyIsEqualTo></And>\\3"; 
+			$filter = eregi_replace($pattern, $replacement, $filter);
+		}
+	}
+	return $filter;
+}
+
+$filter = checkAccessConstraint($filter, $db_wfs_conf_id);
+
+$sql = "SELECT fkey_wfs_id FROM wfs_conf WHERE wfs_conf_id = $1";
+$v = array($db_wfs_conf_id);
+$t = array('i');
+$res = db_prep_query($sql, $v, $t);
+$row = db_fetch_array($res);
+$wfsId = $row["fkey_wfs_id"];
+
+
+$myWfsFactory = new UniversalWfsFactory();
+$myWfs = $myWfsFactory->createFromDb($wfsId);
+$data = $myWfs->getFeature($typename, $filter);
+
+if ($data === null) die('{}');
+
+$myWfsConf = WfsConfiguration::createFromDb($db_wfs_conf_id);
+if (is_null($myWfsConf)) {
+	die("{}");
+}
+
+$gmlFactory = new UniversalGmlFactory();
+$myGml = $gmlFactory->createFromXml($data, $myWfsConf);
+
+$geoJson = $myGml->toGeoJSON();
+
+header('Content-type: text/html');
+echo $geoJson;
 ?> 
\ No newline at end of file

Modified: branches/print_dev/http/php/mod_zoomCoords.php
===================================================================
--- branches/print_dev/http/php/mod_zoomCoords.php	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/http/php/mod_zoomCoords.php	2009-06-23 10:57:59 UTC (rev 4088)
@@ -44,12 +44,12 @@
 	   if(zoomCoords_permanentHighlight =='true'){
 		   setPermanentMarker(x,y);
 	   }
-  		hideHighlight()
+  		hideHighlightZoomcoords()
       	zoom(mod_zoomCoords_target[0],true, 1.0,x,y);
    }
 }
 
-function highlight(x, y){
+function highlightZoomcoords(x, y){
 	if(x!='' && y!=''){   
 	   x=x.replace(",",".");
 	   y=y.replace(",",".");
@@ -70,7 +70,7 @@
 }
 
 
-function hideHighlight(){
+function hideHighlightZoomcoords(){
 	for(var i=0;i<mod_zoomCoords_target.length;i++){
 		mb_hideHighlight(mod_zoomCoords_target[i]);
 	}
@@ -98,7 +98,7 @@
       echo "<span style='position: absolute;left: 80px;top:5px;color: Gray;'>"._mb("Latitude").":</span>";
       echo "<input style='position: absolute;left:5px;top:20px;color: Gray;width:65px;border: solid thin;height:20px;' type='text' name='X'>";
       echo "<input style='position: absolute;left:80px;top:20px;color: Gray;width:65px;border: solid thin;height:20px;'class='texty' type='text' name='Y'>";
-      echo "<input style='position: absolute;left:150px;top:20px;color: Gray;border: solid thin;height:20px;' type='button' value='"._mb("ok")."' onclick='zoomCoordinate(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value); highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseover='highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseout='hideHighlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' >";
+      echo "<input style='position: absolute;left:150px;top:20px;color: Gray;border: solid thin;height:20px;' type='button' value='"._mb("ok")."' onclick='zoomCoordinate(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value); highlightZoomcoords(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseover='highlightZoomcoords(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseout='hideHighlightZoomcoords(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' >";
 
 echo "</form>";
 ?>";

Modified: branches/print_dev/lib/buttonNew.js
===================================================================
--- branches/print_dev/lib/buttonNew.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/lib/buttonNew.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -8,7 +8,6 @@
 	
 	this.add = function (button) {
 		if (!button.constructor == "Button") {
-//			console.log("not a button, but a %s", button.constructor);
 			return false;
 		}
 		if (button.type == "toggle") {

Modified: branches/print_dev/lib/core.js
===================================================================
--- branches/print_dev/lib/core.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/lib/core.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,3 +1,7 @@
+var Mapbender = {
+	Event : {}
+};
+
 var currentWmcExtensionData = {};
 var restoredWmcExtensionData = {};
 
@@ -39,25 +43,25 @@
 /**
  * Triggered when Mapbender is loaded and after the map object has been initialised.
  */
-var eventInit = new MapbenderEvent();
+var eventInit = Mapbender.Event.init = new MapbenderEvent();
 
 /**
  * Triggered before eventInit.
  */
-var eventBeforeInit = new MapbenderEvent();
+var eventBeforeInit = Mapbender.Event.beforeInit = new MapbenderEvent();
 
 /**
  * Triggered after Mapbender is loaded and has been initialised.
  * Used to trigger initial map requests
  */
-var eventAfterInit = new MapbenderEvent();
+var eventAfterInit = Mapbender.Event.afterInit = new MapbenderEvent();
 
 /**
  * Initializes the map object. Triggered when Mapbender is loaded. 
  */
-var eventInitMap = new MapbenderEvent();
+var eventInitMap = Mapbender.Event.initMaps = new MapbenderEvent();
 
-eventInit.register(function() {
+Mapbender.Event.init.register(function() {
 	$lm = $("#loading_mapbender");
 	$cm = $("#complete_mapbender");
 	$lm.empty();
@@ -67,7 +71,7 @@
 /**
  * Switches the locale. Triggered by module switch_locale or onload(?) 
  */
-var eventLocalize = new MapbenderEvent();
+var eventLocalize = Mapbender.Event.localize = new MapbenderEvent();
 
 /**
  * Triggered after the map object has been created. 
@@ -172,16 +176,9 @@
 /**
  * Called in index.php on body onload
  */
-function init() {
-	// creates the map objects (mapframe1, overview...)
-	eventInitMap.trigger();
 
-	eventBeforeInit.trigger();
-
-	// initialisation
-	eventInit.trigger();
-	
-	eventAfterInit.trigger();
+function init(){
+	new Mb_notice("old body onload init");
 }
 
 /**

Modified: branches/print_dev/lib/exception.js
===================================================================
--- branches/print_dev/lib/exception.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/lib/exception.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -51,14 +51,25 @@
 				alert(message);
 			}
 			else if (log_js == "console") {
-				if (level == "warning") {
-					console.warn("%s", message);
+				if ($.browser.msie) {
+					try {
+						mb_ajax_post('../php/mb_js_exception.php', {level:level,text:message});
+					}
+					catch(e) {
+						alert(e + ": " + message);
+					}
+					
 				}
-				else if (level == "error") {
-					console.error("%s", message);
-				}
 				else {
-					console.log("%s", message);
+					if (level == "warning") {
+						console.warn("%s", message);
+					}
+					else if (level == "error") {
+						console.error("%s", message);
+					}
+					else {
+						console.log("%s", message);
+					}
 				}
 			}
 		}

Modified: branches/print_dev/lib/point.js
===================================================================
--- branches/print_dev/lib/point.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/lib/point.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,172 +1,172 @@
-/* 
-* $Id:point.js 2476 2008-05-28 15:03:41Z christoph $
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
-*/
-//http://www.mapbender.org/index.php/point.js
-
-/**
- * @class A class representing a two-dimensional point.
- *
- * @constructor
- * @param {Float} x x value of the {@link Point}
- * @param {Float} y y value of the {@link Point}
- */
- function Point(x, y, z){
- 	/**
- 	 * x value of the {@link Point}
- 	 *
-	 * @type Float
-	 */
-//	this.x = parseFloat(x);
-	this.x = x;
- 	/**
- 	 * y value of the {@link Point}
-	 *
-	 * @type Float
-	 */
-//	this.y = parseFloat(y);
-	this.y = y;
-	
-	this.z = z;
-	
-}
-/**
- * computes the distance between a {@link Point} p and this {@link Point}
- *
- * @param {Point} p the distance between this {@link Point} and the {@link Point} p is computed.
- * @return {Float} the distance between the two {@link Point} objects.
- */
-Point.prototype.dist = function(p){
-	return Math.sqrt(Math.pow(this.y-p.y,2) + Math.pow(this.x-p.x,2)) ;
-};
-/**
- * checks if the coordinates of this {@link Point} match the coordinates of a {@link Point} p
- *
- * @param {Point} p 
- * @return {Boolean} true if the two points are equal; elso false
- */
-Point.prototype.equals = function(p){
-	if (this.x == p.x && this.y == p.y) {return true;}
-	return false;
-};
-/**
- * subtracts a {@link Point} p from this {@link Point}
- *
- * @param {Point} p 
- * @return a new {@link Point} with the difference of the two points
- */
-Point.prototype.minus = function(p){
-	return new Point(this.x-p.x, this.y-p.y);
-};
-/**
- * adds this {@link Point} to a {@link Point} p
- *
- * @param {Point} p 
- * @return a new {@link Point} with the sum of the two points
- */
-Point.prototype.plus = function(p){
-	return new Point(this.x+p.x, this.y+p.y);
-};
-/**
- * divides this {@link Point} by a scalar c
- *
- * @param {Float} c divisor
- * @return a new {@link Point} divided by c
- */
-Point.prototype.dividedBy = function(c){
-	if (c !== 0) {
-		return new Point(this.x/c, this.y/c);
-	}
-	var e = new Mb_exception("Point.dividedBy: Division by zero");
-	return false;
-};
-/**
- * multiplies this {@link Point} by a scalar c
- *
- * @param {Float} c factor
- * @return a new {@link Point} multiplied by c
- */
-Point.prototype.times = function(c){
-	return new Point(this.x*c, this.y*c);
-};
-/**
- * rounds the coordinates to numOfDigits digits
- *
- * @param numOfDigits the coordinate will be rounded to numOfDigits digits
- * @return a new {@link Point} rounded to numOfDigits digits
- * @type Point
- */
-Point.prototype.round = function(numOfDigits){
-	return new Point(roundToDigits(this.x, numOfDigits), roundToDigits(this.y, numOfDigits));
-};
-/**
- * @returns a {String} representation of this Point
- * @type String
- */
-Point.prototype.toString = function(){
-	if (typeof(this.z == "undefined")) {
-		return "[" + this.x + ", " + this.y + "]";
-	}
-	else {
-		return "[" + this.x + ", " + this.y + ", " + this.z + "]";
-	}
-};
-
-
-//------------------------------------------------------------------------
-// possible improvement: point has flag: map OR real. additional functions: toReal, toMap
-/**
- * @ignore
- */
-function mapToReal(frameName, aPoint) {
-	var ind = getMapObjIndexByName(frameName);
-	return mb_mapObj[ind].convertPixelToReal(aPoint);
-}
-/**
- * @ignore
- */
-function realToMap(frameName, aPoint) {
-	var ind = getMapObjIndexByName(frameName);
-	return mb_mapObj[ind].convertRealToPixel(aPoint);
-}
-/**
- * @ignore
- */
-function mb_calcExtent(frameName, min, max) {
-	var ind;
-	if (typeof(mb_mapObj) == 'object') {
-		ind = getMapObjIndexByName(frameName);
-	}
-	else if (typeof(parent.mb_mapObj) == 'object') {
-		ind = parent.getMapObjIndexByName(frameName);
-	}
-	else {
-		var e = new Mb_exception('Point.mb_calcExtent: function getMapObjIndexByName not found');
-	}
-	var extent = max.minus(min);
-	var center = extent.dividedBy(2).plus(min);
-	
-	var relation_px_x = mb_mapObj[ind].width / mb_mapObj[ind].height;
-	var relation_px_y = mb_mapObj[ind].height / mb_mapObj[ind].width;
-	var relation_bbox_x = extent.x / extent.y;     
-	
-	var new_min;
-	var new_max;
-	
-	if(relation_bbox_x <= relation_px_x){                
-		new_min = new Point(center.x - relation_px_x * extent.y / 2, min.y);
-		new_max = new Point(center.x + relation_px_x * extent.y / 2, max.y);
-	}
-	else if(relation_bbox_x > relation_px_x){                
-		new_min = new Point(min.x, center.y - relation_px_y * extent.x / 2);
-		new_max = new Point(max.x, center.y + relation_px_y * extent.x / 2);
-	}
-	mb_mapObj[ind].extent = new_min.x +","+ new_min.y +","+ new_max.x  +","+ new_max.y;
-}
-/**
- * @ignore
- */
-function roundToDigits(aFloat, numberOfDigits) {
-	return Math.round(aFloat*Math.pow(10, parseInt(numberOfDigits, 10)))/Math.pow(10, parseInt(numberOfDigits, 10));
-}
+/* 
+* $Id:point.js 2476 2008-05-28 15:03:41Z christoph $
+* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
+* License (>=v2). Read the file gpl.txt that comes with Mapbender for details. 
+*/
+//http://www.mapbender.org/index.php/point.js
+
+/**
+ * @class A class representing a two-dimensional point.
+ *
+ * @constructor
+ * @param {Float} x x value of the {@link Point}
+ * @param {Float} y y value of the {@link Point}
+ */
+ function Point(x, y, z){
+ 	/**
+ 	 * x value of the {@link Point}
+ 	 *
+	 * @type Float
+	 */
+//	this.x = parseFloat(x);
+	this.x = x;
+ 	/**
+ 	 * y value of the {@link Point}
+	 *
+	 * @type Float
+	 */
+//	this.y = parseFloat(y);
+	this.y = y;
+	
+	this.z = z;
+	
+}
+/**
+ * computes the distance between a {@link Point} p and this {@link Point}
+ *
+ * @param {Point} p the distance between this {@link Point} and the {@link Point} p is computed.
+ * @return {Float} the distance between the two {@link Point} objects.
+ */
+Point.prototype.dist = function(p){
+	return Math.sqrt(Math.pow(this.y-p.y,2) + Math.pow(this.x-p.x,2)) ;
+};
+/**
+ * checks if the coordinates of this {@link Point} match the coordinates of a {@link Point} p
+ *
+ * @param {Point} p 
+ * @return {Boolean} true if the two points are equal; elso false
+ */
+Point.prototype.equals = function(p){
+	if (this.x == p.x && this.y == p.y) {return true;}
+	return false;
+};
+/**
+ * subtracts a {@link Point} p from this {@link Point}
+ *
+ * @param {Point} p 
+ * @return a new {@link Point} with the difference of the two points
+ */
+Point.prototype.minus = function(p){
+	return new Point(this.x-p.x, this.y-p.y);
+};
+/**
+ * adds this {@link Point} to a {@link Point} p
+ *
+ * @param {Point} p 
+ * @return a new {@link Point} with the sum of the two points
+ */
+Point.prototype.plus = function(p){
+	return new Point(this.x+p.x, this.y+p.y);
+};
+/**
+ * divides this {@link Point} by a scalar c
+ *
+ * @param {Float} c divisor
+ * @return a new {@link Point} divided by c
+ */
+Point.prototype.dividedBy = function(c){
+	if (c !== 0) {
+		return new Point(this.x/c, this.y/c);
+	}
+	var e = new Mb_exception("Point.dividedBy: Division by zero");
+	return false;
+};
+/**
+ * multiplies this {@link Point} by a scalar c
+ *
+ * @param {Float} c factor
+ * @return a new {@link Point} multiplied by c
+ */
+Point.prototype.times = function(c){
+	return new Point(this.x*c, this.y*c);
+};
+/**
+ * rounds the coordinates to numOfDigits digits
+ *
+ * @param numOfDigits the coordinate will be rounded to numOfDigits digits
+ * @return a new {@link Point} rounded to numOfDigits digits
+ * @type Point
+ */
+Point.prototype.round = function(numOfDigits){
+	return new Point(roundToDigits(this.x, numOfDigits), roundToDigits(this.y, numOfDigits));
+};
+/**
+ * @returns a {String} representation of this Point
+ * @type String
+ */
+Point.prototype.toString = function(){
+	if (typeof(this.z == "undefined")) {
+		return "[" + this.x + ", " + this.y + "]";
+	}
+	else {
+		return "[" + this.x + ", " + this.y + ", " + this.z + "]";
+	}
+};
+
+
+//------------------------------------------------------------------------
+// possible improvement: point has flag: map OR real. additional functions: toReal, toMap
+/**
+ * @ignore
+ */
+function mapToReal(frameName, aPoint) {
+	var ind = getMapObjIndexByName(frameName);
+	return mb_mapObj[ind].convertPixelToReal(aPoint);
+}
+/**
+ * @ignore
+ */
+function realToMap(frameName, aPoint) {
+	var ind = getMapObjIndexByName(frameName);
+	return mb_mapObj[ind].convertRealToPixel(aPoint);
+}
+/**
+ * @ignore
+ */
+function mb_calcExtent(frameName, min, max) {
+	var ind;
+	if (typeof(mb_mapObj) == 'object') {
+		ind = getMapObjIndexByName(frameName);
+	}
+	else if (typeof(parent.mb_mapObj) == 'object') {
+		ind = parent.getMapObjIndexByName(frameName);
+	}
+	else {
+		var e = new Mb_exception('Point.mb_calcExtent: function getMapObjIndexByName not found');
+	}
+	var extent = max.minus(min);
+	var center = extent.dividedBy(2).plus(min);
+	
+	var relation_px_x = mb_mapObj[ind].width / mb_mapObj[ind].height;
+	var relation_px_y = mb_mapObj[ind].height / mb_mapObj[ind].width;
+	var relation_bbox_x = extent.x / extent.y;     
+	
+	var new_min;
+	var new_max;
+	
+	if(relation_bbox_x <= relation_px_x){                
+		new_min = new Point(center.x - relation_px_x * extent.y / 2, min.y);
+		new_max = new Point(center.x + relation_px_x * extent.y / 2, max.y);
+	}
+	else if(relation_bbox_x > relation_px_x){                
+		new_min = new Point(min.x, center.y - relation_px_y * extent.x / 2);
+		new_max = new Point(max.x, center.y + relation_px_y * extent.x / 2);
+	}
+	mb_mapObj[ind].extent = new_min.x +","+ new_min.y +","+ new_max.x  +","+ new_max.y;
+}
+/**
+ * @ignore
+ */
+function roundToDigits(aFloat, numberOfDigits) {
+	return Math.round(aFloat*Math.pow(10, parseInt(numberOfDigits, 10)))/Math.pow(10, parseInt(numberOfDigits, 10));
+}

Modified: branches/print_dev/lib/style.js
===================================================================
--- branches/print_dev/lib/style.js	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/lib/style.js	2009-06-23 10:57:59 UTC (rev 4088)
@@ -1,54 +1,54 @@
-/**
- * creates a style tag in the head of the document.
- *
- */
-var StyleTag = function() {
-
-	/**
-	 * Creates the style tag in the head of the document. Something like a constructor. 
-	 *
-	 */
-	var createStyleTag = function() {
-		// TODO: Internet Explorer routine seems a little buggy
-		if ($.browser.msie) {
-			// create a Style Sheet object (IE only)
-			//styleSheetObj=document.createStyleSheet();
-			// get the DOM node of the style sheet object, set the type
-			//styleObj=styleSheetObj.owningElement || styleSheetObj.ownerNode;
-			//styleObj.setAttribute("type","text/css");
-			
-			// alternative way for IE: take existing styleSheet with index 0 instead of creating a new one
-			styleSheetObj=document.styleSheets[0];
-		}
-		else {
-			// create the style node, set the style
-			styleObj=document.createElement("style");
-			styleObj.setAttribute("type","text/css");
-			// append the node to the head
-			document.getElementsByTagName("head")[0].appendChild(styleObj);
-		}
-	};
-	
-	/**
-	 * Adds a class className with the CSS in cssString
-	 */
-	this.addClass = function(className,cssString) {
-		// TODO: Internet Explorer routine seems a little buggy
-		if ($.browser.msie) {
-			//add new style declaration to chosen styleSheet 
-			var cssRules = cssString.split(";");
-			for (i=0; i<cssRules.length-1; i++){
-				styleSheetObj.addRule("."+className,cssRules[i]);
-			}
-		}
-		else {
-			// insert the content via createTextNode
-			styleObj.appendChild(document.createTextNode("."+className+"{\n\t"+cssString+"\n}\n"));				
-		}
-	};
-	
-	var styleObj;
-	var styleSheetObj; //IE only...
-	
-	createStyleTag();
-};
+/**
+ * creates a style tag in the head of the document.
+ *
+ */
+var StyleTag = function() {
+
+	/**
+	 * Creates the style tag in the head of the document. Something like a constructor. 
+	 *
+	 */
+	var createStyleTag = function() {
+		// TODO: Internet Explorer routine seems a little buggy
+		if ($.browser.msie) {
+			// create a Style Sheet object (IE only)
+			//styleSheetObj=document.createStyleSheet();
+			// get the DOM node of the style sheet object, set the type
+			//styleObj=styleSheetObj.owningElement || styleSheetObj.ownerNode;
+			//styleObj.setAttribute("type","text/css");
+			
+			// alternative way for IE: take existing styleSheet with index 0 instead of creating a new one
+			styleSheetObj=document.styleSheets[0];
+		}
+		else {
+			// create the style node, set the style
+			styleObj=document.createElement("style");
+			styleObj.setAttribute("type","text/css");
+			// append the node to the head
+			document.getElementsByTagName("head")[0].appendChild(styleObj);
+		}
+	};
+	
+	/**
+	 * Adds a class className with the CSS in cssString
+	 */
+	this.addClass = function(className,cssString) {
+		// TODO: Internet Explorer routine seems a little buggy
+		if ($.browser.msie) {
+			//add new style declaration to chosen styleSheet 
+			var cssRules = cssString.split(";");
+			for (i=0; i<cssRules.length-1; i++){
+				styleSheetObj.addRule("."+className,cssRules[i]);
+			}
+		}
+		else {
+			// insert the content via createTextNode
+			styleObj.appendChild(document.createTextNode("."+className+"{\n\t"+cssString+"\n}\n"));				
+		}
+	};
+	
+	var styleObj;
+	var styleSheetObj; //IE only...
+	
+	createStyleTag();
+};

Modified: branches/print_dev/resources/db/update/update_2.7.sql
===================================================================
--- branches/print_dev/resources/db/update/update_2.7.sql	2009-06-23 10:55:34 UTC (rev 4087)
+++ branches/print_dev/resources/db/update/update_2.7.sql	2009-06-23 10:57:59 UTC (rev 4088)
@@ -60,4 +60,28 @@
 INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Load a web map context document', 'Załaduj web map context dokument');
 INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Logo', 'Logo');
 INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Measure distance', 'Zmierz odległość');
-INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Set language', 'Wybierz język');
\ No newline at end of file
+INSERT INTO translations (locale, msgid, msgstr ) VALUES ('pl', 'Set language', 'Wybierz język');
+
+
+--
+-- update wfs conf module
+UPDATE gui_element SET
+e_attributes = 'href = "../php/mod_wfs_conf_client.php" target="AdminFrame"'
+WHERE e_id = 'wfs_conf' AND fkey_gui_id IN ('admin1', 'admin_de_services', 'admin_en_services');
+
+ALTER TABLE wfs_conf ADD COLUMN
+wfs_conf_type int4 NOT NULL DEFAULT 0;
+--
+-- new wfs conf columns
+ALTER TABLE wfs_conf_element ADD COLUMN
+f_helptext text;
+
+ALTER TABLE wfs_conf_element ADD COLUMN
+f_category_name varchar(255) NOT NULL DEFAULT '';
+
+-- reload uses Mapbender API
+UPDATE gui_element SET e_attributes = '' WHERE e_id = 'reload';
+
+
+-- body uses Mapbender API
+UPDATE gui_element SET e_attributes = '' WHERE e_id = 'body'
\ No newline at end of file



More information about the Mapbender_commits mailing list