$format is used by every API action. Set it in the base class.

This commit is contained in:
Zach Copley 2009-10-09 14:42:01 -07:00
parent bb08611def
commit f746993c2b
18 changed files with 3 additions and 49 deletions

View File

@ -46,8 +46,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php';
class ApiAccountRateLimitStatusAction extends ApiBareAuthAction
{
var $format = null;
/**
* Take arguments for running
*
@ -67,7 +65,6 @@ class ApiAccountRateLimitStatusAction extends ApiBareAuthAction
}
}
$this->format = $this->arg('format');
return true;
}

View File

@ -47,8 +47,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
class ApiAccountVerifyCredentialsAction extends ApiAuthAction
{
var $format = null;
/**
* Take arguments for running
*
@ -68,7 +66,6 @@ class ApiAccountVerifyCredentialsAction extends ApiAuthAction
}
}
$this->format = $this->arg('format');
return true;
}

View File

@ -47,7 +47,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
class ApiBlockCreateAction extends ApiAuthAction
{
var $format = null;
var $user = null;
var $other = null;
@ -72,7 +71,6 @@ class ApiBlockCreateAction extends ApiAuthAction
$this->user = $this->auth_user;
$this->other = $this->getTargetUser($this->arg('id'));
$this->format = $this->arg('format');
return true;
}

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
class ApiBlockDestroyAction extends ApiAuthAction
{
var $format = null;
var $user = null;
var $other = null;
@ -71,7 +70,6 @@ class ApiBlockDestroyAction extends ApiAuthAction
$this->user = $this->auth_user;
$this->other = $this->getTargetUser($this->arg('id'));
$this->format = $this->arg('format');
return true;
}

View File

@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
class ApiDirectMessageAction extends ApiAuthAction
{
var $format = null;
var $messages = null;
var $page = null;
var $count = null;
@ -122,8 +121,6 @@ class ApiDirectMessageAction extends ApiAuthAction
$this->id = "tag:$taguribase:DirectMessages:" . $this->user->id;
}
$this->format = $this->arg('format');
$this->messages = $this->getMessages();
return true;

View File

@ -46,7 +46,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
class ApiDirectMessageNewAction extends ApiAuthAction
{
var $format = null;
var $source = null;
var $user = null;
var $other = null;
@ -97,8 +96,6 @@ class ApiDirectMessageNewAction extends ApiAuthAction
$this->other = $this->getTargetUser($user_param);
}
$this->format = $this->arg('format');
return true;
}

View File

@ -46,8 +46,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
class ApiFavoriteCreateAction extends ApiAuthAction
{
var $format = null;
var $user = null;
var $notice = null;
@ -70,7 +68,6 @@ class ApiFavoriteCreateAction extends ApiAuthAction
}
}
$this->format = $this->arg('format');
$this->user = $this->auth_user;
$this->notice = Notice::staticGet($this->arg('id'));

View File

@ -47,9 +47,9 @@ require_once INSTALLDIR.'/lib/apiauth.php';
class ApiFavoriteDestroyAction extends ApiAuthAction
{
var $format = null;
var $user = null;
var $notice = null;
/**
* Take arguments for running
*
@ -69,7 +69,6 @@ class ApiFavoriteDestroyAction extends ApiAuthAction
}
}
$this->format = $this->arg('format');
$this->user = $this->auth_user;
$this->notice = Notice::staticGet($this->arg('id'));

View File

@ -47,8 +47,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
class ApiFriendshipsCreateAction extends ApiAuthAction
{
var $format = null;
var $user = null;
var $other = null;
@ -71,7 +69,6 @@ class ApiFriendshipsCreateAction extends ApiAuthAction
}
}
$this->format = $this->arg('format');
$this->user = $this->auth_user;
$this->other = $this->getTargetUser($id);

View File

@ -47,8 +47,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
class ApiFriendshipsDestroyAction extends ApiAuthAction
{
var $format = null;
var $user = null;
var $other = null;
@ -71,7 +69,6 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
}
}
$this->format = $this->arg('format');
$this->user = $this->auth_user;
$this->other = $this->getTargetUser($id);

View File

@ -46,8 +46,6 @@ require_once INSTALLDIR.'/lib/api.php';
class ApiFriendshipsExistsAction extends TwitterApiAction
{
var $format = null;
var $user_a = null;
var $user_b = null;
@ -64,8 +62,6 @@ class ApiFriendshipsExistsAction extends TwitterApiAction
{
parent::prepare($args);
$this->format = $this->arg('format');
$user_a_id = $this->trimmed('user_a');
$user_b_id = $this->trimmed('user_b');

View File

@ -45,8 +45,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php';
class ApiFriendshipsShowAction extends ApiBareAuthAction
{
var $format = null;
var $user = null;
var $source = null;
var $target = null;
@ -70,8 +68,6 @@ class ApiFriendshipsShowAction extends ApiBareAuthAction
}
}
$this->format = $this->arg('format');
$source_id = (int)$this->trimmed('source_id');
$source_screen_name = $this->trimmed('source_screen_name');
$target_id = (int)$this->trimmed('target_id');

View File

@ -45,7 +45,6 @@ require_once INSTALLDIR.'/lib/api.php';
class ApiGroupShowAction extends TwitterApiAction
{
var $format = null;
var $group = null;
/**
@ -61,7 +60,6 @@ class ApiGroupShowAction extends TwitterApiAction
{
parent::prepare($args);
$this->format = $this->arg('format');
$this->group = $this->getTargetGroup($this->arg('id'));
return true;

View File

@ -45,7 +45,6 @@ require_once INSTALLDIR . '/lib/api.php';
class ApiHelpTestAction extends TwitterApiAction
{
var $format = null;
/**
* Take arguments for running
@ -59,7 +58,6 @@ class ApiHelpTestAction extends TwitterApiAction
function prepare($args)
{
parent::prepare($args);
$this->format = $this->arg('format');
return true;
}

View File

@ -49,8 +49,6 @@ require_once INSTALLDIR . '/lib/api.php';
class ApiStatusnetConfigAction extends TwitterApiAction
{
var $format = null;
var $keys = array(
'site' => array('name', 'server', 'theme', 'path', 'fancy', 'language',
'email', 'broughtby', 'broughtbyurl', 'closed',
@ -73,7 +71,6 @@ class ApiStatusnetConfigAction extends TwitterApiAction
function prepare($args)
{
parent::prepare($args);
$this->format = $this->arg('format');
return true;
}

View File

@ -48,8 +48,6 @@ require_once INSTALLDIR . '/lib/api.php';
class ApiStatusnetVersionAction extends TwitterApiAction
{
var $format = null;
/**
* Take arguments for running
*
@ -62,7 +60,6 @@ class ApiStatusnetVersionAction extends TwitterApiAction
function prepare($args)
{
parent::prepare($args);
$this->format = $this->arg('format');
return true;
}

View File

@ -46,8 +46,6 @@ require_once INSTALLDIR.'/lib/api.php';
class ApiUserShowAction extends TwitterApiAction
{
var $format = null;
var $user = null;
/**
@ -63,8 +61,6 @@ class ApiUserShowAction extends TwitterApiAction
{
parent::prepare($args);
$this->format = $this->arg('format');
$email = $this->arg('email');
// XXX: email field deprecated in Twitter's API

View File

@ -43,6 +43,7 @@ if (!defined('STATUSNET')) {
class ApiAction extends Action
{
var $format = null;
/**
* Initialization.
@ -55,6 +56,7 @@ class ApiAction extends Action
function prepare($args)
{
parent::prepare($args);
$this->format = $this->arg('format');
return true;
}