summaryrefslogtreecommitdiff
path: root/app/Helper
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-26 14:43:41 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-26 14:43:41 -0400
commit820c929ab38273c80d0930e2e6140dd7676ba4df (patch)
tree3944047e41d14077f7e5e8c0d50856b360a22567 /app/Helper
parente71f37238c82f01cd02d6d7343b42328d9603d14 (diff)
Added avatar image upload
Diffstat (limited to 'app/Helper')
-rw-r--r--app/Helper/AvatarHelper.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/app/Helper/AvatarHelper.php b/app/Helper/AvatarHelper.php
index c4e27ed9..a36d9b4a 100644
--- a/app/Helper/AvatarHelper.php
+++ b/app/Helper/AvatarHelper.php
@@ -20,16 +20,17 @@ class AvatarHelper extends Base
* @param string $username
* @param string $name
* @param string $email
+ * @param string $avatar_path
* @param string $css
* @param int $size
* @return string
*/
- public function render($user_id, $username, $name, $email, $css = 'avatar-left', $size = 48)
+ public function render($user_id, $username, $name, $email, $avatar_path, $css = 'avatar-left', $size = 48)
{
if (empty($user_id) && empty($username)) {
$html = $this->avatarManager->renderDefault($size);
} else {
- $html = $this->avatarManager->render($user_id, $username, $name, $email, $size);
+ $html = $this->avatarManager->render($user_id, $username, $name, $email, $avatar_path, $size);
}
return '<div class="avatar avatar-'.$size.' '.$css.'">'.$html.'</div>';
@@ -39,26 +40,29 @@ class AvatarHelper extends Base
* Render small user avatar
*
* @access public
- * @param string $user_id
- * @param string $username
- * @param string $name
- * @param string $email
+ * @param string $user_id
+ * @param string $username
+ * @param string $name
+ * @param string $email
+ * @param string $avatar_path
+ * @param string $css
* @return string
*/
- public function small($user_id, $username, $name, $email, $css = '')
+ public function small($user_id, $username, $name, $email, $avatar_path, $css = '')
{
- return $this->render($user_id, $username, $name, $email, $css, 20);
+ return $this->render($user_id, $username, $name, $email, $avatar_path, $css, 20);
}
/**
* Get a small avatar for the current user
*
* @access public
+ * @param string $css
* @return string
*/
public function currentUserSmall($css = '')
{
$user = $this->userSession->getAll();
- return $this->small($user['id'], $user['username'], $user['name'], $user['email'], $css);
+ return $this->small($user['id'], $user['username'], $user['name'], $user['email'], $user['avatar_path'], $css);
}
}