-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Plugin.php
executable file
·74 lines (56 loc) · 2.5 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
<?php
namespace Kanboard\Plugin\Moon;
use Kanboard\Core\Plugin\Base;
class Plugin extends Base
{
public function initialize()
{
global $themeMoonConfig;
$pluginFolder = basename(PLUGINS_DIR);
if (file_exists(DATA_DIR . '/files/Moon/config.php')) {
require_once(DATA_DIR . '/files/Moon/config.php');
} else {
mkdir(DATA_DIR . '/files/Moon/Assets/images', 0755, true);
copy($pluginFolder . '/Moon/config.php', DATA_DIR . '/files/Moon/config.php');
copy($pluginFolder . '/Moon/Assets/images/brand-logo.png', DATA_DIR . '/files/Moon/Assets/images/brand-logo.png');
}
if (file_exists($pluginFolder . '/Customizer')) {
$this->template->setTemplateOverride('header/title', 'Moon:layout/header/customizerTitle');
$this->template->setTemplateOverride('header', 'Moon:header');
$this->template->setTemplateOverride('layout', 'Moon:layout');
} elseif (isset($themeMoonConfig['logo'])) {
$this->template->setTemplateOverride('header/title', 'Moon:layout/header/title');
$this->template->setTemplateOverride('header', 'Moon:header');
$this->template->setTemplateOverride('layout', 'Moon:layout');
}
$this->hook->on("template:layout:css", array("template" => $pluginFolder . "/Moon/Assets/css/moon.css"));
$this->hook->on("template:layout:css", array("template" => $pluginFolder . "/Moon/Assets/css/prism.css"));
$this->hook->on('template:layout:js', array('template' => $pluginFolder . '/Moon/Assets/js/clipboard.min.js'));
$this->hook->on('template:layout:js', array('template' => $pluginFolder . '/Moon/Assets/js/prism.js'));
$this->hook->on('template:layout:js', array('template' => $pluginFolder . '/Moon/Assets/js/moon.js'));
}
public function getPluginName()
{
return 'Moon';
}
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.4.7';
}
public function getCompatibleVersion()
{
return '>=1.0.48';
}
public function getPluginHomepage()
{
return 'https://github.com/kenlog/Moon';
}
}