svn commit: r634 - trunk/mapbender/http/javascripts/mod_initWmc.php
christoph at osgeo.org
christoph at osgeo.org
Tue Jun 27 06:44:26 EDT 2006
Author: christoph
Date: 2006-06-27 10:44:26+0000
New Revision: 634
Modified:
trunk/mapbender/http/javascripts/mod_initWmc.php
Log:
fixed 1 small bug
Modified: trunk/mapbender/http/javascripts/mod_initWmc.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_initWmc.php?view=diff&rev=634&p1=trunk/mapbender/http/javascripts/mod_initWmc.php&p2=trunk/mapbender/http/javascripts/mod_initWmc.php&r1=633&r2=634
==============================================================================
--- trunk/mapbender/http/javascripts/mod_initWmc.php (original)
+++ trunk/mapbender/http/javascripts/mod_initWmc.php 2006-06-27 10:44:26+0000
@@ -22,27 +22,29 @@
$js = "function mod_initWMC_init() {";
$adm = new administration();
-if ($adm->getWmcById($_SESSION['mb_myWmc']) != false) {
- $valid_wmcs = $adm->getWmcByOwner($_SESSION["mb_user_id"]);
- if (in_array($_SESSION['mb_myWmc'], $valid_wmcs)) {
- echo "var wmc_id = false;";
- echo "wmc_id = '".$_SESSION['mb_myWmc']."';";
- $wmc = new wmc();
- $wmc->createObjFromWMC($_SESSION['mb_myWmc']);
- $js .= "deleteWmsObject();\n";
- $js .= $wmc->createJsObjFromWMC("", $e_target[0]);
- $js .= "var index = getMapObjIndexByName('" . $e_target[0] . "');\n";
- $js .= "document.getElementById('".$e_target[0]."').style.width = mb_mapObj[index].width;\n";
- $js .= "document.getElementById('".$e_target[0]."').style.height = mb_mapObj[index].height;\n";
- $js .= "mb_execloadWmsSubFunctions();\n";
+if ($_SESSION['mb_myWmc']) {
+ if ($adm->getWmcById($_SESSION['mb_myWmc']) != false) {
+ $valid_wmcs = $adm->getWmcByOwner($_SESSION["mb_user_id"]);
+ if (in_array($_SESSION['mb_myWmc'], $valid_wmcs)) {
+ echo "var wmc_id = false;";
+ echo "wmc_id = '".$_SESSION['mb_myWmc']."';";
+ $wmc = new wmc();
+ $wmc->createObjFromWMC($_SESSION['mb_myWmc']);
+ $js .= "deleteWmsObject();\n";
+ $js .= $wmc->createJsObjFromWMC("", $e_target[0]);
+ $js .= "var index = getMapObjIndexByName('" . $e_target[0] . "');\n";
+ $js .= "document.getElementById('".$e_target[0]."').style.width = mb_mapObj[index].width;\n";
+ $js .= "document.getElementById('".$e_target[0]."').style.height = mb_mapObj[index].height;\n";
+ $js .= "mb_execloadWmsSubFunctions();\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('".$adm->getUserNameByUserId($_SESSION["mb_user_id"])." is not allowed to access WMC ".$_SESSION['mb_myWmc'].". Default GUI will be loaded instead.');";
+ $js .= "alert('WMC id ".$_SESSION['mb_myWmc']." is not valid. 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;
More information about the Mapbender_commits
mailing list