Remove more redundant $formats
This commit is contained in:
parent
931e19073d
commit
559918826a
|
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
|
|||
|
||||
class ApiGroupIsMemberAction extends ApiBareAuthAction
|
||||
{
|
||||
var $format = null;
|
||||
var $user = null;
|
||||
var $group = null;
|
||||
|
||||
|
@ -64,7 +63,6 @@ class ApiGroupIsMemberAction extends ApiBareAuthAction
|
|||
|
||||
$this->user = $this->getTargetUser(null);
|
||||
$this->group = $this->getTargetGroup(null);
|
||||
$this->format = $this->arg('format');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
|
|||
|
||||
class ApiGroupJoinAction extends ApiAuthAction
|
||||
{
|
||||
var $format = null;
|
||||
var $user = null;
|
||||
var $group = null;
|
||||
|
||||
|
@ -65,8 +64,6 @@ class ApiGroupJoinAction extends ApiAuthAction
|
|||
$this->user = $this->auth_user;
|
||||
$this->group = $this->getTargetGroup($this->arg('id'));
|
||||
|
||||
$this->format = $this->arg('format');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
|
|||
|
||||
class ApiGroupLeaveAction extends ApiAuthAction
|
||||
{
|
||||
var $format = null;
|
||||
var $user = null;
|
||||
var $group = null;
|
||||
|
||||
|
@ -65,8 +64,6 @@ class ApiGroupLeaveAction extends ApiAuthAction
|
|||
$this->user = $this->auth_user;
|
||||
$this->group = $this->getTargetGroup($this->arg('id'));
|
||||
|
||||
$this->format = $this->arg('format');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
|
|||
|
||||
class ApiGroupListAction extends ApiBareAuthAction
|
||||
{
|
||||
var $format = null;
|
||||
var $user = null;
|
||||
var $page = null;
|
||||
var $count = null;
|
||||
|
@ -74,7 +73,6 @@ class ApiGroupListAction extends ApiBareAuthAction
|
|||
$this->since = $this->arg('since');
|
||||
|
||||
$this->user = $this->getTargetUser($id);
|
||||
$this->format = $this->arg('format');
|
||||
$this->groups = $this->getGroups();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/lib/api.php';
|
|||
|
||||
class ApiGroupListAllAction extends TwitterApiAction
|
||||
{
|
||||
var $format = null;
|
||||
var $page = null;
|
||||
var $count = null;
|
||||
var $max_id = null;
|
||||
|
@ -73,7 +72,6 @@ class ApiGroupListAllAction extends TwitterApiAction
|
|||
$this->since = $this->arg('since');
|
||||
|
||||
$this->user = $this->getTargetUser($id);
|
||||
$this->format = $this->arg('format');
|
||||
$this->groups = $this->getGroups();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/lib/api.php';
|
|||
|
||||
class ApiGroupMembershipAction extends TwitterApiAction
|
||||
{
|
||||
var $format = null;
|
||||
var $page = null;
|
||||
var $count = null;
|
||||
var $max_id = null;
|
||||
|
@ -73,7 +72,6 @@ class ApiGroupMembershipAction extends TwitterApiAction
|
|||
$this->since_id = (int)$this->arg('since_id', 0);
|
||||
$this->since = $this->arg('since');
|
||||
|
||||
$this->format = $this->arg('format');
|
||||
$this->group = $this->getTargetGroup($this->arg('id'));
|
||||
|
||||
$this->profiles = $this->getProfiles();
|
||||
|
|
|
@ -48,7 +48,6 @@ class ApiStatusesDestroyAction extends ApiAuthAction
|
|||
|
||||
var $user = null;
|
||||
var $status = null;
|
||||
var $format = null;
|
||||
|
||||
/**
|
||||
* Take arguments for running
|
||||
|
@ -70,7 +69,6 @@ class ApiStatusesDestroyAction extends ApiAuthAction
|
|||
$this->notice_id = (int)$this->arg('id');
|
||||
}
|
||||
|
||||
$this->format = $this->arg('format');
|
||||
$this->notice = Notice::staticGet((int)$this->notice_id);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -48,7 +48,6 @@ class ApiStatusesShowAction extends ApiAction
|
|||
|
||||
var $notice_id = null;
|
||||
var $notice = null;
|
||||
var $format = null;
|
||||
|
||||
/**
|
||||
* Take arguments for running
|
||||
|
@ -74,7 +73,6 @@ class ApiStatusesShowAction extends ApiAction
|
|||
$this->notice_id = (int)$this->arg('id');
|
||||
}
|
||||
|
||||
$this->format = $this->arg('format');
|
||||
$this->notice = Notice::staticGet((int)$this->notice_id);
|
||||
|
||||
return true;
|
||||
|
|
|
@ -50,7 +50,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction
|
|||
var $source = null;
|
||||
var $status = null;
|
||||
var $in_reply_to_status_id = null;
|
||||
var $format = null;
|
||||
|
||||
static $reserved_sources = array('web', 'omb', 'mail', 'xmpp', 'api');
|
||||
|
||||
|
@ -92,8 +91,6 @@ class ApiStatusesUpdateAction extends ApiAuthAction
|
|||
$this->source = 'api';
|
||||
}
|
||||
|
||||
$this->format = $this->arg('format');
|
||||
|
||||
$this->in_reply_to_status_id
|
||||
= intval($this->trimmed('in_reply_to_status_id'));
|
||||
|
||||
|
|
|
@ -52,7 +52,6 @@ class ApiSubscriptionsAction extends ApiBareAuthAction
|
|||
var $count = null;
|
||||
var $user = null;
|
||||
var $profiles = null;
|
||||
var $format = null;
|
||||
var $tag = null;
|
||||
var $lite = null;
|
||||
var $ids_only = null;
|
||||
|
@ -72,7 +71,6 @@ class ApiSubscriptionsAction extends ApiBareAuthAction
|
|||
|
||||
$this->page = (int)$this->arg('page', 1);
|
||||
$this->tag = $this->arg('tag');
|
||||
$this->format = $this->arg('format');
|
||||
|
||||
// Note: Twitter no longer supports 'lite'
|
||||
$this->lite = $this->arg('lite');
|
||||
|
|
|
@ -49,7 +49,6 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
|
|||
|
||||
var $user = null;
|
||||
var $notices = null;
|
||||
var $format = null;
|
||||
var $page = null;
|
||||
var $count = null;
|
||||
var $max_id = null;
|
||||
|
@ -74,7 +73,6 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
|
|||
$this->max_id = (int)$this->arg('max_id', 0);
|
||||
$this->since_id = (int)$this->arg('since_id', 0);
|
||||
$this->since = $this->arg('since');
|
||||
$this->format = $this->arg('format');
|
||||
|
||||
$this->user = $this->getTargetUser($this->arg('id'));
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
|
|||
var $max_id = null;
|
||||
var $since_id = null;
|
||||
var $since = null;
|
||||
var $format = null;
|
||||
|
||||
/**
|
||||
* Take arguments for running
|
||||
|
@ -73,7 +72,6 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
|
|||
$this->max_id = (int)$this->arg('max_id', 0);
|
||||
$this->since_id = (int)$this->arg('since_id', 0);
|
||||
$this->since = $this->arg('since');
|
||||
$this->format = $this->arg('format');
|
||||
|
||||
$this->user = $this->getTargetUser($this->arg('id'));
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ class ApiTimelineGroupAction extends ApiAction
|
|||
|
||||
$this->group = $this->getTargetGroup($this->arg('id'));
|
||||
|
||||
$this->format = $this->arg('format');
|
||||
$this->notices = $this->getNotices();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -71,7 +71,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
|
|||
$this->user = $this->getTargetUser($this->arg('id'));
|
||||
|
||||
if (empty($this->user)) {
|
||||
$this->clientError(_('No such user!'), 404, $this->arg('format'));
|
||||
$this->clientError(_('No such user!'), 404, $this->format);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
|
|||
$sitename, $this->user->nickname, $profile->getBestName()
|
||||
);
|
||||
|
||||
switch($this->arg('format')) {
|
||||
switch($this->format) {
|
||||
case 'xml':
|
||||
$this->show_xml_timeline($this->notices);
|
||||
break;
|
||||
|
|
|
@ -103,7 +103,7 @@ class ApiTimelinePublicAction extends ApiAction
|
|||
$link = common_root_url();
|
||||
$subtitle = sprintf(_("%s updates from everyone!"), $sitename);
|
||||
|
||||
switch($this->arg('format')) {
|
||||
switch($this->format) {
|
||||
case 'xml':
|
||||
$this->show_xml_timeline($this->notices);
|
||||
break;
|
||||
|
|
|
@ -64,7 +64,6 @@ class ApiTimelineTagAction extends ApiAction
|
|||
$this->page = (int)$this->arg('page', 1);
|
||||
$this->count = (int)$this->arg('count', 20);
|
||||
$this->tag = $this->arg('tag');
|
||||
$this->format = $this->arg('format');
|
||||
|
||||
$this->notices = $this->getNotices();
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
|
|||
$this->user = $this->getTargetUser($this->arg('id'));
|
||||
|
||||
if (empty($this->user)) {
|
||||
$this->clientError(_('No such user!'), 404, $this->arg('format'));
|
||||
$this->clientError(_('No such user!'), 404, $this->format);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ class ApiTimelineUserAction extends ApiBareAuthAction
|
|||
$suplink = common_local_url('sup', null, null, $this->user->id);
|
||||
header('X-SUP-ID: ' . $suplink);
|
||||
|
||||
switch($this->arg('format')) {
|
||||
switch($this->format) {
|
||||
case 'xml':
|
||||
$this->show_xml_timeline($this->notices);
|
||||
break;
|
||||
|
|
|
@ -172,7 +172,7 @@ class ApiAuthAction extends ApiAction
|
|||
header('HTTP/1.1 401 Unauthorized');
|
||||
$msg = 'Could not authenticate you.';
|
||||
|
||||
if ($this->arg('format') == 'xml') {
|
||||
if ($this->format == 'xml') {
|
||||
header('Content-Type: application/xml; charset=utf-8');
|
||||
$this->startXML();
|
||||
$this->elementStart('hash');
|
||||
|
@ -180,7 +180,7 @@ class ApiAuthAction extends ApiAction
|
|||
$this->element('request', null, $_SERVER['REQUEST_URI']);
|
||||
$this->elementEnd('hash');
|
||||
$this->endXML();
|
||||
} elseif ($this->arg('format') == 'json') {
|
||||
} elseif ($this->format == 'json') {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
$error_array = array('error' => $msg,
|
||||
'request' => $_SERVER['REQUEST_URI']);
|
||||
|
|
Loading…
Reference in New Issue
Block a user