1<?php
2/**
3 * DokuWiki Plugin ac (common stuff)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Adrian Lang <lang@cosmocode.de>
7 */
8
9if(!defined('DOKU_INC')) die();
10if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
11require_once DOKU_PLUGIN.'action.php';
12
13require_once DOKU_PLUGIN . 'ac/actions/action.php';
14require_once DOKU_PLUGIN . 'ac/ac.php';
15require_once DOKU_PLUGIN . 'ac/ajax_loader.php';
16
17function syntax_plugin_ac_autoload($name) {
18    if (strpos($name, 'syntax_plugin_ac_action_') !== 0) {
19        return false;
20    }
21    $subclass = substr($name, 24);
22    if (!@file_exists(DOKU_PLUGIN . 'ac/actions/' . $subclass . '.php')) {
23        eval("class syntax_plugin_ac_action_$subclass extends " .
24             'syntax_plugin_ac_action { };');
25        return true;
26    }
27    require_once DOKU_PLUGIN . 'ac/actions/' . $subclass . '.php';
28    return true;
29}
30
31spl_autoload_register('syntax_plugin_ac_autoload');
32
33