[Mapbender-commits] r7334 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Dec 17 11:17:34 EST 2010


Author: christoph
Date: 2010-12-17 08:17:34 -0800 (Fri, 17 Dec 2010)
New Revision: 7334

Modified:
   trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList_ajax.php
Log:
#117

Modified: trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList_ajax.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList_ajax.php	2010-12-17 15:36:08 UTC (rev 7333)
+++ trunk/mapbender/http/javascripts/mod_addWMSfromfilteredList_ajax.php	2010-12-17 16:17:34 UTC (rev 7334)
@@ -1,21 +1,35 @@
 <?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.
+/**
+ * Package: <Application element name>
+ *
+ * Description:
+ * <A description>
+ *
+ * Files:
+ *  - <path and filename, like http/javascripts/mod_zoomIn1.php>
+ *
+ * SQL:
+ * > <SQL for element>
+ * >
+ * > <SQL for element var>
+ *
+ * Help:
+ * http://www.mapbender.org/<wiki site name>
+ *
+ * Maintainer:
+ * http://www.mapbender.org/User:<user>
+ *
+ * Parameters:
+ * <normal element var name>      - <type and description>
+ * <optional element var name>    - *[optional]* <type and description>
+ * <deprecated element var name>  - *[deprecated]* <type and description>
+ *
+ * License:
+ * Copyright (c) 2009, Open Source Geospatial Foundation
+ * This program is dual licensed under the GNU General Public License
+ * and Simplified BSD license.
+ * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+ */
 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
 
@@ -26,6 +40,17 @@
 $row = db_fetch_array($res);
 $e_target = explode(",", ((string) $row["e_target"]));
 
+$sql_css = "SELECT var_value FROM gui_element_vars WHERE var_name = 'jq_ui_theme' AND fkey_gui_id = $1";
+$v_css = array($gui_id);
+$t_css = array("s");
+$res_css = db_prep_query($sql_css, $v_css, $t_css);
+if ($res_css) {
+	$row_css = db_fetch_array($res_css);
+	$theme = $row_css["var_value"];
+}
+if (!$theme) {
+	$theme = "../extensions/jquery-ui-1.8.1.custom/css/custom-theme/jquery-ui-1.8.5.custom.css";
+}
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
@@ -37,6 +62,9 @@
 	<meta http-equiv="expires" content="0" />
 	<?php printf("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%s\" />",CHARSET);	?>
 	<title>Add WMS</title>
+	<link rel="stylesheet" type="text/css" href="<?php echo $theme;?>" />
+	<script type='text/javascript' src='../extensions/jquery-ui-1.8.1.custom/js/jquery-1.4.2.min'></script>
+	<script type='text/javascript' src='../extensions/jquery-ui-1.8.1.custom/js/jquery-ui-1.8.1.custom.min.js'></script>
 	<script type="text/javascript">
 	<?php
 	include '../include/dyn_js.php';
@@ -74,33 +102,22 @@
 			var wms = map.wms[map.wms.length - 1];
 
 			if (wms === null) {
-				opt.msg = "Ein unbekannter Fehler ist aufgetreten.";
+				opt.msg = "<?php echo _mb("An unknown error occured.");?>";
 			}
 			else {
 				// activate
 				if (typeof opt.visible === "number" && opt.visible === 1) {
 					if (typeof addwms_showWMS === "number"
-						&& addwms_showWMS < wms.objLayer.length) {
+						&& addwms_showWMS > 0 && addwms_showWMS < wms.objLayer.length) {
 
-						if (addwms_showWMS > 0) {
+						try {
+							var msg = "<?php echo _mb("The map service contains too many layers. The layers of this service will not be activated");?>";
 
-							try {
-								var msg = "Der hinzugeladene Kartendienst " +
-								"verfügt über mehr als " +
-								addwms_showWMS +
-								" Ebenen. Die Ebenen des Dienstes werden " +
-								"<b>nicht</b> aktiviert.";
-
-								parent.Mapbender.modules.dialogManager.openDialog({
-									content: msg,
-									modal: false,
-									effectShow: 'puff'
-								});
-							}
-							catch (e) {
-								new parent.Mb_warning(e.message + ". " + msg);
-							}
+							$("<div></div>").text(msg).dialog();
 						}
+						catch (e) {
+							new parent.Mb_warning(e.message + ". " + msg);
+						}
 					}
 					else {
 						var wmsId = wms.wms_id;
@@ -152,16 +169,7 @@
 				msg = "Ein unbekannter Fehler ist aufgetreten.";
 			}
 		}
-		try {
-			parent.Mapbender.modules.dialogManager.openDialog({
-				content: msg,
-				modal: false,
-				effectShow: 'puff'
-			});
-		}
-		catch (e) {
-			new parent.Mb_warning(e.message + ". " + msg);
-		}
+		$("<div></div>").text(msg).dialog();
 	};
 
 



More information about the Mapbender_commits mailing list