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