diff --git a/api/anon_lavatar.php b/api/anon_lavatar.php index 5904359ec4..89f817342d 100644 --- a/api/anon_lavatar.php +++ b/api/anon_lavatar.php @@ -34,7 +34,7 @@ function send_image() header('Content-type: image/jpeg'); header('Etag: '.md5(json_encode($params))); - if (($image = Api\avatar::lavatar($params)) !== false) + if (($image = Api\Contacts\Lavatar::generate($params)) !== false) { echo $image; } @@ -43,4 +43,4 @@ function send_image() http_response_code(404); } exit; -} +} \ No newline at end of file diff --git a/api/src/Contacts.php b/api/src/Contacts.php index 683bee170f..f6e543092b 100755 --- a/api/src/Contacts.php +++ b/api/src/Contacts.php @@ -2732,7 +2732,7 @@ class Contacts extends Contacts\Storage if(is_array($contact)) { header('Content-type: image/jpeg'); - $contact['jpegphoto'] = \EGroupware\Api\avatar::lavatar(array( + $contact['jpegphoto'] = Contacts\Lavatar::generate(array( 'id' => $contact['id'], 'firstname' => $contact['n_given'], 'lastname' => $contact['n_family']) diff --git a/api/src/avatar.php b/api/src/Contacts/Lavatar.php similarity index 95% rename from api/src/avatar.php rename to api/src/Contacts/Lavatar.php index 72d3a10db2..e7e6b39c06 100644 --- a/api/src/avatar.php +++ b/api/src/Contacts/Lavatar.php @@ -7,19 +7,18 @@ * @package api * @subpackage avatar * @author Hadi Nategh - * @version $Id$ */ -namespace EGroupware\Api; +namespace EGroupware\Api\Contacts; /** * Creating letter avatar * - * lavatar class designed for creating avatar image from given + * Lavatar class designed for creating avatar image from given * user firstname.lastname and outputs them as in image consist of * first letter of the firstname plus first letter of the lastname. */ -class avatar +class Lavatar { // background colors private static $BG_COLORS = array( @@ -67,7 +66,7 @@ class avatar * ) * @param int $_size = 128 image size, default size is 128 */ - public static function lavatar ($_content = null, $_color = null, $_size = 128) + public static function generate($_content = null, $_color = null, $_size = 128) { // firstname $firstname = isset($_content['firstname'])? $_content['firstname'] : ''; @@ -137,4 +136,4 @@ class avatar $index = $hash % count(self::$BG_COLORS); return self::$BG_COLORS[$index]; } -} +} \ No newline at end of file