diff options
author | Evan Prodromou <evan@status.net> | 2009-10-24 19:59:46 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-10-24 19:59:46 -0400 |
commit | 3c724ccd0df0d205a9567e435b6060300537f904 (patch) | |
tree | 4be361f0112444c5c8949a1e486efd1063030681 /lib/api.php | |
parent | 967de946654e96793d11413a46067ac95b356a64 (diff) | |
parent | 6d6de3c1c7b359815aa0381b4cde3fcc8258cc80 (diff) |
Merge branch '0.9.x' into location
Diffstat (limited to 'lib/api.php')
-rw-r--r-- | lib/api.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/api.php b/lib/api.php index 7a63a4a78..9bd2083de 100644 --- a/lib/api.php +++ b/lib/api.php @@ -134,11 +134,19 @@ class ApiAction extends Action $twitter_user['protected'] = false; # not supported by StatusNet yet $twitter_user['followers_count'] = $profile->subscriberCount(); - // To be supported soon... - $twitter_user['profile_background_color'] = ''; - $twitter_user['profile_text_color'] = ''; - $twitter_user['profile_link_color'] = ''; - $twitter_user['profile_sidebar_fill_color'] = ''; + // Need to pull up the user for some of this + $user = $profile->getUser(); + $design = $user->getDesign(); + $defaultDesign = Design::siteDesign(); + 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['friends_count'] = $profile->subscriptionCount(); @@ -147,8 +155,6 @@ class ApiAction extends Action $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'; |