当前位置: 首页>>代码示例>>PHP>>正文


PHP AjaxResponse::getParameter方法代码示例

本文整理汇总了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;
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_usemap.php

示例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
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_wps.php

示例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
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_acceptedTou_server.php

示例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 {
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_coordsLookup_server.php

示例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);
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_loadwmc_server.php

示例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);
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mb_original_metadata_wfs_server.php

示例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);
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mb_original_metadata_server.php

示例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;
            }
        }
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_wfs_conf_server.php

示例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) {
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:intersection.php

示例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();
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_wfs_gazetteer_l10n.php

示例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();
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_sessionWmc_server.php

示例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 ?
}
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mod_savewmc_server.php

示例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;
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mb_metadata_wmcPreview.php

示例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');
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mb_metadata_layerPreview.php

示例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'];
开发者ID:bfpi,项目名称:klarschiff-frontend-mit-mapbender,代码行数:31,代码来源:mb_metadata_wfs_server.php


注:本文中的AjaxResponse::getParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。