This class processes the input arguments from the GET or POST data of the request. If this is a request for the initial page load, no arguments will be processed. During a xajax request, any arguments found in the GET or POST will be converted to a PHP array.
function onInvalidRequest()
{
    $objArgumentManager =& xajaxArgumentManager::getInstance();
    $aArgs = $objArgumentManager->process();
    $objResponse = new xajaxResponse();
    $objResponse->alert("This is from the invalid request handler");
    return test2ndFunction($aArgs[0], $objResponse);
}
Beispiel #2
0
 function beforeProcessing(&$bEndRequest)
 {
     $objResponse = new xajaxResponse();
     $objArgumentManager =& xajaxArgumentManager::getInstance();
     $args = $objArgumentManager->process();
     if ($args[1] == 0) {
         $get = print_r($_GET, true);
         $post = print_r($_POST, true);
         $objResponse->alert($this->message . ', which will now allow the request to continue:' . "\n" . $get . $post);
         return $objResponse;
     }
     $bEndRequest = true;
     $objResponse->alert($this->message . ", which will now end the request.");
     return $objResponse;
 }
 function _sendHeaders()
 {
     $objArgumentManager = xajaxArgumentManager::getInstance();
     if (XAJAX_METHOD_GET == $objArgumentManager->getRequestMethod()) {
         header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
         header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
         header("Cache-Control: no-cache, must-revalidate");
         header("Pragma: no-cache");
     }
     $sCharacterSet = '';
     if ($this->sCharacterEncoding && 0 < strlen(trim($this->sCharacterEncoding))) {
         $sCharacterSet = '; charset="' . trim($this->sCharacterEncoding) . '"';
     }
     $sContentType = $this->getContentType();
     header('content-type: ' . $sContentType . ' ' . $sCharacterSet);
 }
Beispiel #4
0
 function __wakeup()
 {
     ob_start();
     $sLocalFolder = dirname(__FILE__);
     //SkipAIO
     require $sLocalFolder . '/xajaxPluginManager.inc.php';
     require $sLocalFolder . '/xajaxLanguageManager.inc.php';
     require $sLocalFolder . '/xajaxArgumentManager.inc.php';
     require $sLocalFolder . '/xajaxResponseManager.inc.php';
     require $sLocalFolder . '/xajaxRequest.inc.php';
     require $sLocalFolder . '/xajaxResponse.inc.php';
     //EndSkipAIO
     // this is the list of folders where xajax will look for plugins
     // that will be automatically included at startup.
     $aPluginFolders = array();
     $aPluginFolders[] = dirname($sLocalFolder) . '/xajax_plugins';
     //SkipAIO
     $aPluginFolders[] = $sLocalFolder . '/plugin_layer';
     //EndSkipAIO
     // Setup plugin manager
     $this->objPluginManager =& xajaxPluginManager::getInstance();
     $this->objPluginManager->loadPlugins($aPluginFolders);
     $this->objLanguageManager =& xajaxLanguageManager::getInstance();
     $this->objArgumentManager =& xajaxArgumentManager::getInstance();
     $this->objResponseManager =& xajaxResponseManager::getInstance();
     $this->sCoreIncludeOutput = ob_get_clean();
 }
 function processRequest()
 {
     if (NULL == $this->sRequestedEvent) {
         return false;
     }
     $objArgumentManager =& xajaxArgumentManager::getInstance();
     $aArgs = $objArgumentManager->process();
     foreach (array_keys($this->aEvents) as $sKey) {
         $objEvent =& $this->aEvents[$sKey];
         if ($objEvent->getName() == $this->sRequestedEvent) {
             $objEvent->fire($aArgs);
             return true;
         }
     }
     return 'Invalid event request received; no event was registered with this name.';
 }
 function processRequest()
 {
     if (NULL == $this->sRequestedFunction) {
         return false;
     }
     $objArgumentManager = xajaxArgumentManager::getInstance();
     $aArgs = $objArgumentManager->process();
     foreach (array_keys($this->aFunctions) as $sKey) {
         $xuf = $this->aFunctions[$sKey];
         if ($xuf->getName() == $this->sRequestedFunction) {
             $xuf->call($aArgs);
             return true;
         }
     }
     return 'Invalid function request received; no request processor found with this name.';
 }
 public function processRequest()
 {
     if (NULL == $this->sRequestedClass) {
         return false;
     }
     if (NULL == $this->sRequestedMethod) {
         return false;
     }
     $objArgumentManager = xajaxArgumentManager::getInstance();
     $aArgs = $objArgumentManager->process();
     foreach (array_keys($this->aCallableObjects) as $sKey) {
         $xco = $this->aCallableObjects[$sKey];
         if ($xco->isClass($this->sRequestedClass)) {
             if ($xco->hasMethod($this->sRequestedMethod)) {
                 $xco->call($this->sRequestedMethod, $aArgs);
                 return true;
             }
         }
     }
     return 'Invalid request for a callable object.';
 }
 public function processRequest()
 {
     if (NULL == $this->sRequestedFunction) {
         return false;
     }
     header("Content-Type:text/html;\n\n");
     $objArgumentManager =& xajaxArgumentManager::getInstance();
     $aArgs = $objArgumentManager->process();
     if ("getProgress" == $this->sRequestedFunction) {
         $this->call($this->sRequestedFunction, $aArgs);
         return true;
     }
     $pid = $_POST['APC_UPLOAD_PROGRESS'];
     unset($_POST['APC_UPLOAD_PROGRESS']);
     unset($_POST['xjxExtUP']);
     $aArgs = array($_POST);
     foreach (array_keys($this->aFunctions) as $sKey) {
         $xuf =& $this->aFunctions[$sKey];
         if ($xuf->getName() == $this->sRequestedFunction) {
             $sMethod = $xuf->getName();
             $tmp = call_user_func_array($sMethod, $aArgs);
             ob_start();
             $tmp->_printResponse_XML();
             $response = ob_get_clean();
             print "<html><head><body><script type='text/javascript'>parent.xajax.ext.uploadProgress.tools.manageResponse('" . $pid . "'," . json_encode($response) . ");</script></body></html>";
             print $response;
             return true;
         }
     }
     return 'Invalid function request received; no request processor found with this name.';
 }
Beispiel #9
0
 function configure($sName, $mValue)
 {
     if ('errorHandler' == $sName) {
         if (true === $mValue || false === $mValue) {
             $this->bErrorHandler = $mValue;
         }
     } else {
         if ('exitAllowed' == $sName) {
             if (true === $mValue || false === $mValue) {
                 $this->bExitAllowed = $mValue;
             }
         } else {
             if ('cleanBuffer' == $sName) {
                 if (true === $mValue || false === $mValue) {
                     $this->bCleanBuffer = $mValue;
                 }
             } else {
                 if ('logFile' == $sName) {
                     $this->sLogFile = $mValue;
                 }
             }
         }
     }
     $objPluginManager =& xajaxPluginManager::getInstance();
     $objPluginManager->configure($sName, $mValue);
     $objArgumentManager =& xajaxArgumentManager::getInstance();
     $objArgumentManager->configure($sName, $mValue);
     $objResponseManager =& xajaxResponseManager::getInstance();
     $objResponseManager->configure($sName, $mValue);
     $this->aSettings[$sName] = $mValue;
 }