xref: /plugin/davcal/action/jsinfo.php (revision 185e2535914616e98630b0777145a3e6d5c8d81b)
1<?php
2
3/**
4 * DokuWiki DAVCal PlugIn - JSINFO component
5 */
6
7if(!defined('DOKU_INC')) die();
8
9class action_plugin_davcal_jsinfo extends DokuWiki_Action_Plugin {
10
11    function register(Doku_Event_Handler $controller) {
12        $controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'add_jsinfo_information');
13    }
14
15    /**
16     * Add the language variable to the JSINFO variable
17     */
18    function add_jsinfo_information(&$event, $param) {
19      global $conf;
20      global $JSINFO;
21
22      $lang = $conf['lang'];
23
24      if(strpos($lang, "de") === 0)
25      {
26          $lc = 'de';
27      }
28      else
29      {
30          $lc = 'en';
31      }
32
33      $JSINFO['plugin']['davcal']['language'] = $lc;
34      $JSINFO['plugin']['davcal']['disable_sync'] = $this->getConf('disable_sync');
35      $JSINFO['plugin']['davcal']['disable_ics'] = $this->getConf('disable_ics');
36    }
37}
38