-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.php
77 lines (60 loc) · 2.11 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\CommentModifier;
use Kanboard\Core\Plugin\Base;
use Kanboard\Core\Translator;
class Plugin extends Base
{
public function initialize()
{
// to be able to load media from another domain, I have to
// modify the Content-Security-Policy first
$this->container['cspRules'] = array_merge($this->container['cspRules'], [
'media-src' => $this->configModel->get('commentmodifier_csp_media_src', '')
]);
// CSS - Asset Hook
$this->hook->on('template:layout:css', array('template' => 'plugins/CommentModifier/Assets/css/comment-modifier.min.css'));
// JS - Asset Hook
$this->hook->on('template:layout:js', array('template' => 'plugins/CommentModifier/Assets/js/commentmodifier.min.js'));
// Helper
$this->helper->register('commentModifierHelper', '\Kanboard\Plugin\CommentModifier\Helper\CommentModifierHelper');
// Template Override
$this->template->setTemplateOverride('comment/show', 'CommentModifier:comment/show');
// Views - Template Hook
$this->template->hook->attach(
'template:config:sidebar', 'CommentModifier:config/commentmodifier_config_sidebar');
// Extra Page - Routes
$this->route->addRoute('/commentmodifier/config', 'CommentModifierController', 'show', 'CommentModifier');
}
public function onStartup()
{
Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
}
public function getPluginName()
{
return 'CommentModifier';
}
public function getPluginDescription()
{
return t('Modify task comments by certain rules');
}
public function getPluginAuthor()
{
return 'Tagirijus';
}
public function getPluginVersion()
{
return '1.2.0';
}
public function getCompatibleVersion()
{
// Examples:
// >=1.0.37
// <1.0.37
// <=1.0.37
return '>=1.2.27';
}
public function getPluginHomepage()
{
return 'https://github.com/Tagirijus/CommentModifier';
}
}