From 3600e732829746e28262c2c8e095702e645d1571 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 4 Mar 2009 05:22:42 +0000 Subject: Simplify logic a bit and tweak the visible text. --- modules/notification/controllers/notification.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'modules/notification/controllers/notification.php') diff --git a/modules/notification/controllers/notification.php b/modules/notification/controllers/notification.php index 8722f890..c32064ba 100644 --- a/modules/notification/controllers/notification.php +++ b/modules/notification/controllers/notification.php @@ -24,13 +24,12 @@ class Notification_Controller extends Controller { $item = ORM::factory("item", $id); access::required("view", $item); - $watching = notification::is_watching($item); - if (!$watching) { - notification::add_watch($item); - message::success(sprintf(t("Watch Enabled on %s!"), $item->title)); - } else { + if (notification::is_watching($item)) { notification::remove_watch($item); - message::success(sprintf(t("Watch Removed on %s!"), $item->title)); + message::success(sprintf(t("You are no longer watching %s"), $item->title)); + } else { + notification::add_watch($item); + message::success(sprintf(t("You are now watching %s"), $item->title)); } url::redirect($item->url()); } -- cgit v1.2.3