本文整理汇总了PHP中AjaxResponse::setSuccess方法的典型用法代码示例。如果您正苦于以下问题:PHP AjaxResponse::setSuccess方法的具体用法?PHP AjaxResponse::setSuccess怎么用?PHP AjaxResponse::setSuccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AjaxResponse
的用法示例。
在下文中一共展示了AjaxResponse::setSuccess方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: IN
\t
SELECT mb_user_wmc.wmc_serial_id as wmc_id, mb_user_wmc.wmc_title, mb_user_wmc.wmc_timestamp, wmc_load_count.load_count FROM mb_user_wmc
LEFT JOIN wmc_load_count ON wmc_load_count.fkey_wmc_serial_id = mb_user_wmc.wmc_serial_id WHERE wmc_serial_id IN ({$wmcList});
SQL;
$res = db_query($sql);
$resultObj = array("header" => array("WMC ID", "Titel", "Timestamp", "Load Count", ""), "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);'));
$link = "<a class='cancelClickEvent' target='_blank' href='../php/mod_showMetadata.php?" . "languageCode=" . Mapbender::session()->get("mb_lang") . "&resource=wmc&id=" . $row[0] . "'>" . _mb("Metadata") . "</a>";
array_push($row, $link);
$resultObj["data"][] = $row;
}
$ajaxResponse->setResult($resultObj);
$ajaxResponse->setSuccess(true);
break;
case "getWmcMetadata":
$wmcId = $ajaxResponse->getParameter("id");
$sql = <<<SQL
\t
SELECT wmc_serial_id as wmc_id, abstract, wmc_title,
wmc_timestamp, wmc_timestamp_create, wmc_public
FROM mb_user_wmc WHERE wmc_serial_id = {$wmcId};
SQL;
$res = db_query($sql);
$row = db_fetch_assoc($res);
$resultObj = array();
$resultObj['wmc_id'] = $row['wmc_id'];
$resultObj['wmc_abstract'] = $row['abstract'];
示例2: switch
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) {
$e = new mb_exception(__FILE__ . ": RPC failed. Exception: '{$E}'");
$request->setSuccess(false);
$request->setMessage(__FILE__ . ": RPC failed. Exception: '{$E}'");
}
$request->send();
示例3: dirname
#
# 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;
}
}
$ajaxResponse->setResult($result);
$ajaxResponse->send();
示例4: dirname
/*
* License:
* Copyright (c) 2009, Open Source Geospatial Foundation
* This program is dual licensed under the GNU General Public License
* and Simplified BSD license.
* http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
*/
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