diff options
Diffstat (limited to 'app/Core')
-rw-r--r-- | app/Core/User/Avatar/AvatarManager.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/Core/User/Avatar/AvatarManager.php b/app/Core/User/Avatar/AvatarManager.php index afaf79d2..71bd8aa5 100644 --- a/app/Core/User/Avatar/AvatarManager.php +++ b/app/Core/User/Avatar/AvatarManager.php @@ -61,4 +61,30 @@ class AvatarManager return ''; } + + /** + * Render default provider for unknown users (first provider registered) + * + * @access public + * @param integer $size + * @return string + */ + public function renderDefault($size) + { + if (count($this->providers) > 0) { + ksort($this->providers); + $provider = current($this->providers); + + $user = array( + 'id' => 0, + 'username' => '', + 'name' => '?', + 'email' => '', + ); + + return $provider->render($user, $size); + } + + return ''; + } } |