summaryrefslogtreecommitdiff
path: root/app/Controller/Webnotification.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-03 12:09:27 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-03 12:09:27 -0400
commitd67d7c54e65e80d1b484490e42dbecb969aa7686 (patch)
treee62446885fac0d3af5b29d409d8e9a4f6c50940e /app/Controller/Webnotification.php
parentb5a2b8f9f7ac9ef947357acd3981993159d64b52 (diff)
Add web notifications
Diffstat (limited to 'app/Controller/Webnotification.php')
-rw-r--r--app/Controller/Webnotification.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/app/Controller/Webnotification.php b/app/Controller/Webnotification.php
new file mode 100644
index 00000000..a481e9b8
--- /dev/null
+++ b/app/Controller/Webnotification.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace Controller;
+
+/**
+ * Web notification controller
+ *
+ * @package controller
+ * @author Frederic Guillot
+ */
+class Webnotification extends Base
+{
+ /**
+ * Mark all notifications as read
+ *
+ * @access public
+ */
+ public function flush()
+ {
+ $user_id = $this->userSession->getId();
+
+ $this->webNotification->markAllAsRead($user_id);
+ $this->response->redirect($this->helper->url->to('app', 'notifications', array('user_id' => $user_id)));
+ }
+
+ /**
+ * Mark a notification as read
+ *
+ * @access public
+ */
+ public function remove()
+ {
+ $user_id = $this->userSession->getId();
+ $notification_id = $this->request->getIntegerParam('notification_id');
+
+ $this->webNotification->markAsRead($user_id, $notification_id);
+ $this->response->redirect($this->helper->url->to('app', 'notifications', array('user_id' => $user_id)));
+ }
+}