summaryrefslogtreecommitdiff
path: root/app/ServiceProvider/NotificationProvider.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
committerFrederic Guillot <fred@kanboard.net>2015-12-05 20:31:27 -0500
commite9fedf3e5cd63aea4da7a71f6647ee427c62fa49 (patch)
treeabc2de5aebace4a2d7c94805552264dab6b10bc7 /app/ServiceProvider/NotificationProvider.php
parent346b8312e5ac877ce3192c2db3a26b500018bbb5 (diff)
Rewrite of the authentication and authorization system
Diffstat (limited to 'app/ServiceProvider/NotificationProvider.php')
-rw-r--r--app/ServiceProvider/NotificationProvider.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/app/ServiceProvider/NotificationProvider.php b/app/ServiceProvider/NotificationProvider.php
new file mode 100644
index 00000000..83daf65d
--- /dev/null
+++ b/app/ServiceProvider/NotificationProvider.php
@@ -0,0 +1,45 @@
+<?php
+
+namespace Kanboard\ServiceProvider;
+
+use Pimple\Container;
+use Pimple\ServiceProviderInterface;
+use Kanboard\Model\UserNotificationType;
+use Kanboard\Model\ProjectNotificationType;
+use Kanboard\Notification\Mail as MailNotification;
+use Kanboard\Notification\Web as WebNotification;
+
+/**
+ * Notification Provider
+ *
+ * @package serviceProvider
+ * @author Frederic Guillot
+ */
+class NotificationProvider implements ServiceProviderInterface
+{
+ /**
+ * Register providers
+ *
+ * @access public
+ * @param \Pimple\Container $container
+ * @return \Pimple\Container
+ */
+ public function register(Container $container)
+ {
+ $container['userNotificationType'] = function ($container) {
+ $type = new UserNotificationType($container);
+ $type->setType(MailNotification::TYPE, t('Email'), '\Kanboard\Notification\Mail');
+ $type->setType(WebNotification::TYPE, t('Web'), '\Kanboard\Notification\Web');
+ return $type;
+ };
+
+ $container['projectNotificationType'] = function ($container) {
+ $type = new ProjectNotificationType($container);
+ $type->setType('webhook', 'Webhook', '\Kanboard\Notification\Webhook', true);
+ $type->setType('activity_stream', 'ActivityStream', '\Kanboard\Notification\ActivityStream', true);
+ return $type;
+ };
+
+ return $container;
+ }
+}