Class ilUserAvatarResolver.
More...
◆ __construct()
ilUserAvatarResolver::__construct |
( |
int |
$user_id | ) |
|
constructor.
- Parameters
-
Definition at line 60 of file class.ilUserAvatarResolver.php.
References $DIC, $user_id, init(), and ui().
63 $this->db = $DIC->database();
64 $this->
ui = $DIC->ui()->factory();
66 $this->letter_avatars_activated = (bool) $DIC->settings()->get(
'letter_avatars');
◆ getAvatar()
ilUserAvatarResolver::getAvatar |
( |
| ) |
|
Definition at line 119 of file class.ilUserAvatarResolver.php.
References $DIC, ilObjUser\_lookupLogin(), ilUtil\getImagePath(), ui(), and useUploadedFile().
122 return $this->
ui->symbol()->avatar()->picture($this->uploaded_file, $this->abbreviation);
125 if ($this->letter_avatars_activated ===
false) {
126 return $this->
ui->symbol()->avatar()->picture(
131 return $this->
ui->symbol()->avatar()->letter($this->abbreviation);
static _lookupLogin($a_user_id)
lookup login
This describes how a letter or a picture avatar could be modified during construction of UI...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
◆ init()
ilUserAvatarResolver::init |
( |
| ) |
|
|
private |
Definition at line 70 of file class.ilUserAvatarResolver.php.
References $in, $res, ilUtil\getWebspaceDir(), login(), and ilStr\subStr().
Referenced by __construct().
72 $in = $this->db->in(
'usr_pref.keyword', array(
'public_upload',
'public_profile'),
false,
'text');
73 $res = $this->db->queryF(
75 SELECT usr_pref.*, ud.login, ud.firstname, ud.lastname 76 FROM usr_data ud LEFT JOIN usr_pref ON usr_pref.usr_id = ud.usr_id AND $in 77 WHERE ud.usr_id = %s",
82 while ($row = $this->db->fetchAssoc(
$res)) {
83 $this->
login = $row[
'login'];
84 $this->firstname = $row[
'firstname'];
85 $this->lastname = $row[
'lastname'];
87 switch ($row[
'keyword']) {
89 $this->has_public_upload = $row[
'value'] ===
'y';
91 case 'public_profile':
92 $this->has_public_profile = ($row[
'value'] ===
'y' || $row[
'value'] ===
'g');
99 if (defined(
'ILIAS_MODULE')) {
100 $webspace_dir = (
'.' . $webspace_dir);
104 $image_dir = $webspace_dir .
'/usr_images';
105 $this->uploaded_file = $image_dir .
'/usr_' . $this->user_id .
'.jpg';
107 if ($this->has_public_profile) {
static subStr($a_str, $a_start, $a_length=null)
foreach($_POST as $key=> $value) $res
if(php_sapi_name() !='cli') $in
static getWebspaceDir($mode="filesystem")
get webspace directory
◆ setForcePicture()
ilUserAvatarResolver::setForcePicture |
( |
bool |
$force_image | ) |
|
◆ setSize()
ilUserAvatarResolver::setSize |
( |
string |
$size | ) |
|
◆ useUploadedFile()
ilUserAvatarResolver::useUploadedFile |
( |
| ) |
|
|
private |
◆ $abbreviation
ilUserAvatarResolver::$abbreviation |
|
private |
◆ $firstname
ilUserAvatarResolver::$firstname |
|
private |
◆ $force_image
ilUserAvatarResolver::$force_image = false |
|
private |
◆ $has_public_profile
ilUserAvatarResolver::$has_public_profile = false |
|
private |
◆ $has_public_upload
ilUserAvatarResolver::$has_public_upload = false |
|
private |
◆ $lastname
ilUserAvatarResolver::$lastname |
|
private |
◆ $letter_avatars_activated
ilUserAvatarResolver::$letter_avatars_activated |
|
protected |
◆ $login
ilUserAvatarResolver::$login |
|
private |
◆ $size
ilUserAvatarResolver::$size = 'small' |
|
private |
◆ $uploaded_file
ilUserAvatarResolver::$uploaded_file |
|
private |
◆ $user_id
ilUserAvatarResolver::$user_id |
|
private |
The documentation for this class was generated from the following file: