root/dev/mods/xajax/init.php @ 480

Revision 480, 1.4 KB (checked in by kovell, 12 years ago)

IGB check removed from xajax as javascript works in the Dominion IGB

RevLine 
[365]1<?php
[259]2// common/includes/class.page.php
3// templates/index.tpl
[363]4// you should not change anything in this file but the image generator / whatever bypass change the functions.php
5// bypass some of the image generators..
6if ($page != "thumb" && $page != "mapview" && $page != "sig")
7{
[366]8    require_once('mods/xajax/xajax_core/xajax.inc.php');
[363]9    $xajax = new xajax();
[366]10    require_once('mods/xajax/functions.php');
[363]11    event::register('page_assembleheader', 'mod_xajax::insertHTML');
12
13    // if mods depend on xajax they can register to mod_xajax_initialised
14    // it gets called after all mods have been initialized
15    event::register('mods_initialised', 'mod_xajax::lateProcess');
[259]16}
17
[363]18class mod_xajax
19{
20    function xajax()
21    {
22        global $mod_xajax_enable;
23        $mod_xajax_enable = true;
24    }
25
26    // on page assembly look wether xajax is needed or not
[366]27    function insertHTML($obj)
[363]28    {
[366]29        global $mod_xajax_enable;
30        if (!isset($mod_xajax_enable))
31        {
32            return;
33        }
[363]34
[366]35        global $xajax;
[363]36        $obj->addBody($xajax->getJavascript("mods/xajax/"));
37    }
38
39    function lateProcess()
40    {
41        // let all mods know we're here so they can register their functions
42        event::call('mod_xajax_initialised', $this);
43
44        // now process all xajax calls
45        global $xajax;
46        $xajax->processRequest();
47    }
48}
Note: See TracBrowser for help on using the browser.