Filling in missing endHTML calls for Action AJAX

This completes 1c6f9df80e where a lot
of other functions were fixed (by conforming to startHTML and endHTML)
This commit is contained in:
Mikael Nordfeldth 2013-09-24 02:32:17 +02:00
parent f7719b57f2
commit 64df40e409
37 changed files with 42 additions and 43 deletions

View File

@ -156,7 +156,7 @@ class AddpeopletagAction extends Action
$unsubscribe = new UntagButton($this, $this->tagged, $this->peopletag); $unsubscribe = new UntagButton($this, $this->tagged, $this->peopletag);
$unsubscribe->show(); $unsubscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('subscriptions', $url = common_local_url('subscriptions',
array('nickname' => $this->user->nickname)); array('nickname' => $this->user->nickname));

View File

@ -184,7 +184,7 @@ class ApprovegroupAction extends Action
$this->element('p', 'success', _('Join request canceled.')); $this->element('p', 'success', _('Join request canceled.'));
} }
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('groupmembers', array('nickname' => common_redirect(common_local_url('groupmembers', array('nickname' =>
$this->group->nickname)), $this->group->nickname)),

View File

@ -136,7 +136,7 @@ class ApprovesubAction extends Action
$this->element('p', 'success', _('Subscription canceled.')); $this->element('p', 'success', _('Subscription canceled.'));
} }
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('subqueue', array('nickname' => common_redirect(common_local_url('subqueue', array('nickname' =>
$cur->nickname)), $cur->nickname)),

View File

@ -162,7 +162,7 @@ class CancelgroupAction extends Action
$jf = new JoinForm($this, $this->group); $jf = new JoinForm($this, $this->group);
$jf->show(); $jf->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('groupmembers', array('nickname' => common_redirect(common_local_url('groupmembers', array('nickname' =>
$this->group->nickname)), $this->group->nickname)),

View File

@ -114,7 +114,7 @@ class CancelsubscriptionAction extends Action
$subscribe = new SubscribeForm($this, $other); $subscribe = new SubscribeForm($this, $other);
$subscribe->show(); $subscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('subscriptions', common_redirect(common_local_url('subscriptions',
array('nickname' => $user->nickname)), array('nickname' => $user->nickname)),

View File

@ -162,7 +162,7 @@ class DeletegroupAction extends RedirectingAction
$this->elementStart('body'); $this->elementStart('body');
// @fixme add a sensible AJAX response form! // @fixme add a sensible AJAX response form!
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
// @fixme if we could direct to the page on which this group // @fixme if we could direct to the page on which this group
// would have shown... that would be awesome // would have shown... that would be awesome

View File

@ -84,7 +84,7 @@ class DisfavorAction extends FormAction
$favor = new FavorForm($this, $notice); $favor = new FavorForm($this, $notice);
$favor->show(); $favor->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
exit; exit;
} }
} }

View File

@ -85,7 +85,7 @@ class FavorAction extends FormAction
$disfavor = new DisFavorForm($this, $notice); $disfavor = new DisFavorForm($this, $notice);
$disfavor->show(); $disfavor->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
exit; exit;
} }
common_redirect(common_local_url('showfavorites', common_redirect(common_local_url('showfavorites',

View File

@ -163,7 +163,7 @@ class JoingroupAction extends Action
} }
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('groupmembers', array('nickname' => common_redirect(common_local_url('groupmembers', array('nickname' =>
$this->group->nickname)), $this->group->nickname)),

View File

@ -145,7 +145,7 @@ class LeavegroupAction extends Action
$jf = new JoinForm($this, $this->group); $jf = new JoinForm($this, $this->group);
$jf->show(); $jf->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('groupmembers', array('nickname' => common_redirect(common_local_url('groupmembers', array('nickname' =>
$this->group->nickname)), $this->group->nickname)),

View File

@ -154,7 +154,7 @@ class NewmessageAction extends FormAction
sprintf(_('Direct message to %s sent.'), sprintf(_('Direct message to %s sent.'),
$this->other->nickname)); $this->other->nickname));
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('outbox', $url = common_local_url('outbox',
array('nickname' => $this->scoped->nickname)); array('nickname' => $this->scoped->nickname));
@ -182,7 +182,7 @@ class NewmessageAction extends FormAction
$this->elementStart('body'); $this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg); $this->element('p', array('id' => 'error'), $msg);
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
function showForm($msg = null) function showForm($msg = null)

View File

@ -217,7 +217,7 @@ class NewnoticeAction extends FormAction
$this->elementStart('body'); $this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg); $this->element('p', array('id' => 'error'), $msg);
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
/** /**
@ -242,7 +242,7 @@ class NewnoticeAction extends FormAction
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
/** /**

View File

@ -101,7 +101,7 @@ class NudgeAction extends Action
// TRANS: Confirmation text after sending a nudge. // TRANS: Confirmation text after sending a nudge.
$this->element('p', array('id' => 'nudge_response'), _('Nudge sent!')); $this->element('p', array('id' => 'nudge_response'), _('Nudge sent!'));
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
// display a confirmation to the user // display a confirmation to the user
common_redirect(common_local_url('showstream', common_redirect(common_local_url('showstream',

View File

@ -141,7 +141,7 @@ class PluginEnableAction extends Action
$form = $this->successNextForm(); $form = $this->successNextForm();
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('pluginsadminpanel'); $url = common_local_url('pluginsadminpanel');
common_redirect($url, 303); common_redirect($url, 303);

View File

@ -151,7 +151,7 @@ class ProfilecompletionAction extends Action
} }
} }
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
function getResults() function getResults()

View File

@ -158,7 +158,7 @@ class RemovepeopletagAction extends Action
$unsubscribe = new TagButton($this, $this->tagged, $this->peopletag); $unsubscribe = new TagButton($this, $this->tagged, $this->peopletag);
$unsubscribe->show(); $unsubscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('subscriptions', $url = common_local_url('subscriptions',
array('nickname' => $this->user->nickname)); array('nickname' => $this->user->nickname));

View File

@ -107,7 +107,7 @@ class RepeatAction extends Action
// TRANS: Confirmation text after repeating a notice. // TRANS: Confirmation text after repeating a notice.
_('Repeated!')); _('Repeated!'));
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
// @todo FIXME! // @todo FIXME!
} }

View File

@ -144,7 +144,7 @@ class SubscribeAction extends Action
} }
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('subscriptions', $url = common_local_url('subscriptions',
array('nickname' => $this->user->nickname)); array('nickname' => $this->user->nickname));

View File

@ -140,7 +140,7 @@ class SubscribepeopletagAction extends Action
$lf = new UnsubscribePeopletagForm($this, $this->peopletag); $lf = new UnsubscribePeopletagForm($this, $this->peopletag);
$lf->show(); $lf->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('peopletagsubscribers', common_redirect(common_local_url('peopletagsubscribers',
array('tagger' => $this->tagger->nickname, array('tagger' => $this->tagger->nickname,

View File

@ -94,7 +94,7 @@ class TagprofileAction extends Action
$this->elementStart('body'); $this->elementStart('body');
$this->element('p', 'error', $error); $this->element('p', 'error', $error);
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$this->showPage(); $this->showPage();
} }
@ -238,7 +238,7 @@ class TagprofileAction extends Action
} }
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
// TRANS: Success message if lists are saved. // TRANS: Success message if lists are saved.
$this->error = _('Lists saved.'); $this->error = _('Lists saved.');

View File

@ -102,7 +102,7 @@ class UnsubscribeAction extends Action
$subscribe = new SubscribeForm($this, $other); $subscribe = new SubscribeForm($this, $other);
$subscribe->show(); $subscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('subscriptions', common_redirect(common_local_url('subscriptions',
array('nickname' => $this->scoped->nickname)), array('nickname' => $this->scoped->nickname)),

View File

@ -133,7 +133,7 @@ class UnsubscribepeopletagAction extends Action
$lf = new SubscribePeopletagForm($this, $this->peopletag); $lf = new SubscribePeopletagForm($this, $this->peopletag);
$lf->show(); $lf->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
if (common_get_returnto()) { if (common_get_returnto()) {
common_redirect(common_get_returnto(), 303); common_redirect(common_get_returnto(), 303);

View File

@ -119,6 +119,6 @@ class ErrorAction extends InfoAction
$this->elementStart('body'); $this->elementStart('body');
$this->element('p', array('id' => 'error'), $this->message); $this->element('p', array('id' => 'error'), $this->message);
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
} }

View File

@ -147,7 +147,7 @@ class TrainAction extends Action
$this->elementStart('body'); $this->elementStart('body');
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect(common_local_url('spam'), 303); common_redirect(common_local_url('spam'), 303);
} }

View File

@ -94,7 +94,7 @@ class AnonDisfavorAction extends RedirectingAction
$favor = new AnonFavorForm($this, $notice); $favor = new AnonFavorForm($this, $notice);
$favor->show(); $favor->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$this->returnToPrevious(); $this->returnToPrevious();
} }

View File

@ -89,7 +89,7 @@ class AnonFavorAction extends RedirectingAction
$disfavor = new AnonDisFavorForm($this, $notice); $disfavor = new AnonDisFavorForm($this, $notice);
$disfavor->show(); $disfavor->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$this->returnToPrevious(); $this->returnToPrevious();
} }

View File

@ -115,7 +115,7 @@ class BookmarkforurlAction extends Action
$bf = new BookmarkForm($this, $this->title, $this->url, null, null, $this->thumbnail); $bf = new BookmarkForm($this, $this->title, $this->url, null, null, $this->thumbnail);
$bf->show(); $bf->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
/** /**

View File

@ -149,7 +149,7 @@ class NewgroupmessageAction extends Action
sprintf(_m('Direct message to %s sent.'), sprintf(_m('Direct message to %s sent.'),
$this->group->nickname)); $this->group->nickname));
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
common_redirect($gm->url, 303); common_redirect($gm->url, 303);
} }

View File

@ -226,7 +226,7 @@ class QnanewanswerAction extends Action
$this->elementStart('body'); $this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg); $this->element('p', array('id' => 'error'), $msg);
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
/** /**
@ -252,7 +252,7 @@ class QnanewanswerAction extends Action
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
/** /**

View File

@ -139,7 +139,7 @@ class SearchsubAction extends Action
$unsubscribe = new SearchUnsubForm($this, $this->search); $unsubscribe = new SearchUnsubForm($this, $this->search);
$unsubscribe->show(); $unsubscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('search', $url = common_local_url('search',
array('search' => $this->search)); array('search' => $this->search));

View File

@ -79,7 +79,7 @@ class SearchunsubAction extends SearchsubAction
$subscribe = new SearchSubForm($this, $this->search); $subscribe = new SearchSubForm($this, $this->search);
$subscribe->show(); $subscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('search', $url = common_local_url('search',
array('search' => $this->search)); array('search' => $this->search));

View File

@ -167,7 +167,7 @@ abstract class BaseMirrorAction extends Action
$unsubscribe = new EditMirrorForm($this, $this->profile); $unsubscribe = new EditMirrorForm($this, $this->profile);
$unsubscribe->show(); $unsubscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('mirrorsettings'); $url = common_local_url('mirrorsettings');
common_redirect($url, 303); common_redirect($url, 303);

View File

@ -126,8 +126,7 @@ class MirrorSettingsAction extends SettingsAction
function handle($args) function handle($args)
{ {
if ($this->boolean('ajax')) { if ($this->boolean('ajax')) {
header('Content-Type: text/html;charset=utf-8'); $this->startHTML('text/xml;charset=utf-8');
$this->elementStart('html');
$this->elementStart('head'); $this->elementStart('head');
// TRANS: Title for page with form to add a mirror feed provider on. // TRANS: Title for page with form to add a mirror feed provider on.
$this->element('title', null, _m('Provider add')); $this->element('title', null, _m('Provider add'));
@ -137,7 +136,7 @@ class MirrorSettingsAction extends SettingsAction
$this->showAddFeedForm(); $this->showAddFeedForm();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
return parent::handle($args); return parent::handle($args);
} }

View File

@ -139,7 +139,7 @@ class TagsubAction extends Action
$unsubscribe = new TagUnsubForm($this, $this->tag); $unsubscribe = new TagUnsubForm($this, $this->tag);
$unsubscribe->show(); $unsubscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('tag', $url = common_local_url('tag',
array('tag' => $this->tag)); array('tag' => $this->tag));

View File

@ -79,7 +79,7 @@ class TagunsubAction extends TagsubAction
$subscribe = new TagSubForm($this, $this->tag); $subscribe = new TagSubForm($this, $this->tag);
$subscribe->show(); $subscribe->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} else { } else {
$url = common_local_url('tag', $url = common_local_url('tag',
array('tag' => $this->tag)); array('tag' => $this->tag));

View File

@ -142,7 +142,7 @@ class YammeradminpanelAction extends AdminPanelAction
$this->elementStart('body'); $this->elementStart('body');
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
/** /**

View File

@ -72,6 +72,6 @@ class YammerauthAction extends AdminPanelAction
$this->elementStart('body'); $this->elementStart('body');
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
} }