-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlugin.php
61 lines (48 loc) · 1.73 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\GithubReleaseNotifier;
use Kanboard\Plugin\GithubReleaseNotifier\Action\TaskCreationColumn;
use Kanboard\Core\Plugin\Base;
use Kanboard\Core\Security\Role;
use Kanboard\Core\Translator;
class Plugin extends Base
{
public function initialize()
{
$taskCreationColumnAction = new TaskCreationColumn($this->container);
$this->actionManager->register($taskCreationColumnAction);
$taskCreationColumnAction->addEvent(WebhookHandler::EVENT_RELEASED);
//$this->actionManager->getAction('\Kanboard\Action\TaskCreation')->addEvent(WebhookHandler::EVENT_RELEASED);
$this->template->hook->attach('template:project:integrations', 'GithubReleaseNotifier:project/integrations');
$this->route->addRoute('/webhook/github/:project_id/:token', 'Webhook', 'handler', 'GithubReleaseNotifier');
$this->applicationAccessMap->add('Webhook', 'handler', Role::APP_PUBLIC);
}
public function onStartup()
{
Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
$this->eventManager->register(WebhookHandler::EVENT_RELEASED, t('Github Release'));
}
public function getPluginName()
{
return 'GithubReleaseNotifier';
}
public function getPluginDescription()
{
return t('Kanboard Plugin to create task when github release.');
}
public function getPluginAuthor()
{
return 'Shaun Fong';
}
public function getPluginVersion()
{
return '1.1.0';
}
public function getPluginHomepage()
{
return '/~https://github.com/Shaun-Fong/github-release-notifier';
}
public function getCompatibleVersion()
{
return '>=1.0.37';
}
}