[Mapbender-commits] r5317 - branches/2.6/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 13 06:10:04 EST 2010


Author: christoph
Date: 2010-01-13 06:10:03 -0500 (Wed, 13 Jan 2010)
New Revision: 5317

Added:
   branches/2.6/http/php/mod_treefolder2_l10n.php
   branches/2.6/http/php/mod_wfs_gazetteer_l10n.php
Log:


Added: branches/2.6/http/php/mod_treefolder2_l10n.php
===================================================================
--- branches/2.6/http/php/mod_treefolder2_l10n.php	                        (rev 0)
+++ branches/2.6/http/php/mod_treefolder2_l10n.php	2010-01-13 11:10:03 UTC (rev 5317)
@@ -0,0 +1,53 @@
+<?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(dirname(__FILE__)."/mb_validateSession.php");
+
+$epsgObj = array();
+
+$ajaxResponse = new AjaxResponse($_POST);
+
+switch ($ajaxResponse->getMethod()) {
+	case "translateServiceData" :
+		$msg_obj = $ajaxResponse->getParameter("data");
+		$newMsgObj = array();
+		
+		foreach ($msg_obj as $wmsId => $wmsObj) {
+			$newMsgObj[$wmsId] = array(
+				"title" => _mb($wmsObj->title),
+				"layer" => array()
+			);
+			foreach ($wmsObj->layer as $layerId => $layerObj) {
+				$newMsgObj[$wmsId]["layer"][$layerId] = array(
+					"title" => _mb($layerObj->title)
+				);
+			}
+		}
+		$ajaxResponse->setSuccess(true);
+		$ajaxResponse->setResult($newMsgObj);
+		break;
+	default :
+		$ajaxResponse->setSuccess(false);
+		$ajaxResponse->setMessage(_mb("An unknown error occured."));
+		break;
+}
+
+$firephp->log($_SESSION, "SESSION");
+$ajaxResponse->send();
+?>

Added: branches/2.6/http/php/mod_wfs_gazetteer_l10n.php
===================================================================
--- branches/2.6/http/php/mod_wfs_gazetteer_l10n.php	                        (rev 0)
+++ branches/2.6/http/php/mod_wfs_gazetteer_l10n.php	2010-01-13 11:10:03 UTC (rev 5317)
@@ -0,0 +1,65 @@
+<?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(dirname(__FILE__)."/mb_validateSession.php");
+
+
+//translates all string values in a tree It can find
+function translateTree($tree)
+{
+
+  if(is_object($tree)){
+    foreach($tree as $key => $value )
+    {
+      $tree->$key = translateTree($value);
+    }
+  }else if(is_array($tree)){
+    foreach($tree as $key => $value )
+    {
+      $tree[$key] = translateTree($value);
+    }
+  }else if(is_string($tree)){
+    $tree =  _mb($tree);
+  }
+  return $tree;
+}
+
+
+$ajaxResponse = new AjaxResponse($_POST);
+
+switch ($ajaxResponse->getMethod()) {
+	case "translateServiceData" :
+		$msg_obj = $ajaxResponse->getParameter("data");
+        
+        $translated_obj = translateTree($msg_obj);
+		
+        $ajaxResponse->setSuccess(true);
+		$ajaxResponse->setResult($translated_obj);
+		break;
+	default :
+		$ajaxResponse->setSuccess(false);
+		$ajaxResponse->setMessage(_mb("An unknown error occured."));
+		break;
+}
+
+
+$firephp->log($_SESSION, "SESSION");
+$ajaxResponse->send();
+
+?>



More information about the Mapbender_commits mailing list