1<?php
2/**
3 * DokuWiki Plugin tablelayout
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Michael Große, Andreas Gohrs <dokuwiki@cosmocode.de>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) {
11    die();
12}
13
14class action_plugin_tablelayout_jsinfo extends DokuWiki_Action_Plugin
15{
16    /**
17     * Registers a callback function for a given event
18     *
19     * @param Doku_Event_Handler $controller DokuWiki's event controller object
20     * @return void
21     */
22    public function register(Doku_Event_Handler $controller)
23    {
24        $controller->register_hook('DOKUWIKI_STARTED', 'BEFORE', $this, 'populateJSINFO');
25    }
26
27    public function populateJSINFO() {
28        global $JSINFO;
29
30        if (!isset($JSINFO['plugins'])) {
31            $JSINFO['plugins'] = [];
32        }
33
34        $JSINFO['plugins']['tablelayout'] = [
35            'features_active_by_default' => $this->getConf('features_active_by_default'),
36        ];
37    }
38
39}
40