]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Output profile background image info in the API user objects
authorZach Copley <zach@status.net>
Tue, 10 Nov 2009 08:30:56 +0000 (00:30 -0800)
committerZach Copley <zach@status.net>
Tue, 10 Nov 2009 08:30:56 +0000 (00:30 -0800)
lib/api.php

index a1236ab7ec7176e146070edf2407bd60ef64dc67..45762ef0d385175e99aa96be1c42a84e970e43be 100644 (file)
@@ -177,9 +177,14 @@ class ApiAction extends Action
         $twitter_user['utc_offset'] = $t->format('Z');
         $twitter_user['time_zone'] = $timezone;
 
-        // To be supported some day, perhaps
-        $twitter_user['profile_background_image_url'] = '';
-        $twitter_user['profile_background_tile'] = false;
+        $twitter_user['profile_background_image_url']
+            = empty($design->backgroundimage)
+            ? '' : ($design->disposition & BACKGROUND_ON)
+            ? Design::url($design->backgroundimage) : '';
+
+        $twitter_user['profile_background_tile']
+            = empty($design->disposition)
+            ? '' : ($design->disposition & BACKGROUND_TILE) ? 'true' : 'false';
 
         $twitter_user['statuses_count'] = $profile->noticeCount();