summaryrefslogtreecommitdiff
path: root/app/Controller/Webnotification.php
diff options
context:
space:
mode:
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)));
+ }
+}