本文整理汇总了PHP中AjaxResponse::getParameter方法的典型用法代码示例。如果您正苦于以下问题:PHP AjaxResponse::getParameter方法的具体用法?PHP AjaxResponse::getParameter怎么用?PHP AjaxResponse::getParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AjaxResponse
的用法示例。
在下文中一共展示了AjaxResponse::getParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
require_once dirname(__FILE__) . "/../classes/class_gml2.php";
require_once dirname(__FILE__) . "/../classes/class_json.php";
$ajaxResponse = new AjaxResponse($_POST);
if ($ajaxResponse->getMethod() != "createUsemap") {
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage("method invalid");
$ajaxResponse->send();
exit;
}
$url = $ajaxResponse->getParameter('url');
//urldecode($_REQUEST["url"]);
$g = new gml2();
$g->parsegml($url);
$um_title = array();
$um_x = array();
$um_y = array();
for ($i = 0; $i < $g->getMemberCount(); $i++) {
$um_title[] = utf8_decode($g->getValueBySeparatedKey($i, "name"));
$um_x[] = $g->getXfromMemberAsString($i, 0);
$um_y[] = $g->getYfromMemberAsString($i, 0);
}
$resultObj = array();
$resultObj['um_title'] = $um_title;
$resultObj['um_x'] = $um_x;
$resultObj['um_y'] = $um_y;
示例2: createWPSRequest
<?php
require_once dirname(__FILE__) . "/../php/mb_validateSession.php";
require_once dirname(__FILE__) . "/../classes/class_json.php";
$ajaxResponse = new AjaxResponse($_POST);
switch ($ajaxResponse->getMethod()) {
case "createWPSRequest":
$templatefilePath = realpath(dirname(__FILE__) . "/../../resources/wps_template.xml");
$parameters = $ajaxResponse->getParameter('attributes');
try {
$result = createWPSRequest($parameters, $templatefilePath);
$ajaxResponse->setSuccess(true);
$ajaxResponse->setResult($result);
} catch (Exception $E) {
$ajaxResponse->setSuccess(true);
$ajaxResponse->setMessage($E->getMessage);
}
break;
default:
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage("method invalid");
}
$ajaxResponse->send();
/*
* @params parameters an assoc array containing parameters with wich to create a WPS request
* @return a WPS XML document
*/
function createWPSRequest($parameters, $templatefilePath)
{
// check and give parameters default values
// need this collection to be subscriptable
示例3: dirname
require_once dirname(__FILE__) . "/../classes/class_tou.php";
//ajax wrapper for class_tou.php
$ajaxResponse = new AjaxResponse($_POST);
$json = new Mapbender_JSON();
$touObject = new tou();
//$currentUser = new User();
//$wmc = new wmc();
$resultObj = array();
//obj structure in session for acceptedTou (see class_tou.php):
//acceptedTou {
// wms [100,101,112],
// wfs [12,34]
// }
switch ($ajaxResponse->getMethod()) {
case 'checkAcceptedTou':
$result = $touObject->check($ajaxResponse->getParameter("serviceType"), $ajaxResponse->getParameter("serviceId"));
$ajaxResponse->setResult($result['accepted']);
//1 or 0
$ajaxResponse->setMessage(_mb($result['message']));
$ajaxResponse->setSuccess(true);
break;
case 'setAcceptedTou':
$serviceType = $ajaxResponse->getParameter("serviceType");
$serviceId = $ajaxResponse->getParameter("serviceId");
$result = $touObject->set($ajaxResponse->getParameter("serviceType"), $ajaxResponse->getParameter("serviceId"));
$ajaxResponse->setResult($result['setTou']);
//1 or 0
$ajaxResponse->setMessage(_mb($result['message']));
$ajaxResponse->setSuccess(true);
break;
// Invalid command
示例4: floatval
$resMinx = pg_query($con, $sqlMinx);
$minx = floatval(pg_fetch_result($resMinx, 0, "minx"));
$sqlMiny = "SELECT Y(transform(GeometryFromText('POINT(" . pg_escape_string($x) . " " . pg_escape_string($y) . ")'," . pg_escape_string($oldEPSG) . ")," . pg_escape_string($newEPSG) . ")) as miny";
$resMiny = pg_query($con, $sqlMiny);
$miny = floatval(pg_fetch_result($resMiny, 0, "miny"));
}
return array("x" => $minx, "y" => $miny);
}
switch ($ajaxResponse->getMethod()) {
case "transform":
if (!Mapbender::postgisAvailable()) {
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage(_mb("PostGIS is not available. Please contact the administrator."));
$ajaxResponse->send();
}
$fromSrs = $ajaxResponse->getParameter("fromSrs");
$toSrs = $ajaxResponse->getParameter("toSrs");
$x = $ajaxResponse->getParameter("x");
$y = $ajaxResponse->getParameter("y");
$bboxStr = $ajaxResponse->getParameter("bbox");
$bbox = explode(",", $bboxStr);
$response = null;
$oldEPSG = preg_replace("/EPSG:/", "", $fromSrs);
$newEPSG = preg_replace("/EPSG:/", "", $toSrs);
if (!is_null($bbox) && is_array($bbox) && count($bbox) === 4) {
$response = array("newSrs" => $toSrs, "points" => array());
for ($i = 0; $i < count($bbox); $i += 2) {
$pt = transform(floatval($bbox[$i]), floatval($bbox[$i + 1]), $oldEPSG, $newEPSG);
if (!is_null($pt)) {
$response["points"][] = array("x" => $pt["x"], "y" => $pt["y"]);
} else {
示例5: dirname
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
require_once dirname(__FILE__) . "/../classes/class_user.php";
require_once dirname(__FILE__) . "/../classes/class_wmc.php";
require_once dirname(__FILE__) . "/../classes/class_wmcToXml.php";
require_once dirname(__FILE__) . "/../classes/class_json.php";
require_once dirname(__FILE__) . "/../classes/class_administration.php";
$ajaxResponse = new AjaxResponse($_POST);
$json = new Mapbender_JSON();
$userId = Mapbender::session()->get("mb_user_id");
$currentUser = new User($userId);
$wmc = new wmc();
$resultObj = array();
switch ($ajaxResponse->getMethod()) {
// gets available WMCs
case "getWmc":
$showPublic = $ajaxResponse->getParameter("showPublic");
//$e = new mb_notice("mod_loadwmc_server.php: showPublic: ".$showPublic);
$resultObj["wmc"] = $wmc->selectByUser($currentUser, $showPublic);
$ajaxResponse->setResult($resultObj);
$ajaxResponse->setSuccess(true);
break;
// gets XML document of a WMC
// gets XML document of a WMC
case "getWmcDocument":
$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);
示例6: array
//"Service"-childnode KeywordList
if (strtoupper($layerChild->nodeName) == "KEYWORDLIST") {
$keywords_list = $layerChild->childNodes;
$keywords = array();
foreach ($keywords_list as $keywordlist_child_node) {
$keyword = $keywordlist_child_node->nodeValue;
array_push($keywords, $keyword);
}
$resultObj["original_featuretype_keyword"] = implode(", ", $keywords);
}
}
return $resultObj;
}
switch ($ajaxResponse->getMethod()) {
case "getOriginalMetadata":
$wfsId = $ajaxResponse->getParameter("id");
$featuretypeName = $ajaxResponse->getParameter("featuretypeName");
$sql = <<<SQL
\t
SELECT wfs_getcapabilities_doc FROM wfs WHERE wfs_id = {$wfsId};
SQL;
$res = db_query($sql);
$row = db_fetch_array($res);
$wfs_getcapabilities_doc = $row["wfs_getcapabilities_doc"];
if ($featuretypeName != "") {
$resultObj = getFeaturetypeMetadataFromXml($wfs_getcapabilities_doc, $featuretypeName);
} else {
$resultObj = getWfsMetadataFromXml($wfs_getcapabilities_doc);
}
$ajaxResponse->setResult($resultObj);
示例7: array
//"Service"-childnode KeywordList
if (strtoupper($layerChild->nodeName) == "KEYWORDLIST") {
$keywords_list = $layerChild->childNodes;
$keywords = array();
foreach ($keywords_list as $keywordlist_child_node) {
$keyword = $keywordlist_child_node->nodeValue;
array_push($keywords, $keyword);
}
$resultObj["original_layer_keyword"] = implode(", ", $keywords);
}
}
return $resultObj;
}
switch ($ajaxResponse->getMethod()) {
case "getOriginalMetadata":
$wmsId = $ajaxResponse->getParameter("id");
$layerName = $ajaxResponse->getParameter("layerName");
$sql = <<<SQL
\t
SELECT wms_getcapabilities_doc FROM wms WHERE wms_id = {$wmsId};
SQL;
$res = db_query($sql);
$row = db_fetch_array($res);
$wms_getcapabilities_doc = $row["wms_getcapabilities_doc"];
if ($layerName != "") {
$resultObj = getLayerMetadataFromXml($wms_getcapabilities_doc, $layerName);
} else {
$resultObj = getWmsMetadataFromXml($wms_getcapabilities_doc);
}
$ajaxResponse->setResult($resultObj);
示例8: dirname
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
require_once dirname(__FILE__) . "/../php/mb_validateSession.php";
require_once dirname(__FILE__) . "/../classes/class_json.php";
require_once dirname(__FILE__) . "/../classes/class_wfs_configuration.php";
require_once dirname(__FILE__) . "/../classes/class_wfs_conf.php";
$ajaxResponse = new AjaxResponse($_REQUEST);
$command = $ajaxResponse->getMethod();
switch ($command) {
case "getWfsConfsFromId":
$wfsConfIdString = $ajaxResponse->getParameter("wfsConfIdString");
if (!$wfsConfIdString) {
$ajaxResponse->setSuccess($false);
$ajaxResponse->setMessage("missing wfsConfIdString");
$ajaxResponse->send();
break;
}
$wfsConfIdString = trim($wfsConfIdString, ',');
$wfsConfIds = explode(',', $wfsConfIdString);
$result = array();
foreach ($wfsConfIds as $wfsId) {
$currentWfsConf = WfsConfiguration::createFromDb($wfsId);
if ($currentWfsConf !== null) {
$result[] = $currentWfsConf;
}
}
示例9: dirname
<?php
require dirname(__FILE__) . "/../../core/globalSettings.php";
$request = new AjaxResponse($_REQUEST);
$method = $request->getMethod();
try {
switch ($method) {
case "intersect":
$geometries = $request->getParameter("geometries");
$clickPoint = $request->getparameter("clickPoint");
$resultGeometries = array();
$i = 0;
foreach ($geometries as $geometry) {
$sql = "SELECT ST_Intersects ('{$clickPoint}'::geometry, '{$geometry}'::geometry);";
$dbresult = db_query($sql);
$row = db_fetch_array($dbresult);
$result = $row["st_intersects"] == "f" ? false : true;
if ($result) {
$resultGeometries[$i] = $geometry;
}
$i++;
}
$request->setSuccess(true);
$request->setResult(array("geometries" => $resultGeometries));
break;
default:
$e = new mb_exception(__FILE__ . ": RPC called with invalid Method '{$method}'");
$request->setSuccess(false);
$request->setMessage(__FILE__ . ": RPC called with invalid Method '{$method}'");
}
} catch (Exception $E) {
示例10: foreach
if (is_object($tree)) {
foreach ($tree as $key => $value) {
$tree->{$key} = translateTree($value);
}
} else {
if (is_array($tree)) {
foreach ($tree as $key => $value) {
$tree[$key] = translateTree($value);
}
} else {
if (is_string($tree)) {
$tree = _mb($tree);
}
}
}
return $tree;
}
$ajaxResponse = new AjaxResponse($_POST);
switch ($ajaxResponse->getMethod()) {
case "translateServiceData":
$msg_obj = $ajaxResponse->getParameter("data");
$translated_obj = translateTree($msg_obj);
$ajaxResponse->setSuccess(true);
$ajaxResponse->setResult($translated_obj);
break;
default:
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage(_mb("An unknown error occured."));
break;
}
$ajaxResponse->send();
示例11: array
if (Mapbender::session()->exists("mb_wmc")) {
Mapbender::session()->delete("mb_wmc");
$ajaxResponse->setMessage(_mb("WMC in session reset."));
$ajaxResponse->setSuccess(true);
} else {
$ajaxResponse->setMessage(_mb("No WMC in session found."));
$ajaxResponse->setResult($resultObj);
$ajaxResponse->setSuccess(false);
}
break;
case 'updateWmc':
if (!Mapbender::session()->exists("wmcGetApi") || !is_a(Mapbender::session()->get("wmcGetApi"), "wmc")) {
$ajaxResponse->setMessage(_mb("No WMC in session."));
$ajaxResponse->setSuccess(true);
break;
}
$wmc = Mapbender::session()->get("wmcGetApi");
$skipWms = $ajaxResponse->getParameter("wmsIndices");
$skipWms = is_array($skipWms) ? $skipWms : array();
$js = $wmc->toJavaScript($skipWms);
$resultObj = array("js" => $js);
$ajaxResponse->setResult($resultObj);
$ajaxResponse->setSuccess(true);
break;
// Invalid command
// Invalid command
default:
$ajaxResponse->setMessage(_mb("No method specified."));
$ajaxResponse->setSuccess(false);
}
$ajaxResponse->send();
示例12: dirname
require_once dirname(__FILE__) . "/../php/mb_validateSession.php";
require_once dirname(__FILE__) . "/../classes/class_administration.php";
require_once dirname(__FILE__) . "/../classes/class_wmc.php";
require_once dirname(__FILE__) . "/../classes/class_json.php";
require_once dirname(__FILE__) . "/../classes/class_lzw_decompress.php";
$ajaxResponse = new AjaxResponse($_POST);
if ($ajaxResponse->getMethod() != "saveWMC") {
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage("method invalid");
$ajaxResponse->send();
exit;
}
$json = new Mapbender_JSON();
// get data from POST and SESSION
$userId = Mapbender::session()->get("mb_user_id");
$mapObject = $ajaxResponse->getParameter('mapObject');
$lzwCompressed = $ajaxResponse->getParameter('lzwCompressed');
$saveInSession = $ajaxResponse->getParameter('saveInSession');
$extensionData = $json->decode($ajaxResponse->getParameter('extensionData'));
$attributes = $ajaxResponse->getParameter('attributes');
$overwrite = $ajaxResponse->getParameter('overwrite');
$overwrite = $overwrite == "1" ? true : false;
//for debugging, write mapObject to file
if ($lzwCompressed == 'true') {
//$e = new mb_exception('mod_savewmc_server.php: mapObject: '.implode(',',$mapObject));
$mapObject = lzw_decompress($mapObject);
//$e = new mb_exception('mod_savewmc_server.php: mapObject uncompressed: '.$mapObject);
//$filename = TMPDIR."/formerly_compressed_json.txt";//will be set to new one cause ?
} else {
//$filename = TMPDIR."/formerly_uncompressed_json.txt";//will be set to new one cause ?
}
示例13: dirname
<?php
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
require_once dirname(__FILE__) . "/../classes/class_connector.php";
require_once dirname(__FILE__) . "/../classes/class_administration.php";
require_once dirname(__FILE__) . "/../classes/class_stripRequest.php";
require_once dirname(__FILE__) . "/../classes/class_weldMaps2JPEG.php";
$ajaxResponse = new AjaxResponse($_REQUEST);
$wmcId = $ajaxResponse->getParameter("wmcId");
$mapUrls = $ajaxResponse->getParameter("mapUrls");
if (!$wmcId) {
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage('wmcId not set');
$ajaxResponse->send();
}
if (!$mapUrls) {
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage('mapURLs not set');
$ajaxResponse->send();
}
switch ($ajaxResponse->getMethod()) {
case "saveWmcPreview":
//check if all urls have been send - sometimes only false is send - then delete this entry!
//loop
$mapUrlsNew = array();
$problemUrls = array();
for ($i = 0; $i < count($mapUrls); $i++) {
if ($mapUrls[$i] != 'false') {
$mapUrlsNew[] = $mapUrls[$i];
} else {
$problemUrls[] = $i;
示例14: dirname
<?php
require_once dirname(__FILE__) . "/../../core/globalSettings.php";
require_once dirname(__FILE__) . "/../../http/classes/class_connector.php";
require_once dirname(__FILE__) . "/../../http/classes/class_administration.php";
require_once dirname(__FILE__) . "/../classes/class_weldMaps2JPEG.php";
//define("LAYER_PREVIEW_BASE","../tmp/layerpreviews/");
//define("LAYER_PREVIEW_BASE","../tmp/");
$ajaxResponse = new AjaxResponse($_REQUEST);
$mapurl = $ajaxResponse->getParameter("mapurl");
$layerName = $ajaxResponse->getParameter("layerName");
$legendUrl = $ajaxResponse->getParameter("legendUrl");
$wmsId = $ajaxResponse->getParameter("wmsId");
$layerId = $ajaxResponse->getParameter("layerId");
$layerPreviewMapFileName = PREVIEW_DIR . "/" . $layerId . "_layer_map_preview.jpg";
$layerPreviewLegendFileName = PREVIEW_DIR . "/" . $layerId . "_layer_legend_preview.jpg";
if (!$mapurl) {
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage('mapURL not set');
$ajaxResponse->send();
}
/*
if(!$legendurl){
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage('legendURL not set');
$ajaxResponse->send();
}
*/
if (!$wmsId) {
$ajaxResponse->setSuccess(false);
$ajaxResponse->setMessage('wmsId not set');
示例15: IN
SELECT wfs.wfs_id, wfs.wfs_title, wfs.wfs_timestamp, wfs_version
FROM wfs WHERE wfs_id IN ({$wfsList});
SQL;
$res = db_query($sql);
$resultObj = array("header" => array("WFS ID", "Titel", "Timestamp", "Version"), "data" => array());
while ($row = db_fetch_row($res)) {
// convert NULL to '', NULL values cause datatables to crash
$walk = array_walk($row, create_function('&$s', '$s=strval($s);'));
$resultObj["data"][] = $row;
}
$ajaxResponse->setResult($resultObj);
$ajaxResponse->setSuccess(true);
break;
case "getWfsMetadata":
$wfsId = $ajaxResponse->getParameter("id");
getWfs($wfsId);
$sql = <<<SQL
\t
SELECT wfs_id, wfs_abstract, wfs_title, fees, accessconstraints,
individualname, positionname, providername, voice,
facsimile, deliverypoint, city,
administrativearea, postalcode, country, electronicmailaddress,
wfs_timestamp, wfs_timestamp_create, wfs_network_access, fkey_mb_group_id
FROM wfs WHERE wfs_id = {$wfsId};
SQL;
$res = db_query($sql);
$resultObj = array();
$row = db_fetch_assoc($res);
$resultObj['wfs_id'] = $row['wfs_id'];