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->show();
$this->elementEnd('body');
$this->elementEnd('html');
$this->endHTML();
} else {
$url = common_local_url('subscriptions',
array('nickname' => $this->user->nickname));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -217,7 +217,7 @@ class NewnoticeAction extends FormAction
$this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg);
$this->elementEnd('body');
$this->elementEnd('html');
$this->endHTML();
}
/**
@ -242,7 +242,7 @@ class NewnoticeAction extends FormAction
$form->show();
$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.
$this->element('p', array('id' => 'nudge_response'), _('Nudge sent!'));
$this->elementEnd('body');
$this->elementEnd('html');
$this->endHTML();
} else {
// display a confirmation to the user
common_redirect(common_local_url('showstream',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -89,7 +89,7 @@ class AnonFavorAction extends RedirectingAction
$disfavor = new AnonDisFavorForm($this, $notice);
$disfavor->show();
$this->elementEnd('body');
$this->elementEnd('html');
$this->endHTML();
} else {
$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->show();
$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.'),
$this->group->nickname));
$this->elementEnd('body');
$this->elementEnd('html');
$this->endHTML();
} else {
common_redirect($gm->url, 303);
}

View File

@ -226,7 +226,7 @@ class QnanewanswerAction extends Action
$this->elementStart('body');
$this->element('p', array('id' => 'error'), $msg);
$this->elementEnd('body');
$this->elementEnd('html');
$this->endHTML();
}
/**
@ -252,7 +252,7 @@ class QnanewanswerAction extends Action
$form->show();
$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->show();
$this->elementEnd('body');
$this->elementEnd('html');
$this->endHTML();
} else {
$url = common_local_url('search',
array('search' => $this->search));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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