[Mapbender-commits] r1606 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Aug 6 04:49:17 EDT 2007


Author: christoph
Date: 2007-08-06 04:49:17 -0400 (Mon, 06 Aug 2007)
New Revision: 1606

Added:
   trunk/mapbender/http/php/mod_setLocale.php
   trunk/mapbender/http/php/mod_switchLocale.php
   trunk/mapbender/http/php/mod_switchLocale_noreload.php
Log:
new modules for localeSwitch

Added: trunk/mapbender/http/php/mod_setLocale.php
===================================================================
--- trunk/mapbender/http/php/mod_setLocale.php	                        (rev 0)
+++ trunk/mapbender/http/php/mod_setLocale.php	2007-08-06 08:49:17 UTC (rev 1606)
@@ -0,0 +1,29 @@
+<?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.
+
+session_start();
+require_once("../classes/class_locale.php");
+require_once("../../conf/mapbender.conf");
+$_SESSION["mb_lang"] = $_REQUEST["lang"];
+$localeObj = new Mb_locale($_SESSION["mb_lang"]);
+session_write_close();
+
+header("Content-type='text/plain';Charset='utf-8'");
+echo $localeObj->name;
+?>

Added: trunk/mapbender/http/php/mod_switchLocale.php
===================================================================
--- trunk/mapbender/http/php/mod_switchLocale.php	                        (rev 0)
+++ trunk/mapbender/http/php/mod_switchLocale.php	2007-08-06 08:49:17 UTC (rev 1606)
@@ -0,0 +1,75 @@
+<?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.
+
+session_start();
+$gui_id = $_SESSION["mb_user_gui"];
+$user_id = $_SESSION["mb_user_id"]; 
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!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("../include/dyn_css.php");
+?>
+<script type="text/javascript">
+<!--
+
+function validate(){
+	var index = document.getElementById("language").selectedIndex;
+	var lang = document.getElementById("language").options[index].value;
+	parent.mb_ajax_post("../php/mod_setLocale.php", {"lang":lang}, function(status,result) {
+		parent.window.location.reload();	
+	});
+}
+
+// -->
+</script>
+</head>
+<body leftmargin="2" topmargin="0" bgcolor="#ffffff">
+<form name='form1' target='parent'>
+<p>
+<select id='language' name='language' onchange='validate()'>
+<?php
+$languageArray = explode(",", $languages);
+for ($i = 0; $i < count($languageArray); $i++) {
+	echo "<option";
+	if ($_SESSION["mb_lang"] == $languageArray[$i]) {
+		echo " selected";
+	}
+	echo ">" . $languageArray[$i] . "</option>";
+}
+?>
+</select>
+</p>
+</form>
+</body>
+</html>
\ No newline at end of file

Added: trunk/mapbender/http/php/mod_switchLocale_noreload.php
===================================================================
--- trunk/mapbender/http/php/mod_switchLocale_noreload.php	                        (rev 0)
+++ trunk/mapbender/http/php/mod_switchLocale_noreload.php	2007-08-06 08:49:17 UTC (rev 1606)
@@ -0,0 +1,76 @@
+<?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.
+
+session_start();
+$gui_id = $_SESSION["mb_user_gui"];
+$user_id = $_SESSION["mb_user_id"]; 
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+?>
+<!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("../include/dyn_css.php");
+?>
+<script type="text/javascript">
+<!--
+
+function validate(){
+	var index = document.getElementById("language").selectedIndex;
+	var lang = document.getElementById("language").options[index].value;
+	parent.mb_ajax_post("../php/mod_setLocale.php", {"lang":lang}, function(result, status) {
+		parent.mapbender.locale = result;
+		parent.localize();	
+	});
+}
+
+// -->
+</script>
+</head>
+<body leftmargin="2" topmargin="0" bgcolor="#ffffff">
+<form name='form1' target='parent'>
+<p>
+<select id='language' name='language' onchange='validate()'>
+<?php
+$languageArray = explode(",", $languages);
+for ($i = 0; $i < count($languageArray); $i++) {
+	echo "<option";
+	if ($_SESSION["mb_lang"] == $languageArray[$i]) {
+		echo " selected";
+	}
+	echo ">" . $languageArray[$i] . "</option>";
+}
+?>
+</select>
+</p>
+</form>
+</body>
+</html>
\ No newline at end of file



More information about the Mapbender_commits mailing list