4 require_once
'Modules/Forum/classes/class.ilObjForumAccess.php';
5 require_once
'Modules/Forum/classes/class.ilForumAuthorInformationCache.php';
107 $this->globalUser = $DIC->user();
108 $this->globalLng = $DIC->language();
125 if (is_numeric($this->display_id) && $this->display_id > 0) {
128 if (!$this->author) {
134 if (!$this->author) {
136 $this->author->setId(0);
137 $this->author->setPref(
'public_profile',
'n');
138 $this->author->setGender(
'');
163 return !$this->globalUser->isAnonymous();
173 if ($with_profile_link && $this->public_profile_link_attributes) {
176 foreach ($this->public_profile_link_attributes as $attr => $value) {
177 $link .=
' ' . $attr .
'="' . $value .
'"';
186 if ($with_profile_link && $this->public_profile_link_attributes) {
188 $linked_login .=
'</a>';
191 $this->linked_public_name = $link;
192 $this->linked_short_name = $linked_login;
200 include_once
'Modules/Forum/classes/class.ilObjForumAccess.php';
212 && $this->
getAuthor()->getPref(
'public_profile') ==
'y')
213 || $this->
getAuthor()->getPref(
'public_profile') ==
'g')
216 $this->author_name = $this->
getAuthor()->getPublicName();
217 $this->author_short_name = $this->
getAuthor()->getLogin();
219 if ($this->
getAuthor()->getPref(
'public_upload') ==
'y') {
222 $this->profilePicture = $this->getAvatarImageSource(
228 if ($this->
getAuthor()->getPref(
'public_gender') !=
'y') {
235 $this->author_short_name = $this->author_name = $this->
getAuthor()->getLogin();
237 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
242 $this->author_short_name = $this->author_name = $translationLanguage->txt(
'deleted');
243 $this->suffix = $translationLanguage->txt(
'deleted');
245 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
246 } elseif (strlen($this->import_name)) {
248 $this->author_short_name = $this->author_name = $this->import_name .
' (' . $translationLanguage->txt(
'imported') .
')';
249 $this->suffix = $translationLanguage->txt(
'imported');
251 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
252 } elseif (strlen($this->alias)) {
254 $this->author_short_name = $this->author_name = $this->alias .
' (' . $translationLanguage->txt(
'frm_pseudonym') .
')';
255 $this->suffix = $translationLanguage->txt(
'frm_pseudonym');
257 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
260 $this->author_short_name = $this->author_name = $translationLanguage->txt(
'forums_anonymous');
262 $this->profilePicture = $this->getAvatarImageSource($this->author_short_name);
284 protected function getAvatarImageSource(
$name, $usrId = ANONYMOUS_USER_ID)
293 $avatar = $DIC[
"user.avatar.factory"]->avatar(
'xsmall');
294 $avatar->setUsrId($usrId);
297 return $avatar->getUrl();
322 if (!$without_short_name) {
325 return trim(preg_replace(
'/\(' . preg_quote($this->
getAuthorShortName()) .
'\)/',
'', $this->author_name));
358 return strlen($this->suffix);
static getCachedUserInstance($usr_id)
static subStr($a_str, $a_start, $a_length=null)
static hasHTML()
Has HTML output.
getPersonalPicturePath($a_size="small", $a_force_pic=false)
Get path to personal picture.
Create styles array
The data for the language used.