4
Code for module page:
require_once DEBASER_ROOT.'/include/functions.php';
require_once DEBASER_ROOT.'/xajax/xajax_core/xajax.inc.php';
$xajax = new xajax();
if ($playlistyes == 1) {
$rqst1 = &$xajax->register(XAJAX_FUNCTION, 'xajaxupdate');
$xoopsTpl->assign('playlistyes', true);
}
if ($innerdisplay == 1) {
$rqst2 = &$xajax->register(XAJAX_FUNCTION, 'xajaxinnerdisplay');
$xoopsTpl->assign('innerdisplay', true);
}
// Uncomment the next line for debugging purposes
$xajax->setFlag('debug', true);
$xajax->processRequest();
$Xjavapath = XOOPS_URL.'/modules/debaser/xajax';
$xajaxjava = $xajax->getJavascript($Xjavapath);
$xoopsTpl->assign('xoops_module_header', $xajaxjava);
Code for block:
require_once XOOPS_ROOT_PATH.'/modules/debaser/include/functions.php';
require_once XOOPS_ROOT_PATH.'/modules/debaser/xajax/xajax_core/xajax.inc.php';
$xajaxb = new xajax();
$radio = &$xajaxb->register(XAJAX_FUNCTION, 'xajaxradio');
// Uncomment the next line for debugging purposes
$xajaxb->setFlag('debug', true);
if (!preg_match("/debaser/", dirname($_SERVER['PHP_SELF']))) $xajaxb->processRequest();
$Xjavapath = XOOPS_URL.'/modules/debaser/xajax';
$xajaxjavaradio = $xajaxb->getJavascript($Xjavapath);
$block['xajax'] = $xajaxjavaradio;
The only problem is, that has to be only ONE processRequest(), but if the block is displayed inside the module (on that specific page) then there are two processRequest(). I guess I have to move the whole xajax into a framework.