1<?php
2/**
3 * Display quotations
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Andreas Gohr <andi@splitbrain.org>
7 * @author     Trailjeep <trailjeep@gmail.com>
8 */
9
10class action_plugin_jquotes extends DokuWiki_Action_Plugin {
11
12    /** @inheritdoc */
13    function register(Doku_Event_Handler $controller) {
14        $controller->register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'handle_ajax_call_unknown');
15    }
16
17    /**
18     * Handle the ajax call
19     *
20     * @param Doku_Event $event
21     * @param $param
22     */
23    function handle_ajax_call_unknown(Doku_Event $event, $param) {
24        if($event->data != 'plugin_jquotes') return;
25        $event->preventDefault();
26        $event->stopPropagation();
27        global $INPUT;
28        echo helper_plugin_jquotes::getCookieHTML($INPUT->str('cookie'));
29    }
30
31}
32