diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-02 03:21:29 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-02 03:21:29 +0000 |
commit | 0eb593711bc2d5abac0ec35eb21d9fe722e7bd30 (patch) | |
tree | 47ea1ebaa86d91cd570dfa6f036a8c296dba1d68 /modules/notification/controllers | |
parent | 69a7e238a4da3ac92f0b62aa2aba6ce3b530a943 (diff) |
We no longer need a dialog to set or remove a watch, so remove it.
Diffstat (limited to 'modules/notification/controllers')
-rw-r--r-- | modules/notification/controllers/notification.php | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/modules/notification/controllers/notification.php b/modules/notification/controllers/notification.php index 26842a89..94dcfddc 100644 --- a/modules/notification/controllers/notification.php +++ b/modules/notification/controllers/notification.php @@ -23,36 +23,13 @@ class Notification_Controller extends Controller { access::required("view", $item); $watching = notification::is_watching($item); - $form = $this->_get_form($item, $watching); - if (request::method() == "post") { - if ($form->validate()) { - if (!$watching) { - notification::add_watch($item); - message::success(sprintf(t("Watch Enabled on %s!"), $item->title)); - $response = json_encode(array("result" => "success")); - } else { - notification::remove_watch($item); - $response = json_encode(array("result" => "success")); - message::success(sprintf(t("Watch Removed on %s!"), $item->title)); - } - } else { - $response = json_encode(array("result" => "error", "form" => $form->__toString())); - } + if (!$watching) { + notification::add_watch($item); + message::success(sprintf(t("Watch Enabled on %s!"), $item->title)); } else { - $response = $form; + notification::remove_watch($item); + message::success(sprintf(t("Watch Removed on %s!"), $item->title)); } - - print $response; - } - - function _get_form($item, $watching) { - $button_text = $watching ? t("Remove Watch") : t("Add Watch"); - $label = $watching ? t("Remove Watch from Album") : t("Add Watch to Album"); - - $form = new Forge("notification/watch/$item->id", "", "post", array("id" => "gAddWatchForm")); - $group = $form->group("watch")->label($label); - $group->submit("")->value($button_text); - - return $form; + url::redirect($item->url()); } } |