Finish client action refactoring. closes flarum/core#126

This commit is contained in:
Toby Zerner
2015-07-07 19:23:13 +09:30
parent 8a54b362c7
commit 38c2ff0306
9 changed files with 518 additions and 170 deletions

View File

@ -1,5 +1,6 @@
<?php namespace Flarum\Core\Users;
use Flarum\Core;
use Flarum\Core\Groups\Group;
use Flarum\Core\Model;
use Flarum\Core\Notifications\Notification;
@ -282,7 +283,21 @@ class User extends Model
*/
public function getAvatarUrlAttribute()
{
return $this->avatar_path ? app('Flarum\Http\UrlGeneratorInterface')->toAsset('assets/avatars/'.$this->avatar_path) : null;
$urlGenerator = app('Flarum\Http\UrlGeneratorInterface');
return $this->avatar_path ? $urlGenerator->toAsset('assets/avatars/'.$this->avatar_path) : null;
}
/**
* Get the user's locale, falling back to the forum's default if they
* haven't set one.
*
* @param string $value
* @return string
*/
public function getLocaleAttribute($value)
{
return $value ?: Core::config('locale', 'en');
}
/**