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

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

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

Line 
1<?php
2// common/includes/class.page.php
3// templates/index.tpl
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{
8    require_once('mods/xajax/xajax_core/xajax.inc.php');
9    $xajax = new xajax();
10    require_once('mods/xajax/functions.php');
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');
16}
17
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
27    function insertHTML($obj)
28    {
29        global $mod_xajax_enable;
30        if (!isset($mod_xajax_enable))
31        {
32            return;
33        }
34
35        global $xajax;
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.