本文整理汇总了PHP中xajaxResponse::getXML方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::getXML方法的具体用法?PHP xajaxResponse::getXML怎么用?PHP xajaxResponse::getXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xajaxResponse
的用法示例。
在下文中一共展示了xajaxResponse::getXML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editvote
function editvote($eV)
{
global $db;
$resp = new xajaxResponse();
$i = 0;
foreach ($eV['id'] as $v) {
$db->query("UPDATE `vote` SET custom1='" . m_addslashes($eV['zd1'][$i]) . "',custom2='" . m_addslashes($eV['zd2'][$i]) . "' WHERE id=" . $v . "") or error('Unable to update vote.', __FILE__, __LINE__, $db->error());
$i++;
}
$resp->alert("更新成功");
return $resp->getXML();
}
示例2: window_save_position
function window_save_position($element, $x, $y)
{
// Instantiate the xajaxResponse object
$response = new xajaxResponse();
if (!$element or !$x or !$y) {
return $response->getXML();
}
// Search the DB
if ($x > 0 and $y > 0 and $x < 3000 and $y < 3000) {
$_SESSION['window_position']["{$element}_x"] = $x;
$_SESSION['window_position']["{$element}_y"] = $y;
}
return $response->getXML();
}
示例3: suggest
function suggest($type, $q, $el_input, $el_suggest)
{
// Instantiate the xajaxResponse object
$response = new xajaxResponse();
if (!$type or !$q or !$el_input or !$el_suggest) {
return $response->getXML();
}
// Make sure the requested function is defined
$function = 'suggest_' . $type;
if (function_exists($function)) {
return $function($q, $el_input, $el_suggest);
}
return $response->getXML();
}
示例4: ws_delete
function ws_delete($window_name, $form = '')
{
global $base, $include, $conf, $self, $onadb;
// Check permissions
if (!(auth('host_del') or auth('subnet_del'))) {
$response = new xajaxResponse();
$response->addScript("alert('Permission denied!');");
return $response->getXML();
}
// If an array in a string was provided, build the array and store it in $form
$form = parse_options_string($form);
// Instantiate the xajaxResponse object
$response = new xajaxResponse();
$js = '';
// Run the module
list($status, $output) = run_module('tag_del', array('tag' => $form['id'], 'commit' => 'Y'));
// If the module returned an error code display a popup warning
if ($status) {
$js .= "alert('Delete failed. " . preg_replace('/[\\s\']+/', ' ', $self['error']) . "');";
} else {
// If there's (refresh) js, send it to the browser
if ($form['js']) {
$js .= $form['js'];
}
}
// Return an XML response
$response->addScript($js);
return $response->getXML();
}
示例5: testRegularFunction
function testRegularFunction($formData)
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("formData: " . print_r($formData, true));
$objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)));
return $objResponse->getXML();
}
示例6: removeInput
function removeInput($aInputData)
{
$sId = $aInputData['inputId'];
$objResponse = new xajaxResponse();
$objResponse->addRemove($sId);
return $objResponse->getXML();
}
示例7: test
function test()
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("hallo");
$objResponse->addAssign('testButton', 'label', 'Success!');
return $objResponse->getXML();
}
示例8: testClassMethod
function testClassMethod($formData)
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("This is a class method.");
$objResponse->addAlert("formData: " . print_r($formData, true));
$objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)));
return $objResponse->getXML();
}
示例9: disconnectUser
function disconnectUser($dn_name, $us_login)
{
global $auth;
$objResponse = new xajaxResponse();
$auth->disconnectUser($dn_name, $us_login);
$objResponse->addScript("document.location='connected_users.php'");
return $objResponse->getXML();
}
示例10: testForm
function testForm($formData, $strText)
{
global $useEncoding, $htmlEntities;
$objResponse = new xajaxResponse($useEncoding, $htmlEntities);
$objResponse->addAlert("formData: " . print_r($formData, true) . $strText);
$objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)) . '<br /><br />' . $strText);
return $objResponse->getXML();
}
示例11: myErrorRiddenFunction
function myErrorRiddenFunction()
{
$value = $silly['nuts'];
$objResponse = new xajaxResponse();
$objResponse->addAlert("Bad array value: {$value}");
include "file_doesnt_exist.php";
return $objResponse->getXML();
}
示例12: confirmTest
function confirmTest()
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("Here is an alert.");
$objResponse->addConfirmCommands(2, "Are you sure you want to show two (2) more alerts?");
$objResponse->addAlert("This will only happen if the user presses OK.");
$objResponse->addAlert("This also will only happen if the user presses OK.");
$objResponse->addAlert("This will always happen.");
return $objResponse->getXML();
}
示例13: submitForm
function submitForm($elems, $doneFunc = 'AjaxFormObj.checkDone', $errFunc = 'AjaxFormObj.checkError')
{
global $lbl, $txt;
$auth = R3AuthInstance::get();
$fieldDescr = array('app_code' => array(MISSING_FIELD => !isset($txt['missing_fld_app']) ? _("Il campo 'applicazione' e' obbligatorio") : $txt['missing_fld_app'], INVALID_FIELD => "Il campo 'codice' contiene caratteri non validi. Solo lettere e numeri sono accettati", PK_ERROR => "Il campo 'codice' immesso esiste gia'"), 'app_name' => array(MISSING_FIELD => "Il campo 'nome' e' obbligatorio"));
// print_r($elems);
$elems = AjaxSplitArray($elems);
//print_r($elems);
$objResponse = new xajaxResponse();
$error = array();
try {
if ($elems['act'] == 'add') {
/** add a new acname */
foreach (explode(',', str_replace(';', ',', $elems['ac_verb'])) as $verb) {
$auth->addACName($elems['app_code'], strtoupper(trim($verb)), strtoupper(trim($elems['ac_name'])), trim($elems['ac_descr']), trim($elems['ac_order']), strtoupper($elems['ac_active']) == 'T', array('ac_type' => strtoupper($elems['ac_type'])));
}
} else {
if ($elems['act'] == 'mod') {
/** modify an acname */
$auth->modACName($elems['old_app_code'], $elems['old_ac_verb'], $elems['old_ac_name'], $elems['app_code'], strtoupper(trim($elems['ac_verb'])), strtoupper(trim($elems['ac_name'])), trim($elems['ac_descr']), trim($elems['ac_order']), strtoupper($elems['ac_active']) == 'T', array('ac_type' => strtoupper($elems['ac_type'])));
} else {
if ($elems['act'] == 'del') {
/** delete an acname */
$auth->delACName($elems['app_code'], $elems['ac_verb'], $elems['ac_name']);
} else {
throw new Exception('Invalid action');
}
}
}
} catch (EPermissionDenied $e) {
$error['element'][] = '';
$error['message'][] = $e->getMessage();
} catch (EDatabaseError $e) {
$error['element'][] = '';
$error['message'][] = "Database error: " . $e->getMessage();
} catch (EInputError $e) {
$error['element'][] = $e->getField();
if (isset($fieldDescr[$e->getField()][$e->getCode()])) {
$error['message'][] = $fieldDescr[$e->getField()][$e->getCode()];
} else {
$error['message'][] = $e->getMessage();
}
} catch (Exception $e) {
$error['element'][] = '';
$error['message'][] = 'Generic error: ' . $e->getMessage();
}
// Action
if (count($error) > 0) {
$errText = (!isset($txt['err_store_failed']) ? _("Salvataggio fallito") . ":" : $txt['err_store_failed']) . "\n - " . implode("\n - ", $error['message']);
$objResponse->addScriptCall($errFunc, $errText, $error['element'][0]);
} else {
$objResponse->addScriptCall($doneFunc);
}
return $objResponse->getXML();
}
示例14: objectscount
function objectscount($fid, $confid)
{
$objResponse = new xajaxResponse();
$pp = do_objectscount($fid, $confid);
//½«ÌíÈëÊýÁ¿
$objResponse->addAssign("objectnum", "disabled", false);
$objResponse->addAssign("objectnum", "value", $pp);
$objResponse->addAssign("max", "value", $pp);
$objResponse->addAssign("doit", "disabled", false);
return $objResponse->getXML();
}
示例15: testForm
function testForm($strText, $formData, $arrArray)
{
global $useEncoding, $htmlEntities;
$objResponse = new xajaxResponse($useEncoding, $htmlEntities);
$data = "Text:\n" . $strText;
$data .= "\n\nFormData:\n" . print_r($formData, true);
$data .= "\n\nArray:\n" . print_r($arrArray, true);
$objResponse->addAlert($data);
$objResponse->addAssign("submittedDiv", "innerHTML", "<pre>" . $data . "</pre>");
return $objResponse->getXML();
}