-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Plugin.php
executable file
·77 lines (59 loc) · 2.54 KB
/
Plugin.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
namespace Kanboard\Plugin\Nebula;
use Kanboard\Core\Plugin\Base;
class Plugin extends Base
{
public function initialize()
{
global $themeNebulaConfig;
if (file_exists(DATA_DIR . '/files/Nebula/config.php'))
{
require_once(DATA_DIR . '/files/Nebula/config.php');
} else {
mkdir(DATA_DIR . '/files/Nebula/Assets/images', 0755, true);
copy('plugins/Nebula/config.php', DATA_DIR . '/files/Nebula/config.php');
copy('plugins/Nebula/Assets/images/brand-logo.png', DATA_DIR . '/files/Nebula/Assets/images/brand-logo.png');
}
if (file_exists('plugins/Customizer'))
{
$this->template->setTemplateOverride('header/title', 'Nebula:layout/header/customizerTitle');
$this->template->setTemplateOverride('layout', 'Nebula:layout');
$this->template->setTemplateOverride('header/creation_dropdown', 'Nebula:layout/header/creation_dropdown');
}
elseif (isset($themeNebulaConfig['logo']))
{
$this->template->setTemplateOverride('header/title', 'Nebula:layout/header/title');
$this->template->setTemplateOverride('layout', 'Nebula:layout');
$this->template->setTemplateOverride('header/creation_dropdown', 'Nebula:layout/header/creation_dropdown');
}
$this->hook->on("template:layout:css", array("template" => "plugins/Nebula/Assets/css/nebula.css"));
$this->hook->on("template:layout:css", array("template" => "plugins/Nebula/Assets/css/prism.css"));
$this->hook->on('template:layout:js', array('template' => 'plugins/Nebula/Assets/js/clipboard.min.js'));
$this->hook->on('template:layout:js', array('template' => 'plugins/Nebula/Assets/js/prism.js'));
$this->hook->on('template:layout:js', array('template' => 'plugins/Nebula/Assets/js/nebula.js'));
}
public function getPluginName()
{
return 'Nebula';
}
public function getPluginDescription()
{
return t('This theme allows you to add special features like replacing the logo and adds syntax highlighting for Markdown code.');
}
public function getPluginAuthor()
{
return 'Valentino Pesce';
}
public function getPluginVersion()
{
return '1.3.6';
}
public function getCompatibleVersion()
{
return '>=1.0.48';
}
public function getPluginHomepage()
{
return 'https://github.com/kenlog/nebula';
}
}