mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-29 19:20:52 -04:00
Simplify logic a bit and tweak the visible text.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user