[Mapbender-commits] r3406 - in trunk/mapbender: http/classes http/include resources/db/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 5 06:12:07 EST 2009


Author: christoph
Date: 2009-01-05 06:12:07 -0500 (Mon, 05 Jan 2009)
New Revision: 3406

Added:
   trunk/mapbender/http/include/gui1_splash.php
Modified:
   trunk/mapbender/http/classes/class_element.php
   trunk/mapbender/resources/db/update/update_2.6.sql
Log:
http://trac.osgeo.org/mapbender/ticket/231

Modified: trunk/mapbender/http/classes/class_element.php
===================================================================
--- trunk/mapbender/http/classes/class_element.php	2009-01-05 10:50:52 UTC (rev 3405)
+++ trunk/mapbender/http/classes/class_element.php	2009-01-05 11:12:07 UTC (rev 3406)
@@ -45,6 +45,7 @@
 	var $target;
 	var $requires;
 	var $helpUrl;
+	var $isBodyAndUsesSplashScreen = false;
 	
 	public function __contruct() {
 		
@@ -126,7 +127,7 @@
 
 	private function getHtmlOpenTag () {
 		$openTag = "";
-		
+	
 		if ($this->id) {
 			// tag name
 			$openTag .= "<" . $this->element . " ";
@@ -184,17 +185,37 @@
 			}
 			$openTag .= "'>";
 
-			if ($this->element == "body" && USE_LOAD_MESSAGE) {
-				$htmlWhileLoading = "<img src='../img/indicator_wheel.gif'>&nbsp;" . 
-					"<b>Ma<font color='#0000CE'>p</font><font color='#C00000'>b</font>ender " . 
-					MB_VERSION_NUMBER . " " . strtolower(MB_VERSION_APPENDIX) . "</b>..." .
-					"loading application '" . $this->guiId . "'";
+			if ($this->element == "body") {
+				$e_id = "body";
+				$gui_id = $this->guiId;
+				include(dirname(__FILE__)."/../include/dyn_php.php");
+				
+				$splashScreen = "";
+				
+				if ($use_load_message) {
+					$this->isBodyAndUsesSplashScreen = true;
+					if (isset($htmlWhileLoading) && $htmlWhileLoading != '') {
+						$splashScreen .= $htmlWhileLoading; 
+					} elseif (isset($includeWhileLoading) && $includeWhileLoading != '' && file_exists(dirname(__FILE__)."/".$includeWhileLoading)) { 
+						ob_start();
+						include(dirname(__FILE__)."/".$includeWhileLoading);
+						$splashScreen .= ob_get_contents();
+						ob_end_clean();
+					}
+				}
+				else {
+					$splashScreen .= "<img src='../img/indicator_wheel.gif'>&nbsp;" . 
+						"<b>Ma<font color='#0000CE'>p</font><font color='#C00000'>b</font>ender " . 
+						MB_VERSION_NUMBER . " " . strtolower(MB_VERSION_APPENDIX) . "</b>..." .
+						"loading application '" . $this->guiId . "'";
+				}
 	
 				$openTag .= "<div id='loading_mapbender' " .
-								"style='position:absolute;top:100;left:100'>" . 
-								$htmlWhileLoading . "</div>" . 
+								"style='margin:0px;padding:0px;width:100%;height:100%;'>" . 
+								$splashScreen . "</div>" . 
 								"<div id='complete_mapbender' " .
 								"style='display:none'>";
+				unset ($e_id, $gui_id);
 			}
 		}
 		return $openTag;
@@ -209,7 +230,7 @@
 	}
 	
 	private function getHtmlCloseTag () {
-		if ($this->element == "body" && USE_LOAD_MESSAGE) {
+		if ($this->element == "body" && $this->isBodyAndUsesSplashScreen) {
 			return "</div></body>";
 		}
 		if ($this->closeTag != "") {

Added: trunk/mapbender/http/include/gui1_splash.php
===================================================================
--- trunk/mapbender/http/include/gui1_splash.php	                        (rev 0)
+++ trunk/mapbender/http/include/gui1_splash.php	2009-01-05 11:12:07 UTC (rev 3406)
@@ -0,0 +1,6 @@
+<?php
+echo "<img src='../img/indicator_wheel.gif'>&nbsp;" . 
+	"<b>Ma<font color='#0000CE'>p</font><font color='#C00000'>b</font>ender " . 
+	MB_VERSION_NUMBER . " " . strtolower(MB_VERSION_APPENDIX) . "</b>..." .
+	"loading application '" . $gui_id . "'";
+?>

Modified: trunk/mapbender/resources/db/update/update_2.6.sql
===================================================================
--- trunk/mapbender/resources/db/update/update_2.6.sql	2009-01-05 10:50:52 UTC (rev 3405)
+++ trunk/mapbender/resources/db/update/update_2.6.sql	2009-01-05 11:12:07 UTC (rev 3406)
@@ -104,3 +104,7 @@
 
 UPDATE gui_element SET e_element = 'div', e_src = '', e_attributes = '', e_more_styles = 'overflow:hidden;', e_content = '', e_closetag = 'div', e_js_file = 'mod_zoomCoords.php', e_target = 'mapframe1,overview', e_requires = 'mapframe1' WHERE e_id = 'zoomCoords';
 
+ 
+-- a demo splash screen for gui1
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui1', 'body', 'use_load_message', 'true', '' ,'php_var');
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type) VALUES('gui1', 'body', 'includeWhileLoading', '../include/gui1_splash.php', '' ,'php_var');



More information about the Mapbender_commits mailing list