include_once $sRoot . $sCore . '/xajaxControl.inc.php'; } $sControls = '/xajax_controls'; include_once $sRoot . $sControls . '/document.inc.php'; include_once $sRoot . $sControls . '/content.inc.php'; include_once $sRoot . $sControls . '/group.inc.php'; include_once $sRoot . $sControls . '/form.inc.php'; include_once $sRoot . $sControls . '/misc.inc.php'; $buttonLoadCSS1 = new clsButton(array('attributes' => array('class' => 'loadCSS1', 'id' => 'loadCSS1'), 'children' => array(new clsLiteral('Load CSS 1')), 'event' => array('onclick', $aFunctions['loadcss1']))); $buttonUnloadCSS1 = new clsButton(array('attributes' => array('class' => 'initiallyHidden unloadCSS1', 'id' => 'unloadCSS1'), 'children' => array(new clsLiteral('Unload CSS 1')), 'event' => array('onclick', $aFunctions['unloadcss1']))); $buttonLoadCSS2 = new clsButton(array('attributes' => array('class' => 'loadCSS2', 'id' => 'loadCSS2'), 'children' => array(new clsLiteral('Load CSS 2')), 'event' => array('onclick', $aFunctions['loadcss2']))); $buttonUnloadCSS2 = new clsButton(array('attributes' => array('class' => 'initiallyHidden unloadCSS2', 'id' => 'unloadCSS2'), 'children' => array(new clsLiteral('Unload CSS 2')), 'event' => array('onclick', $aFunctions['unloadcss2']))); $buttonLoadCSS1_Print = new clsButton(array('attributes' => array('class' => 'loadCSS1_Print', 'id' => 'loadCSS1_Print'), 'children' => array(new clsLiteral('Load CSS 1 (print)')), 'event' => array('onclick', $aFunctions['loadcss1_print']))); $buttonUnloadCSS1_Print = new clsButton(array('attributes' => array('class' => 'initiallyHidden unloadCSS1_Print', 'id' => 'unloadCSS1_Print'), 'children' => array(new clsLiteral('Unload CSS 1 (print)')), 'event' => array('onclick', $aFunctions['unloadcss1_print']))); $buttonLoadCSS2_Print = new clsButton(array('attributes' => array('class' => 'loadCSS2_Print', 'id' => 'loadCSS2_Print'), 'children' => array(new clsLiteral('Load CSS 2 (print)')), 'event' => array('onclick', $aFunctions['loadcss2_print']))); $buttonUnloadCSS2_Print = new clsButton(array('attributes' => array('class' => 'initiallyHidden unloadCSS2_Print', 'id' => 'unloadCSS2_Print'), 'children' => array(new clsLiteral('Unload CSS 2 (print)')), 'event' => array('onclick', $aFunctions['unloadcss2_print']))); ob_start(); ?> <script type='text/javascript'> /* <![CDATA[ */ clearLog = function() { xajax.$('log').innerHTML = ''; } /* ]]> */ </script> <style type='text/css'> /* <![CDATA[ */ .initiallyHidden { visibility: hidden; }
$response = new xajaxResponse(); $response->call("myOtherJSFunction"); return $response; } $requestCallScript =& $xajax->register(XAJAX_FUNCTION, "callScript"); $requestCallOtherScript =& $xajax->register(XAJAX_FUNCTION, "callOtherScript"); $xajax->processRequest(); $sRoot = dirname(dirname(dirname(__FILE__))); $sCore = '/xajax_core'; include_once $sRoot . $sCore . '/xajaxControl.inc.php'; $sControls = '/xajax_controls'; include_once $sRoot . $sControls . '/literal.inc.php'; include_once $sRoot . $sControls . '/button.inc.php'; $buttonCallScript = new clsButton(array('attributes' => array('id' => 'call_script'), 'children' => array(new clsLiteral('Click Me')))); $buttonCallScript->setEvent('onclick', $requestCallScript); $buttonCallOtherScript = new clsButton(array('attributes' => array('id' => 'call_other_script'), 'children' => array(new clsLiteral('or Click Me')))); $buttonCallOtherScript->setEvent('onclick', $requestCallOtherScript); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>call Script Test | xajax Tests</title> <?php $xajax->printJavascript(); ?> <script type="text/javascript"> function myJSFunction(firstArg, numberArg, myArrayArg) { var newString = firstArg + " and " + (+numberArg + 100) + "\n"; newString += myArrayArg["myKey"] + " | " + myArrayArg.key2;
//$testResponse->plugin("testPlugin")->testMethod(); // PHP5 ONLY - Uncomment to test //$testResponse->testPlugin->testMethod(); $testResponseOutput = htmlspecialchars($testResponse->getOutput()); $objResponse = new xajaxResponse(); $objResponse->assign("submittedDiv", "innerHTML", $testResponseOutput); $objResponse->plugin('testPlugin', 'testMethod'); return $objResponse; } $reqShowOutput =& $xajax->register(XAJAX_FUNCTION, "showOutput"); $xajax->processRequest(); include_once $core . '/xajaxControl.inc.php'; $controls = dirname(dirname(__FILE__)) . '/xajax_controls'; include_once $controls . '/button.inc.php'; include_once $controls . '/literal.inc.php'; $buttonShowOutput = new clsButton(array('attributes' => array('id' => 'btnShowOutput', 'name' => 'btnShowOutput'), 'children' => array(new clsLiteral('Show Response XML')))); $buttonShowOutput->setEvent('onclick', $reqShowOutput); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Basic Plugin Test | xajax Tests</title> <?php $xajax->printJavascript(); ?> </head> <body> <h2><a href="index.php">xajax Tests</a></h2> <h1>Basic Plugin Test</h1>
} function testMethod() { $this->addCommand(array('n' => 'testPlg'), 'abcde]]>fg'); } } $objPluginManager =& xajaxPluginManager::getInstance(); $objPluginManager->registerPlugin(new testPlugin()); $xajax->processRequest(); $sRoot = dirname(dirname(dirname(__FILE__))); $sCore = '/xajax_core'; include_once $sRoot . $sCore . '/xajaxControl.inc.php'; $sControls = '/xajax_controls'; include_once $sRoot . $sControls . '/button.inc.php'; include_once $sRoot . $sControls . '/literal.inc.php'; $buttonShowOutput = new clsButton(array('attributes' => array('id' => 'btnShowOutput'), 'child' => new clsLiteral('Show Response XML'), 'event' => array('onclick', $reqShowOutput))); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Response Plugin Test</title> <?php $xajax->printJavascript(); ?> </head> <body> <h2><a href="index.php">xajax Tests</a></h2> <h1>Basic Plugin Test</h1>
$functions = new clsFunctions(); $aFunctions = $xajax->register(XAJAX_CALLABLE_OBJECT, $functions); $xajax->processRequest(); $sRoot = dirname(dirname(dirname(__FILE__))); $sCore = '/xajax_core'; include_once $sRoot . $sCore . '/xajaxControl.inc.php'; $sControls = '/xajax_controls'; include_once $sRoot . $sControls . '/literal.inc.php'; include_once $sRoot . $sControls . '/button.inc.php'; $buttonLoadCSS1 = new clsButton(array('attributes' => array('class' => 'loadCSS1', 'id' => 'loadCSS1'), 'children' => array(new clsLiteral('Load CSS 1')))); $buttonLoadCSS1->setEvent('onclick', $aFunctions['loadcss1']); $buttonUnloadCSS1 = new clsButton(array('attributes' => array('class' => 'initiallyHidden unloadCSS1', 'id' => 'unloadCSS1'), 'children' => array(new clsLiteral('Unload CSS 1')))); $buttonUnloadCSS1->setEvent('onclick', $aFunctions['unloadcss1']); $buttonLoadCSS2 = new clsButton(array('attributes' => array('class' => 'loadCSS2', 'id' => 'loadCSS2'), 'children' => array(new clsLiteral('Load CSS 2')))); $buttonLoadCSS2->setEvent('onclick', $aFunctions['loadcss2']); $buttonUnloadCSS2 = new clsButton(array('attributes' => array('class' => 'initiallyHidden unloadCSS2', 'id' => 'unloadCSS2'), 'children' => array(new clsLiteral('Unload CSS 2')))); $buttonUnloadCSS2->setEvent('onclick', $aFunctions['unloadcss2']); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Load / Unload CSS files</title> <?php $xajax->printJavascript(); ?> <script type='text/javascript'> /* <![CDATA[ */ clearLog = function() { xajax.$('log').innerHTML = ''; } /* ]]> */