-
- # XXX: ajax response
-
- common_redirect(common_local_url('showfavorites',
- array('nickname' => $user->nickname)));
+
+ $user->blowFavesCache();
+
+ if ($this->boolean('ajax')) {
+ common_start_html('text/xml');
+ common_element_start('head');
+ common_element('title', null, _('Add to favorites'));
+ 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)));
+ }