-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.php
38 lines (35 loc) · 1000 Bytes
/
action.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* DokuWiki Plugin ExtList (Action component)
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Satoshi Sahara <sahara.satoshi@gmail.com>
*
*/
if (!defined('DOKU_INC')) die();
class action_plugin_extlist extends DokuWiki_Action_Plugin
{
/**
* register the event handlers
*/
public function register(Doku_Event_Handler $controller)
{
$controller->register_hook('DOKUWIKI_STARTED', 'BEFORE', $this, 'prepareCssFile');
}
/**
* Prepare plugin stylesheet file
*/
public function prepareCssFile(Doku_Event $event)
{
if ($this->getConf('use_plugin_css')) {
$f0 = dirname(__FILE__).'/sample.less';
$f1 = dirname(__FILE__).'/all.less';
if (!@file_exists($f1) && @file_exists($f0)) {
@copy( $f0, $f1 );
}
} else {
$f = dirname(__FILE__).'/all.less';
if (@file_exists($f)) { @unlink($f); }
}
}
}