1<?php
2
3class action_plugin_fkstimer extends DokuWiki_Action_Plugin {
4
5    /**
6     *
7     * @param Doku_Event_Handler $controller
8     */
9    public function register(Doku_Event_Handler $controller) {
10        $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'serverTime');
11    }
12
13    public function serverTime(Doku_Event &$event) {
14        /*
15         * correction to server time + user can set different between server and display time.
16         */
17        $date = date('Y-m-d\TH:i:s', time() + ($this->getConf('server-correction')));
18
19        $event->data['meta'][] = [
20            'name' => 'fks-timer',
21            'content' => $date
22        ];
23    }
24}
25