|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* Copyright (c) 2012-2016 Mark C. Prins <[email protected]> |
|
4
|
|
|
* |
|
5
|
|
|
* Permission to use, copy, modify, and distribute this software for any |
|
6
|
|
|
* purpose with or without fee is hereby granted, provided that the above |
|
7
|
|
|
* copyright notice and this permission notice appear in all copies. |
|
8
|
|
|
* |
|
9
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|
10
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|
11
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|
12
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|
13
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|
14
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|
15
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
16
|
|
|
* |
|
17
|
|
|
* @author Mark C. Prins <[email protected]> |
|
18
|
|
|
*/ |
|
19
|
|
|
if (!defined('DOKU_INC')) { |
|
20
|
|
|
die(); |
|
21
|
|
|
} |
|
22
|
|
|
if (!defined('DOKU_PLUGIN')) { |
|
23
|
|
|
define('DOKU_PLUGIN', DOKU_INC.'lib/plugins/'); |
|
24
|
|
|
} |
|
25
|
|
|
require_once DOKU_PLUGIN.'action.php'; |
|
26
|
|
|
/** |
|
27
|
|
|
* DokuWiki Plugin snow (Action Component). |
|
28
|
|
|
*/ |
|
29
|
|
|
class action_plugin_snow extends DokuWiki_Action_Plugin { |
|
30
|
|
|
|
|
31
|
|
|
public function register(Doku_Event_Handler $controller) { |
|
32
|
|
|
$controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'add_jsinfo_information'); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
function add_jsinfo_information(&$event, $param) { |
|
|
|
|
|
|
36
|
|
|
global $JSINFO; |
|
37
|
|
|
|
|
38
|
|
|
$JSINFO['plugin']['snow']['enabled'] = $this->getConf('enabled'); |
|
39
|
|
|
$JSINFO['plugin']['snow']['zindex'] = $this->getConf('zindex'); |
|
40
|
|
|
$JSINFO['plugin']['snow']['color'] = $this->getConf('color'); |
|
41
|
|
|
$JSINFO['plugin']['snow']['excludemobile'] = $this->getConf('excludemobile'); |
|
42
|
|
|
$JSINFO['plugin']['snow']['flakesmax'] = $this->getConf('flakesmax'); |
|
43
|
|
|
$JSINFO['plugin']['snow']['flakesmaxactive'] = $this->getConf('flakesmaxactive'); |
|
44
|
|
|
$JSINFO['plugin']['snow']['animationinterval'] = $this->getConf('animationinterval'); |
|
45
|
|
|
$JSINFO['plugin']['snow']['usegpu'] = $this->getConf('usegpu'); |
|
46
|
|
|
$JSINFO['plugin']['snow']['followmouse'] = $this->getConf('followmouse'); |
|
47
|
|
|
$JSINFO['plugin']['snow']['snowstick'] = $this->getConf('snowstick'); |
|
48
|
|
|
$JSINFO['plugin']['snow']['usemelteffect'] = $this->getConf('usemelteffect'); |
|
49
|
|
|
$JSINFO['plugin']['snow']['usetwinkleeffect'] = $this->getConf('usetwinkleeffect'); |
|
50
|
|
|
$JSINFO['plugin']['snow']['freezeonblur'] = $this->getConf('freezeonblur'); |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
|
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.