summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-09-18 09:56:08 -0400
committerEvan Prodromou <evan@controlyourself.ca>2008-09-18 09:56:08 -0400
commit054b4d0be6f3d524a602d787380d9da5986c1f9f (patch)
treee7beef43174510044f6a0d8a2b2a0cfba3cf1589 /actions
parentfbe15efde4c8ae6226bc6bc90a28e29668f744f1 (diff)
if favor/disfavor submitted through ajax, return micro-html of form
darcs-hash:20080918135608-5ed1f-d753cb01f96e04871eb4f503ccd258674a03623a.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/disfavor.php17
-rw-r--r--actions/favor.php15
2 files changed, 26 insertions, 6 deletions
diff --git a/actions/disfavor.php b/actions/disfavor.php
index 6f4a07886..ef01e891f 100644
--- a/actions/disfavor.php
+++ b/actions/disfavor.php
@@ -64,9 +64,18 @@ class DisfavorAction extends Action {
return;
}
- # XXX: ajax response
-
- common_redirect(common_local_url('showfavorites',
- array('nickname' => $user->nickname)));
+ if ($this->boolean('ajax')) {
+ common_start_html('text/xml');
+ common_element_start('head');
+ common_element('title', _('Favor'));
+ common_element_end('head');
+ common_element_start('body');
+ common_favor_form($notice);
+ common_element_end('body');
+ common_element_end('html');
+ } else {
+ common_redirect(common_local_url('showfavorites',
+ array('nickname' => $user->nickname)));
+ }
}
} \ No newline at end of file
diff --git a/actions/favor.php b/actions/favor.php
index 10ad6b809..142d83ae1 100644
--- a/actions/favor.php
+++ b/actions/favor.php
@@ -63,8 +63,19 @@ class FavorAction extends Action {
$this->notify($fave, $notice, $user);
- common_redirect(common_local_url('showfavorites',
- array('nickname' => $user->nickname)));
+ if ($this->boolean('ajax')) {
+ common_start_html('text/xml');
+ common_element_start('head');
+ common_element('title', _('Disfavor'));
+ common_element_end('head');
+ common_element_start('body');
+ common_disfavor_form($notice);
+ common_element_end('body');
+ common_element_end('html');
+ } else {
+ common_redirect(common_local_url('showfavorites',
+ array('nickname' => $user->nickname)));
+ }
}
function notify($fave, $notice, $user) {