From: Duck (Jakob Munih) Date: Sun, 8 Mar 2009 11:37:48 +0000 (+0100) Subject: Add getImageUrl in API to get user picture url X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=143c1dbe50eedd77a0e879e261b285bed0d2f9d4;p=horde.git Add getImageUrl in API to get user picture url --- diff --git a/folks/lib/api.php b/folks/lib/api.php index ce5c99c8e..e88187e40 100644 --- a/folks/lib/api.php +++ b/folks/lib/api.php @@ -106,6 +106,13 @@ $_services['addUser'] = array( 'args' => array('userId' => 'string') ); +$_services['getImageUrl'] = array( + 'args' => array('user' => 'string', + 'view' => 'string', + 'full' => 'boolean'), + 'type' => 'string' +); + if (Auth::isAdmin()) { $_services['userList'] = array( 'type' => '{urn:horde}stringArray' @@ -117,6 +124,22 @@ if (Auth::isAdmin()) { } /** + * Returns profile image URL. + * + * @param string $user User uid + * @param string $view The view ('small', 'big') to show. + * @param boolean $full Return a path that includes the server name? + * + * @return string The image path. + */ +function _folks_getImageUrl($user, $view = 'small', $full = false) +{ + require_once dirname(__FILE__) . '/base.php'; + + return Folks::getImageUrl($user, $view, $full); +} + +/** * Callback for comment API. * * @param int $id Internal data identifier.