1<?php
2
3class action_plugin_vimeo extends DokuWiki_Action_Plugin
4{
5    /**
6     * Register handlers
7     */
8    function register(Doku_Event_Handler $controller)
9    {
10        $controller->register_hook(
11            'DOKUWIKI_STARTED', 'AFTER', $this,
12            'jsinfo'
13        );
14    }
15
16    /**
17     * Add sectok to JavaScript to secure ajax requests
18     *
19     * @param Doku_Event $event
20     * @param            $param
21     */
22    function jsinfo(Doku_Event $event, $param)
23    {
24        global $JSINFO;
25        global $ID;
26
27        if (auth_ismanager()) {
28            $JSINFO['plugins']['vimeo']['purgelink'] = wl($ID, ['purge' => 'true'], false, '&');
29        } else {
30            $JSINFO['plugins']['vimeo']['purgelink'] = '';
31        }
32    }
33}
34