forked from TimPietrusky/MantisThemeManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MantisThemeManager.php
49 lines (39 loc) · 1.14 KB
/
MantisThemeManager.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
39
40
41
42
43
44
45
46
47
48
49
<?php
class MantisThemeManagerPlugin extends MantisPlugin {
function register() {
$this->name = 'MantisBT Theme Manager';
$this->description = 'Manage themes in MantisBT.';
$this->page = 'config';
$this->version = '0.0.1';
$this->requires = array(
'MantisCore' => '1.2.0',
);
$this->author = 'Tim Pietrusky';
$this->contact = '[email protected]';
$this->url = 'http://tim-pietrusky.de';
}
function init() {
plugin_event_hook('EVENT_CORE_READY', 'loadTheme');
}
/**
* Configuration.
*
* @return array
*/
function config() {
return array (
'active_theme' => 'default'
);
}
/**
* Load the theme file
*/
function loadTheme() {
global $g_css_include_file;
$themes = getcwd() . "/css/themes/";
$active_theme = plugin_config_get('active_theme');
if (file_exists($themes . $active_theme)) {
$g_css_include_file = "/css/themes/" . $active_theme . "/default.css";
}
}
}