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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jan 17 05:47:59 EST 2008


Author: vera
Date: 2008-01-17 05:47:59 -0500 (Thu, 17 Jan 2008)
New Revision: 1973

Added:
   branches/2.5/http/javascripts/mod_reload.php
Log:
Module to reload the whole Mapbender Gui with a button click

Added: branches/2.5/http/javascripts/mod_reload.php
===================================================================
--- branches/2.5/http/javascripts/mod_reload.php	                        (rev 0)
+++ branches/2.5/http/javascripts/mod_reload.php	2008-01-17 10:47:59 UTC (rev 1973)
@@ -0,0 +1,54 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/reload
+# 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.
+
+$gui_id = $_REQUEST["gui_id"];
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'reload' AND fkey_gui_id = $1";
+$v = array($gui_id);
+$t = array('s');
+$res = db_prep_query($sql, $v, $t);
+$cnt = 0;
+while($row = db_fetch_array($res)){ 
+	$e_src = $row["e_src"];
+	$e_target = $row["e_target"];
+	$cnt++;
+}
+if($cnt > 1){
+	echo "alert('reload: ID not unique!');";
+}
+?>
+var mod_reload_img = new Image(); mod_reload_img.src = "<?php  echo $e_src;  ?>";
+var mod_reload_img_over = new Image(); mod_reload_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
+
+function mod_reload(){
+    location.reload();
+}
+function mod_reload_init(obj){
+	document.getElementById("reload").src = mod_reload_img_over.src;
+	obj.onmouseover = new Function("mod_reload_over()");
+	obj.onmouseout = new Function("mod_reload_out()");
+}
+function mod_reload_over(){
+	document.getElementById("reload").src = mod_reload_img_over.src;
+}
+function mod_reload_out(){
+	document.getElementById("reload").src = mod_reload_img.src;
+}


Property changes on: branches/2.5/http/javascripts/mod_reload.php
___________________________________________________________________
Name: svn:keywords
   + HeadURL Id LastChangedBy LastChangedDate LastChangedRevision



More information about the Mapbender_commits mailing list