1<?php
2/**
3 * projects Action Plugin: hajacking the modification of metadata
4 * it cleears the persistent metadata 'projectfile' if the file in the page was removed.
5 *
6 * @author     Junling Ma <junlingm@gmail.com>
7 */
8
9require_once DOKU_PLUGIN . 'action.php';
10require_once dirname(__FILE__) . '/../lib/ajax_manager.php';
11
12class action_plugin_components_ajax extends DokuWiki_Action_Plugin {
13    /**
14     * Register its handlers with the DokuWiki's event controller
15     */
16    function register(Doku_Event_Handler $controller) {
17        $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this,
18                                   'call');
19    }
20
21	// the matedata has been rendered
22    function call(&$event, $param) {
23        $manager = new Doku_AJAX_Manager();
24        if ($manager && $manager->call($event->data))
25            $event->preventDefault();
26	}
27
28}
29