1<?php
2
3use ComboStrap\Api\ApiRouter;
4
5require_once(__DIR__ . '/../vendor/autoload.php');
6
7
8/**
9 * Ajax search data
10 */
11class action_plugin_combo_ajax extends DokuWiki_Action_Plugin
12{
13
14
15    /**
16     * @param Doku_Event_Handler $controller
17     */
18    function register(Doku_Event_Handler $controller)
19    {
20
21        /**
22         * The ajax api to return data
23         * We do a AFTER because {@link action_plugin_move_rename} use the before to
24         * set data to check if it will add a menu item
25         */
26        $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'ajaxHandler');
27
28    }
29
30    /**
31     * @param Doku_Event $event
32     */
33    function ajaxHandler(Doku_Event $event)
34    {
35
36        ApiRouter::handle($event);
37
38    }
39
40
41}
42