Added pluggable Avatar providers

This commit is contained in:
Frederic Guillot
2016-03-18 23:06:32 -04:00
parent c4c200b530
commit fa86542f90
25 changed files with 216 additions and 42 deletions

View File

@@ -0,0 +1,32 @@
Adding a new Avatar Provider
=============================
Registration
------------
```php
$this->avatarManager->register(new CustomAvatarProvider());
```
Interface
---------
The provider must implements the interface `Kanboard\Core\User\Avatar\AvatarProviderInterface`:
| Method | Description |
|-------------------------------|---------------------------------------------------------------|
| `render(array $user, $size)` | Render HTML |
| `isActive(array $user)` | Returns a boolean if the provider is able to render something |
The `$user` argument is a dictionary that contains these keys:
```php
[
'id' => 123,
'username' => 'admin',
'name' => 'Administrator',
'email' => 'me@localhost',
]
```

View File

@@ -20,9 +20,10 @@ Plugin creators should specify explicitly the compatible versions of Kanboard. I
- [Attach metadata to users, tasks and projects](plugin-metadata.markdown)
- [Authentication architecture](plugin-authentication-architecture.markdown)
- [Authentication plugin registration](plugin-authentication.markdown)
- [Authorization Architecture](plugin-authorization-architecture.markdown)
- [Custom Group Providers](plugin-group-provider.markdown)
- [External Link Providers](plugin-external-link.markdown)
- [Authorization architecture](plugin-authorization-architecture.markdown)
- [Custom group providers](plugin-group-provider.markdown)
- [External link providers](plugin-external-link.markdown)
- [Add avatar providers](plugin-avatar-provider.markdown)
- [LDAP client](plugin-ldap-client.markdown)
Examples of plugins