$wmcId = $ajaxResponse->getParameter("id"); $doc = $wmc->getDocument($wmcId); if (!$doc) { $ajaxResponse->setMessage(_mb("The WMC document could not be found.")); $ajaxResponse->setSuccess(false); } else { $resultObj["wmc"] = array("document" => $doc); $ajaxResponse->setResult($resultObj); $ajaxResponse->setSuccess(true); } break; // deletes a WMC // deletes a WMC case "deleteWmc": $wmcId = $ajaxResponse->getParameter("id"); if ($wmc->delete($wmcId, $userId)) { $ajaxResponse->setMessage(_mb("WMC has been deleted from the database.")); $ajaxResponse->setSuccess(true); } else { $ajaxResponse->setMessage(_mb("WMC could not be deleted.")); $ajaxResponse->setSuccess(false); } break; // loads a WMC (returns array of JS code) // loads a WMC (returns array of JS code) case 'loadWmc': $wmcId = $ajaxResponse->getParameter("id"); if ($wmc->createFromDb($wmcId)) { $updatedWMC = $wmc->updateUrlsFromDb(); $wmc->createFromXml($updatedWMC); $skipWms = $ajaxResponse->getParameter("skipWms");
/** * deletes a {@link http://www.mapbender.org/index.php/WMC WMC} entry specified by wmc_id and user_id * * @param integer the user_id * @param string the wmc_id * @return boolean Did the query run succesfull? This does not necessarily mean that * an entry was deleted. * @deprecated */ function deleteWmc($wmc_id, $user_id) { $e = new mb_notice("administration->deleteWmc is deprecated, use wmc->delete instead!"); $wmc = new wmc(); return $wmc->delete($wmc_id, $user_id); }