-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.php
61 lines (49 loc) · 2.4 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
<?php
namespace Kanboard\Plugin\OneExperienceKB;
use Kanboard\Core\Plugin\Base;
class Plugin extends Base {
public function initialize() {
global $themeOneExperienceKBConfig;
if (file_exists(DATA_DIR . '/files/OneExperienceKB/config.php')) {
require_once(DATA_DIR . '/files/OneExperienceKB/config.php');
}
else {
mkdir(DATA_DIR . '/files/OneExperienceKB/Assets/images', 0755, true);
copy('plugins/OneExperienceKB/config.php', DATA_DIR . '/files/OneExperienceKB/config.php');
copy('plugins/OneExperienceKB/Assets/images/brand-logo.png', DATA_DIR . '/files/OneExperienceKB/Assets/images/brand-logo.png');
}
if (file_exists('plugins/Customizer')) {
$this->template->setTemplateOverride('header/title', 'OneExperienceKB:layout/header/customizerTitle');
$this->template->setTemplateOverride('header', 'OneExperienceKB:header');
$this->template->setTemplateOverride('layout', 'OneExperienceKB:layout');
}
elseif (isset($themeOneExperienceKBConfig['logo'])) {
$this->template->setTemplateOverride('header/title', 'OneExperienceKB:layout/header/title');
$this->template->setTemplateOverride('header', 'OneExperienceKB:header');
$this->template->setTemplateOverride('layout', 'OneExperienceKB:layout');
}
$this->hook->on('template:layout:css', array('template' => 'plugins/OneExperienceKB/Assets/css/oneexperiencekb.css'));
$this->hook->on('template:layout:css', array('template' => 'plugins/OneExperienceKB/Assets/css/prism.css'));
$this->hook->on('template:layout:js', array('template' => 'plugins/OneExperienceKB/Assets/js/clipboard.min.js'));
$this->hook->on('template:layout:js', array('template' => 'plugins/OneExperienceKB/Assets/js/prism.js'));
$this->hook->on('template:layout:js', array('template' => 'plugins/OneExperienceKB/Assets/js/oneexperiencekb.js'));
}
public function getPluginName() {
return 'OneExperienceKB';
}
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 'Michail Topaloudis';
}
public function getPluginVersion() {
return '1.0.1';
}
public function getCompatibleVersion() {
return '>=1.0.48';
}
public function getPluginHomepage() {
return 'https://github.com/mojiro/OneExperienceKB';
}
}