[Mapbender-users] Overviewmap activating/deactivating

Kai Behncke Kai-Behncke at gmx.de
Wed Feb 13 13:45:01 EST 2008


Dear list,
> 
> mod_ausblenden.php looks like:
> 
> 
> function init_ausblenden(){
>   var ov=document.getElementById('overview');
>   if(!ov)return true;
>   if(ov.style.display=="none"){
>   
>     ov.style.display="block"
>   } else {
>     ov.style.display="none"
> 
>   }
>   return true;
> }
> 
....well, the above statement dind`t work so well. To work properly mod_ausblenden.php should look like that:

-----------schnipp

 <?php

require_once(dirname(__FILE__)."/../../conf/mapbender.conf");

$gui_id = $_REQUEST["gui_id"];
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db(DB,$con);
$sql = "SELECT e_src, e_target FROM gui_element WHERE e_id = 'overview_ausblenden' 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_src"];
	$cnt++;
}

if($cnt > 1){ echo "alert('overview_ausblenden ID not unique!');";}
echo "var mod_overview_ausblenden_target = '".$e_target."';";



php?>



var mod_overview_ausblenden_win = null;
var mod_overview_ausblenden_elName = "overview_ausblenden";
var mod_overview_ausblenden_frameName = "";
var mod_overview_ausblenden_img_on = new Image(); mod_overview_ausblenden_img_on.src = "<?php  echo preg_replace("/_off/","_on",$e_src);  ?>";
var mod_overview_ausblenden_img_off = new Image(); mod_overview_ausblenden_img_off.src = "<?php  echo $e_src;  ?>";
var mod_overview_ausblenden_img_over = new Image(); mod_overview_ausblenden_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
var mod_overview_ausblenden_fix = "";


function init_mod_overview_ausblenden(ind){
//alert ("hallo");
	mb_button[ind] = document.getElementById(mod_overview_ausblenden_elName);
	mb_button[ind].img_over = mod_overview_ausblenden_img_over.src;

	mb_button[ind].img_on = mod_overview_ausblenden_img_on.src;

	mb_button[ind].img_off = mod_overview_ausblenden_img_off.src;

	mb_button[ind].status = 0;
	 mb_button[ind].elName = mod_overview_ausblenden_elName;

	mb_button[ind].fName = mod_overview_ausblenden_frameName;


 	mb_button[ind].go 

 	mb_button[ind].onmousedown = new Function ("mod_overv iew_ausblenden_run()");

  }   


function mod_overview_ausblenden_run() {
 
 var ov=document.getElementById('overview');
  if(!ov)return true;
  if(ov.style.display=="none"){
  
    ov.style.display="block"
  } else {
    ov.style.display="none"
  

  }
  return true;
}
-------schnapp

Regards,Kai


-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.web.de/de/entertainment/games/free


More information about the Mapbender_users mailing list