svn commit: r820 - trunk/mapbender/http/php/mb_listWMCs.php
christoph at osgeo.org
christoph at osgeo.org
Thu Nov 16 09:41:24 EST 2006
Author: christoph
Date: 2006-11-16 14:41:24+0000
New Revision: 820
Modified:
trunk/mapbender/http/php/mb_listWMCs.php
Log:
fixed two bugs
- in SQL: replaced 'addWMS' by 'loadwmc'
- e_target: replaced target[1] by correct target mapframe ('mapframe1' if exists or target[0]).
Modified: trunk/mapbender/http/php/mb_listWMCs.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mb_listWMCs.php?view=diff&rev=820&p1=trunk/mapbender/http/php/mb_listWMCs.php&p2=trunk/mapbender/http/php/mb_listWMCs.php&r1=819&r2=820
==============================================================================
--- trunk/mapbender/http/php/mb_listWMCs.php (original)
+++ trunk/mapbender/http/php/mb_listWMCs.php 2006-11-16 14:41:24+0000
@@ -92,10 +92,6 @@
$admin = new administration();
$wmcList = $admin->getWmcByOwner($_SESSION["mb_user_id"]);
-// global $frameName;
-// $frameName = $e_target;
-// include("../classes/class_wmc.php");
-
if ($_POST["del_wmc_id"] ) {
$result = $admin->deleteWmc($_POST["del_wmc_id"], $_SESSION["mb_user_id"]);
if (!$result) {
@@ -120,7 +116,7 @@
if ($_GET["wmc_id"] && ($_GET["action"] == "append" || $_GET["action"] == "merge" || $_GET["action"] == "load") && in_array($_GET["wmc_id"], $wmcList)){
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db(DB,$con);
- $sql = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'addWMS' AND fkey_gui_id = '".$_SESSION['mb_user_gui']."'";
+ $sql = "SELECT e_requires, e_target FROM gui_element WHERE e_id = 'loadwmc' AND fkey_gui_id = '".$_SESSION['mb_user_gui']."'";
$res = db_query($sql);
$cnt = 0;
while($row = db_fetch_array($res)){
@@ -129,10 +125,16 @@
$cnt++;
}
$target = explode(",", $e_target);
+ if (in_array('mapframe1', $target)) {
+ $mytarget = 'mapframe1';
+ }
+ else {
+ $mytarget = $target[0];
+ }
$wmc = new wmc();
$wmc->createObjFromWMC_id($_GET["wmc_id"]);
if ($_GET["action"] == "append" || $_GET["action"] == "merge" || $_GET["action"] == "load") {
- $js = $wmc->createJsObjFromWMC("window.opener.", trim($target[1]), $_GET["action"]);
+ $js = $wmc->createJsObjFromWMC("window.opener.", trim($mytarget), $_GET["action"]);
}
// display all JavaScript statements as debugging text
//echo $js;
More information about the Mapbender_commits
mailing list