Merge commit 'refs/merge-requests/1815' of git://gitorious.org/statusnet/mainline into 0.9.x

This commit is contained in:
Craig Andrews 2009-10-23 11:15:25 -04:00
commit c93b9b9523
2 changed files with 18 additions and 7 deletions

View File

@ -46,6 +46,11 @@ class Profile extends Memcached_DataObject
/* the code above is auto generated do not remove the tag below */ /* the code above is auto generated do not remove the tag below */
###END_AUTOCODE ###END_AUTOCODE
function getUser()
{
return User::staticGet('id', $this->id);
}
function getAvatar($width, $height=null) function getAvatar($width, $height=null)
{ {
if (is_null($height)) { if (is_null($height)) {

View File

@ -134,11 +134,19 @@ class ApiAction extends Action
$twitter_user['protected'] = false; # not supported by StatusNet yet $twitter_user['protected'] = false; # not supported by StatusNet yet
$twitter_user['followers_count'] = $profile->subscriberCount(); $twitter_user['followers_count'] = $profile->subscriberCount();
// To be supported soon... // Need to pull up the user for some of this
$twitter_user['profile_background_color'] = ''; $user = $profile->getUser();
$twitter_user['profile_text_color'] = ''; $design = $user->getDesign();
$twitter_user['profile_link_color'] = ''; $defaultDesign = Design::siteDesign();
$twitter_user['profile_sidebar_fill_color'] = ''; if (!$design) $design = $defaultDesign;
$color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor);
$twitter_user['profile_background_color'] = ($color == null) ? '' : '#'.$color->hexValue();
$color = Design::toWebColor(empty($design->textcolor) ? $defaultDesign->textcolor : $design->textcolor);
$twitter_user['profile_text_color'] = ($color == null) ? '' : '#'.$color->hexValue();
$color = Design::toWebColor(empty($design->linkcolor) ? $defaultDesign->linkcolor : $design->linkcolor);
$twitter_user['profile_link_color'] = ($color == null) ? '' : '#'.$color->hexValue();
$color = Design::toWebColor(empty($design->sidebarcolor) ? $defaultDesign->sidebarcolor : $design->sidebarcolor);
$twitter_user['profile_sidebar_fill_color'] = ($color == null) ? '' : '#'.$color->hexValue();
$twitter_user['profile_sidebar_border_color'] = ''; $twitter_user['profile_sidebar_border_color'] = '';
$twitter_user['friends_count'] = $profile->subscriptionCount(); $twitter_user['friends_count'] = $profile->subscriptionCount();
@ -147,8 +155,6 @@ class ApiAction extends Action
$twitter_user['favourites_count'] = $profile->faveCount(); // British spelling! $twitter_user['favourites_count'] = $profile->faveCount(); // British spelling!
// Need to pull up the user for some of this
$user = User::staticGet($profile->id);
$timezone = 'UTC'; $timezone = 'UTC';