We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 64df40e4 authored by mattl's avatar mattl

Filling in missing endHTML calls for Action AJAX

This completes 1c6f9df8 where a lot
of other functions were fixed (by conforming to startHTML and endHTML)
parent f7719b57
...@@ -156,7 +156,7 @@ class AddpeopletagAction extends Action ...@@ -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));
......
...@@ -184,7 +184,7 @@ class ApprovegroupAction extends Action ...@@ -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)),
......
...@@ -136,7 +136,7 @@ class ApprovesubAction extends Action ...@@ -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)),
......
...@@ -162,7 +162,7 @@ class CancelgroupAction extends Action ...@@ -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)),
......
...@@ -114,7 +114,7 @@ class CancelsubscriptionAction extends Action ...@@ -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)),
......
...@@ -162,7 +162,7 @@ class DeletegroupAction extends RedirectingAction ...@@ -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
......
...@@ -84,7 +84,7 @@ class DisfavorAction extends FormAction ...@@ -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;
} }
} }
......
...@@ -85,7 +85,7 @@ class FavorAction extends FormAction ...@@ -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',
......
...@@ -163,7 +163,7 @@ class JoingroupAction extends Action ...@@ -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)),
......
...@@ -145,7 +145,7 @@ class LeavegroupAction extends Action ...@@ -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)),
......
...@@ -154,7 +154,7 @@ class NewmessageAction extends FormAction ...@@ -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 ...@@ -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)
......
...@@ -217,7 +217,7 @@ class NewnoticeAction extends FormAction ...@@ -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 ...@@ -242,7 +242,7 @@ class NewnoticeAction extends FormAction
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
/** /**
......
...@@ -101,7 +101,7 @@ class NudgeAction extends Action ...@@ -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',
......
...@@ -141,7 +141,7 @@ class PluginEnableAction extends Action ...@@ -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);
......
...@@ -151,7 +151,7 @@ class ProfilecompletionAction extends Action ...@@ -151,7 +151,7 @@ class ProfilecompletionAction extends Action
} }
} }
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
function getResults() function getResults()
......
...@@ -158,7 +158,7 @@ class RemovepeopletagAction extends Action ...@@ -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));
......
...@@ -107,7 +107,7 @@ class RepeatAction extends Action ...@@ -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!
} }
......
...@@ -144,7 +144,7 @@ class SubscribeAction extends Action ...@@ -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));
......
...@@ -140,7 +140,7 @@ class SubscribepeopletagAction extends Action ...@@ -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,
......
...@@ -94,7 +94,7 @@ class TagprofileAction extends Action ...@@ -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 ...@@ -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.');
......
...@@ -102,7 +102,7 @@ class UnsubscribeAction extends Action ...@@ -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)),
......
...@@ -133,7 +133,7 @@ class UnsubscribepeopletagAction extends Action ...@@ -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);
......
...@@ -119,6 +119,6 @@ class ErrorAction extends InfoAction ...@@ -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();
} }
} }
...@@ -147,7 +147,7 @@ class TrainAction extends Action ...@@ -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);
} }
......
...@@ -94,7 +94,7 @@ class AnonDisfavorAction extends RedirectingAction ...@@ -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();
} }
......
...@@ -89,7 +89,7 @@ class AnonFavorAction extends RedirectingAction ...@@ -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();
} }
......
...@@ -115,7 +115,7 @@ class BookmarkforurlAction extends Action ...@@ -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();
} }
/** /**
......
...@@ -149,7 +149,7 @@ class NewgroupmessageAction extends Action ...@@ -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);
} }
......
...@@ -226,7 +226,7 @@ class QnanewanswerAction extends Action ...@@ -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 ...@@ -252,7 +252,7 @@ class QnanewanswerAction extends Action
$form->show(); $form->show();
$this->elementEnd('body'); $this->elementEnd('body');
$this->elementEnd('html'); $this->endHTML();
} }
/** /**
......
...@@ -139,7 +139,7 @@ class SearchsubAction extends Action ...@@ -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));
......
...@@ -79,7 +79,7 @@ class SearchunsubAction extends SearchsubAction ...@@ -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));
......
...@@ -167,7 +167,7 @@ abstract class BaseMirrorAction extends Action ...@@ -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);
......
...@@ -126,8 +126,7 @@ class MirrorSettingsAction extends SettingsAction ...@@ -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 ...@@ -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);
} }
......
...@@ -139,7 +139,7 @@ class TagsubAction extends Action ...@@ -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));
......
...@@ -79,7 +79,7 @@ class TagunsubAction extends TagsubAction ...@@ -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));
......
...@@ -142,7 +142,7 @@ class YammeradminpanelAction extends AdminPanelAction ...@@ -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();
} }
/** /**
......
...@@ -72,6 +72,6 @@ class YammerauthAction extends AdminPanelAction ...@@ -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();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment