[Mapbender-commits] r2286 - in branches/2.5: http/classes http/javascripts http/php resources/db/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Mar 25 06:25:09 EDT 2008


Author: christoph
Date: 2008-03-25 06:25:09 -0400 (Tue, 25 Mar 2008)
New Revision: 2286

Added:
   branches/2.5/resources/db/update/mod_switchLocale_noreload.sql
Modified:
   branches/2.5/http/classes/class_locale.php
   branches/2.5/http/javascripts/map.js
   branches/2.5/http/javascripts/mod_tab.js
   branches/2.5/http/php/mod_tab_messages.php
Log:
bug fixes in localization
l10n of tabs module
added sql for mod_switchLocale_noreload

Modified: branches/2.5/http/classes/class_locale.php
===================================================================
--- branches/2.5/http/classes/class_locale.php	2008-03-25 10:09:15 UTC (rev 2285)
+++ branches/2.5/http/classes/class_locale.php	2008-03-25 10:25:09 UTC (rev 2286)
@@ -37,6 +37,7 @@
 	var $status = "No locale set.";
 	
 	function Mb_locale($languageId) {
+  		$e = new Mb_notice("class_locale: setting locale to " . $languageId);
 		if (!$this->setCurrentLocale($languageId)) {
 			$e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
 		}

Modified: branches/2.5/http/javascripts/map.js
===================================================================
--- branches/2.5/http/javascripts/map.js	2008-03-25 10:09:15 UTC (rev 2285)
+++ branches/2.5/http/javascripts/map.js	2008-03-25 10:25:09 UTC (rev 2286)
@@ -1933,13 +1933,22 @@
 		}
 	}
 }
-function mb_localizeButtons() {
+
+function mb_localizeButtons(){
 	mb_ajax_json("../php/mod_button_tooltips.php", function(obj, status){
 		updateButtonTooltips(obj);
 	});
 }
-mb_registerInitFunctions("mb_registerL10nFunctions('mb_localizeButtons()');");
 
+eventLocalize.register(function () {
+	mb_localizeButtons();
+});
+
+eventInit.register(function () {
+	mb_localizeButtons();
+});
+
+
 /*
  ***************************************************************************************
  *   miscellaneous functions

Modified: branches/2.5/http/javascripts/mod_tab.js
===================================================================
--- branches/2.5/http/javascripts/mod_tab.js	2008-03-25 10:09:15 UTC (rev 2285)
+++ branches/2.5/http/javascripts/mod_tab.js	2008-03-25 10:25:09 UTC (rev 2286)
@@ -16,11 +16,21 @@
 var tabs;
 
 mb_registerInitFunctions('tab_init()');
-eventLocalize.register(function() {
+
+
+eventLocalize.register(function () {
+	localizeTabs();
+});
+
+eventInit.register(function () {
+	localizeTabs();
+});
+
+function localizeTabs() {
 	mb_ajax_json("../php/mod_tab_messages.php", function(obj, status){
 		tabs.setTitles(obj);
 	});
-});
+}
 
 function tab_init(){
 	var obj = document.getElementById("tabs").style;

Modified: branches/2.5/http/php/mod_tab_messages.php
===================================================================
--- branches/2.5/http/php/mod_tab_messages.php	2008-03-25 10:09:15 UTC (rev 2285)
+++ branches/2.5/http/php/mod_tab_messages.php	2008-03-25 10:25:09 UTC (rev 2286)
@@ -32,7 +32,7 @@
 		"AND fkey_gui_id = $3";
 		
 $v = array($_SESSION["mb_lang"], $_SESSION["mb_user_gui"], $_SESSION["mb_user_gui"]); 
-$t = array("s", "s");
+$t = array("s", "s", "s");
 $res = db_prep_query($sql, $v, $t);
 while ($row = db_fetch_array($res)) {
 	array_push($buttonObj, array("id" => $row["e_id"], "title" => $row["e_title"]));

Added: branches/2.5/resources/db/update/mod_switchLocale_noreload.sql
===================================================================
--- branches/2.5/resources/db/update/mod_switchLocale_noreload.sql	                        (rev 0)
+++ branches/2.5/resources/db/update/mod_switchLocale_noreload.sql	2008-03-25 10:25:09 UTC (rev 2286)
@@ -0,0 +1,6 @@
+INSERT INTO gui_element(fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url) VALUES('gui','switchLocale_noreload',8,1,'changes the locale without reloading the client','Set language','iframe','../php/mod_switchLocale_noreload.php','',1,1,1,1,1,'','','iframe','','','','','');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui', 'switchLocale_noreload', 'languages', 'de,en', '' ,'php_var');
+
+
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui', 'tabs', 'tab_frameHeight[7]', '80', '' ,'var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui', 'tabs', 'tab_ids[7]', 'switchLocale_noreload', '' ,'php_var');



More information about the Mapbender_commits mailing list