From 820c929ab38273c80d0930e2e6140dd7676ba4df Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 26 Mar 2016 14:43:41 -0400 Subject: Added avatar image upload --- app/User/Avatar/AvatarFileProvider.php | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 app/User/Avatar/AvatarFileProvider.php (limited to 'app/User/Avatar/AvatarFileProvider.php') diff --git a/app/User/Avatar/AvatarFileProvider.php b/app/User/Avatar/AvatarFileProvider.php new file mode 100644 index 00000000..87a42c07 --- /dev/null +++ b/app/User/Avatar/AvatarFileProvider.php @@ -0,0 +1,42 @@ +helper->url->href('AvatarFile', 'show', array('user_id' => $user['id'], 'size' => $size)); + $title = $this->helper->text->e($user['name'] ?: $user['username']); + return '' . $title . ''; + } + + /** + * Determine if the provider is active + * + * @access public + * @param array $user + * @return boolean + */ + public function isActive(array $user) + { + return !empty($user['avatar_path']); + } +} -- cgit v1.2.3