From ae3f3fcf5bbd009cd5a8f284fe9f6d0cf253314e Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 7 May 2016 22:06:00 -0400 Subject: [PATCH] Update to the latest version of KB --- Notification/Slack.php | 3 ++- Plugin.php | 9 +++++---- Template/config/integration.php | 4 ++-- Template/project/integration.php | 4 ++-- Template/user/integration.php | 4 ++-- Test/PluginTest.php | 1 + 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Notification/Slack.php b/Notification/Slack.php index d68da90..56e762a 100644 --- a/Notification/Slack.php +++ b/Notification/Slack.php @@ -57,6 +57,7 @@ public function notifyProject(array $project, $event_name, array $event_data) * @param array $project * @param string $event_name * @param array $event_data + * @return array */ public function getMessage(array $project, $event_name, array $event_data) { @@ -88,7 +89,7 @@ public function getMessage(array $project, $event_name, array $event_data) * Send message to Slack * * @access private - * @param srting $webhook + * @param string $webhook * @param string $channel * @param array $project * @param string $event_name diff --git a/Plugin.php b/Plugin.php index 55cf98b..ced62cf 100644 --- a/Plugin.php +++ b/Plugin.php @@ -21,10 +21,11 @@ public function initialize() $this->userNotificationType->setType('slack', t('Slack'), '\Kanboard\Plugin\Slack\Notification\Slack'); $this->projectNotificationType->setType('slack', t('Slack'), '\Kanboard\Plugin\Slack\Notification\Slack'); + } - $this->on('app.bootstrap', function($container) { - Translator::load($container['config']->getCurrentLanguage(), __DIR__.'/Locale'); - }); + public function onStartup() + { + Translator::load($this->language->getCurrentLanguage(), __DIR__.'/Locale'); } public function getPluginDescription() @@ -39,7 +40,7 @@ public function getPluginAuthor() public function getPluginVersion() { - return '1.0.2'; + return '1.0.3'; } public function getPluginHomepage() diff --git a/Template/config/integration.php b/Template/config/integration.php index d3932fc..fc81b2c 100644 --- a/Template/config/integration.php +++ b/Template/config/integration.php @@ -3,9 +3,9 @@ form->label(t('Webhook URL'), 'slack_webhook_url') ?> form->text('slack_webhook_url', $values) ?> -

+

- \ No newline at end of file + diff --git a/Template/project/integration.php b/Template/project/integration.php index 7659e73..b135703 100644 --- a/Template/project/integration.php +++ b/Template/project/integration.php @@ -6,9 +6,9 @@ form->label(t('Channel/Group/User (Optional)'), 'slack_webhook_channel') ?> form->text('slack_webhook_channel', $values, array(), array('placeholder="#channel"')) ?> -

+

- \ No newline at end of file + diff --git a/Template/user/integration.php b/Template/user/integration.php index 7482ec7..e4c17aa 100644 --- a/Template/user/integration.php +++ b/Template/user/integration.php @@ -6,9 +6,9 @@ form->label(t('Channel/Group/User (Optional)'), 'slack_webhook_channel') ?> form->text('slack_webhook_channel', $values, array(), array('placeholder="@username"')) ?> -

+

- \ No newline at end of file + diff --git a/Test/PluginTest.php b/Test/PluginTest.php index 4eeab9e..eb10fe3 100644 --- a/Test/PluginTest.php +++ b/Test/PluginTest.php @@ -10,6 +10,7 @@ public function testPlugin() { $plugin = new Plugin($this->container); $this->assertSame(null, $plugin->initialize()); + $this->assertSame(null, $plugin->onStartup()); $this->assertNotEmpty($plugin->getPluginName()); $this->assertNotEmpty($plugin->getPluginDescription()); $this->assertNotEmpty($plugin->getPluginAuthor());