[Mapbender-commits] r4801 - in trunk/mapbender/http: javascripts php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Oct 20 07:51:04 EDT 2009
Author: christoph
Date: 2009-10-20 07:51:03 -0400 (Tue, 20 Oct 2009)
New Revision: 4801
Added:
trunk/mapbender/http/php/mod_map_messages.php
Modified:
trunk/mapbender/http/javascripts/map_obj.js
Log:
i18n for changeEpsg
Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js 2009-10-20 11:50:00 UTC (rev 4800)
+++ trunk/mapbender/http/javascripts/map_obj.js 2009-10-20 11:51:03 UTC (rev 4801)
@@ -29,7 +29,22 @@
Mapbender.Map = function (frameName, elementName, width, height, wms_index) {
+ var mapMsgObj;
+ eventLocalize.register(function () {
+ localizeMap();
+ });
+
+ eventInit.register(function () {
+ localizeMap();
+ });
+
+ var localizeMap = function () {
+ $.post("../php/mod_map_messages.php", function(obj, status){
+ mapMsgObj = eval('(' + obj + ')');
+ });
+ };
+
/**
* Method: setExtent
*
@@ -257,7 +272,7 @@
// ...and optionally display a message
if (options.displayWarning && ignoredWms.length > 0) {
- var msg = "The following WMS do not support the current SRS: <br><br>";
+ var msg = mapMsgObj.srsNotSupported + ": <br><br>";
for (var key in ignoredWms) {
msg += "<b>" + ignoredWms[key].title + "</b><br>";
@@ -970,7 +985,7 @@
var myDivId = that.elementName + "_div_" + ii;
var myMapId = that.elementName + "_map_" + ii;
- var ts = mb_timestamp();
+ var ts = mb_timestamp();
//disable Layer which are out of scale
var validLayers = that.checkScale(ii);
Added: trunk/mapbender/http/php/mod_map_messages.php
===================================================================
--- trunk/mapbender/http/php/mod_map_messages.php (rev 0)
+++ trunk/mapbender/http/php/mod_map_messages.php 2009-10-20 11:51:03 UTC (rev 4801)
@@ -0,0 +1,37 @@
+<?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: " . Mapbender::session()->get("mb_locale") . "; lang: " . Mapbender::session()->get("mb_lang"));
+$e = new mb_notice(setlocale(LC_ALL, Mapbender::session()->get("mb_locale")));
+
+//
+// Messages
+//
+$msg_obj = array();
+$msg_obj["srsNotSupported"] = _mb("The following WMS do not support the current SRS");
+
+$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
More information about the Mapbender_commits
mailing list