[Mapbender-commits] r2314 - branches/2.5/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Mar 28 11:40:43 EDT 2008


Author: christoph
Date: 2008-03-28 11:40:43 -0400 (Fri, 28 Mar 2008)
New Revision: 2314

Added:
   branches/2.5/http/javascripts/mod_switchLocale_noreload.php
Log:
switchLocale in div, not iframe

Copied: branches/2.5/http/javascripts/mod_switchLocale_noreload.php (from rev 2300, branches/2.5/http/php/mod_switchLocale_noreload.php)
===================================================================
--- branches/2.5/http/javascripts/mod_switchLocale_noreload.php	                        (rev 0)
+++ branches/2.5/http/javascripts/mod_switchLocale_noreload.php	2008-03-28 15:40:43 UTC (rev 2314)
@@ -0,0 +1,49 @@
+<?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");
+
+include(dirname(__FILE__) . "/../include/dyn_js.php");
+?>
+
+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;
+		localize();	
+	});
+}
+
+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



More information about the Mapbender_commits mailing list