* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ApiAccountUpdateProfileColorsAction extends ApiAuthAction
{
-
var $profile_background_color = null;
var $profile_text_color = null;
var $profile_link_color = null;
* @param array $args $_REQUEST args
*
* @return boolean success flag
- *
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
$this->clientError(
+ // TRANS: Client error. POST is a HTTP command. It should not be translated.
_('This method requires a POST.'),
400, $this->format
);
if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
$design = $this->user->getDesign();
if (!empty($design)) {
-
$original = clone($design);
try {
if ($result === false) {
common_log_db_error($design, 'UPDATE', __FILE__);
+ // TRANS: Client error displayed when a database error occurs updating profile colours.
$this->clientError(_('Could not update your design.'));
return;
}
-
} else {
-
$this->user->query('BEGIN');
// save new design
if (empty($id)) {
common_log_db_error($id, 'INSERT', __FILE__);
+ // TRANS: Client error displayed when a database error occurs inserting profile colours.
$this->clientError(_('Unable to save your design settings.'));
return;
}
if (empty($result)) {
common_log_db_error($original, 'UPDATE', __FILE__);
+ // TRANS: Client error displayed when a database error occurs updating profile colours.
$this->clientError(_('Unable to save your design settings.'));
$this->user->query('ROLLBACK');
return;
$profile = $this->user->getProfile();
if (empty($profile)) {
+ // TRANS: Client error displayed a user has no profile updating profile colours.
$this->clientError(_('User has no profile.'));
return;
}
if ($this->format == 'xml') {
$this->initDocument('xml');
- $this->showTwitterXmlUser($twitter_user);
+ $this->showTwitterXmlUser($twitter_user, 'user', true);
$this->endDocument('xml');
} elseif ($this->format == 'json') {
$this->initDocument('json');
*
* @return void
*/
-
function setColors($design)
{
$bgcolor = empty($this->profile_background_color) ?
return true;
}
-
}