If this is a xajax request (see canProcessRequest>), call the
requested PHP function, build the response and send it back to the
browser.
This is the main server side engine for xajax. It handles all the
incoming requests, including the firing of events and handling of the
response. If your RequestURI is the same as your web page, then this
function should be called before ANY headers or HTML is output from
your script.
This function may exit, if a request is processed. See bAllowExit>
public processRequest ( ) |
public function isAjaxCall() { static $bIsAjaxCall; // rest of code can be executed only one time if (!is_null($bIsAjaxCall)) { return $bIsAjaxCall; } if (!self::$oXajax->canProcessRequest()) { return $bIsAjaxCall = false; } self::$oXajax->processRequest(); return $bIsAjaxCall = true; }
$xajax->configure('javascript URI', '../../'); class clsFunctions { function clsFunctions() { } function confirm($seconds) { sleep($seconds); $objResponse = new xajaxResponse(); $objResponse->append('outputDIV', 'innerHTML', '<br />confirmation from theFrame.php call'); return $objResponse; } } $xajax->register(XAJAX_CALLABLE_OBJECT, new clsFunctions()); $xajax->processRequest(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>xajax Test iFrame</title> <?php $xajax->printJavascript(); ?> </head> <body> <div>This is the iframe</div> <div id='outputDIV'></div> </body> </html>
include "avaliacoes_forum.inc"; require_once "../xajax_0.5/xajax_core/xajax.inc.php"; //Estancia o objeto XAJAX $objAjax = new xajax(); $objAjax->configure("characterEncoding", 'ISO-8859-1'); $objAjax->setFlag("decodeUTF8Input", true); $objAjax->configure('javascript URI', "../xajax_0.5"); $objAjax->configure('errorHandler', true); //Registre os nomes das funções em PHP que você quer chamar através do xajax $objAjax->register(XAJAX_FUNCTION, "MudarConfiguracaoDinamic"); $objAjax->register(XAJAX_FUNCTION, "EditarTituloDinamic"); $objAjax->register(XAJAX_FUNCTION, "DecodificaString"); // Registra fun��es para uso de menu_principal.php $objAjax->register(XAJAX_FUNCTION, "DeslogaUsuarioCursoDinamic"); // Manda o xajax executar os pedidos acima. $objAjax->processRequest(); $cod_ferramenta = 9; $cod_ferramenta_ajuda = $cod_ferramenta; if (isset($status) && $status == 'D') { $cod_pagina_ajuda = 2; } else { $cod_pagina_ajuda = 1; } include "../topo_tela.php"; $AcessoAvaliacaoF = TestaAcessoAFerramenta($sock, $cod_curso, $cod_usuario, 22); $feedbackObject = new FeedbackObject($lista_frases); $feedbackObject->addAction("excluir", 65, 66); $feedbackObject->addAction("excluirAvaliacao", 65, 88); $feedbackObject->addAction("recuperar", 82, 83); $feedbackObject->addAction("recuperarAvaliacao", 82, 89); $feedbackObject->addAction("apagar", 38, 39);
function sv_hover_xajax() { global $xajax; # require_once("xajax/xajax_core/xajax.inc.php"); $xajax = new xajax(); $xajax->register(XAJAX_FUNCTION, "sv_hover_check"); $xajax->register(XAJAX_FUNCTION, "sv_hover_maintenance_options"); $xajax->register(XAJAX_FUNCTION, "sv_hover_maintenance_drop"); $xajax->register(XAJAX_FUNCTION, "sv_hover_maintenance_drop_images"); $xajax->processRequest(); }
//name_of_function1: $a[7]=substr($a[7],0,-1); //name_of_function2: $a[9]=substr($a[9],0,-1); //require $address_from_bd_xajax_php; require 'x.php'; $x = new xajax(); $x->registerFunction('lang'); $x->registerFunction('auth'); $x->registerFunction('quit'); $x->registerFunction('core'); $x->registerFunction('init'); $x->registerFunction('keep'); $x->registerFunction('e404_page'); $x->registerFunction('change'); $x->registerFunction('wrap'); $x->registerFunction('bd_add'); $x->processRequest(); $x->printJavascript(/*$address_from_bd_xajax_js*/); function lang(){$d = new xajaxResponse();foreach($text as $k=>$v)$d->script("\$lang['$k']='$v';");return $d;} function auth($e,$p) { $d = new xajaxResponse(); require 'bd_users'; $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2); require 'lang'; for($i=0,$n=count($c);$i<$n;$i++) if($a[$i]==md5($e)&&$b[$i]==md5($p)&&$c[$i]==md5($e.$p)) { $_SESSION['id']=++$i; $d->script("$('#auth_fond,#auth').remove();");
function loadXajax() { // Prevents xajax from loading twice if already loaded by jReviews or BlueFlame Platform if (!class_exists('xajax') && !defined('XAJAX_LOADED') && !defined('XAJAX_VER')) { define('XAJAX_LOADED', 1); App::import('Vendor', 'xajax_05final' . DS . 'xajax_core' . DS . 'xajax.inc'); if (defined('MVC_FRAMEWORK_ADMIN')) { $xajax = new xajax('index2.php?option=' . S2Paths::get('jreviews', 'S2_CMSCOMP') . '&task=xajax&no_html=1'); } else { $xajax = new xajax(); } $xajax->setCharEncoding(strtoupper(cmsFramework::getCharset())); if (strtolower(cmsFramework::getCharset()) == 'utf-8') { $decodeUTF8 = false; } else { $decodeUTF8 = true; } /* Set defaults from params */ $this->xajax_statusMessage ? $xajax->setFlag('statusMessages', true) : $xajax->setFlag('statusMessages', false); $this->xajax_waitCursor ? $xajax->setFlag('waitCursor', true) : $xajax->setFlag('waitCursor', false); $this->xajax_debug ? $xajax->setFlag('debug', true) : $xajax->setFlag('debug', false); $decodeUTF8 ? $xajax->setFlag('decodeUTF8Input', true) : $xajax->setFlag('decodeUTF8Input', false); $xajax->registerFunction('xajaxDispatch'); // ob_start('ob_gzhandler'); // Results in wrong encoding error ni certain servers $xajax->processRequest(); $js = $xajax->getJavascript(S2_VENDORS_URL . 'xajax_05final' . _DS); cmsFramework::addScript($js); } }