1){ echo "alert('digitize_button: ID not unique!');"; } $wmc_id = $_SESSION['mb_myWmc']; $user = $_SESSION['mb_user_id']; $x; $y; $icon; $js = "function mod_initWMC_init() {"; $adm = new administration(); //KML if ($_SESSION['mb_myKml']) { $sql = "SELECT * FROM mb_meetingpoint WHERE mb_meetingpoint_id = $1"; $v = array($_SESSION['mb_myKml']); $t = array('s'); $res = db_prep_query($sql,$v,$t); if($row = db_fetch_array($res)){ $user = $row['fkey_mb_user_id']; $password = $row['mb_user_password']; $gui = $row['fkey_gui_id']; $wmc_id = $row['fkey_wmc_id']; $kml_doc = $row['kml']; $kml = new kml("", "", 0, 0, ""); $value = $kml->createObjFromKML($kml_doc); $x = $kml->x; $y = $kml->y; $icon = $kml->icon; } else { $js .= "alert('Meetingpoint ID id ".$_SESSION['mb_myKml']." is not valid. Default GUI will be loaded instead.');"; } } //WMC if ($wmc_id) { if ($adm->getWmcById($wmc_id) != false) { $valid_wmcs = $adm->getWmcByOwner($user); if (in_array($wmc_id, $valid_wmcs)) { echo "var wmc_id = false;"; echo "wmc_id = '".$wmc_id."';"; $wmc = new wmc(); $wmc->createObjFromWMC($wmc_id); $js .= $wmc->createJsObjFromWMC("", $e_target[0], "load"); if ($x && $y && $icon) { $js .= "var myPoint = realToMap('".$e_target[0]."', new Point(".$x.",".$y."));\n"; $js .= "var poleheight = 100;"; $js .= "myPoint.y -= poleheight;"; $js .= "var attributes = new Array();\n"; $js .= "attributes[0] = new Array();\n"; $js .= "attributes[0][0] = 'style';\n"; $js .= "attributes[0][1] = 'position:absolute; top:'+myPoint.y+'px; left:'+myPoint.x+'px; z-index:100; font-size:10px';\n"; $js .= "node = mb_checkTag('".$e_target[0]."', 'div', 'meeting_pole', 'body', attributes);\n"; $js .= "if (node == false) {\n"; $js .= "\talert('Fatal error: Element id is already taken!');\n"; $js .= "}\n"; $js .= "else {\n"; $js .= "node.innerHTML = \"
\";"; $js .= "}\n"; } } else { $js .= "alert('".$adm->getUserNameByUserId($_SESSION["mb_user_id"])." is not allowed to access WMC ".$_SESSION['mb_myWmc'].". Default GUI will be loaded instead.');"; } } else { $js .= "alert('WMC id ".$_SESSION['mb_myWmc']." is not valid. Default GUI will be loaded instead.');"; } } $js .= "}"; echo $js; ?> mb_registerInitFunctions("mod_initWMC()"); function mod_initWMC(){ mod_initWMC_init(); }