4include_once(
"Services/Block/classes/class.ilBlockGUI.php");
5require_once
'Services/Mail/classes/class.ilMailFormCall.php';
6include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
28 parent::__construct();
31 $this->
setTitle($lng->txt(
"users_online"));
65 if (
$ilCtrl->getCmdClass() ==
"ilpublicuserprofilegui")
72 case "showUserProfile":
89 $next_class =
$ilCtrl->getNextClass();
95 case "ilpublicuserprofilegui":
96 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
98 $profile_gui->setBackUrl(
$ilCtrl->getParentReturn($this));
99 return $ilCtrl->forwardCommand($profile_gui);
103 return $this->
$cmd();
111 $this->users_online_pref =
$ilUser->getPref(
"show_users_online");
113 if ($this->users_online_pref !=
"y" && $this->users_online_pref !=
"associated")
126 return parent::getHTML();
137 if ($this->users_online_pref ==
"associated")
143 $this->users = ilObjUser::_getUsersOnline(0,
true);
146 $this->num_users = 0;
149 if (
$ilUser->getId() != ANONYMOUS_USER_ID &&
152 $this->users[
$ilUser->getId()] =
153 array(
"user_id" =>
$ilUser->getId(),
154 "firstname" =>
$ilUser->getFirstname(),
155 "lastname" =>
$ilUser->getLastname(),
156 "title" =>
$ilUser->getUTitle(),
157 "login" =>
$ilUser->getLogin());
160 foreach ($this->users as $user_id => $user)
162 if ($user_id != ANONYMOUS_USER_ID)
168 $this->visitors = $user[
"num"];
182 include_once(
"Services/Notes/classes/class.ilNote.php");
186 $this->
setRowTemplate(
"tpl.users_online_row.html",
"Services/PersonalDesktop");
192 parent::fillDataSection();
211 $this->mail_allowed = (
$ilUser->getId() != ANONYMOUS_USER_ID &&
214 foreach ($this->users as $user_id => $user)
218 "login" => $user[
"login"]
224 if (count(
$data) == 0)
228 $this->enabledetailrow =
false;
241 $a_set[
"mail_to"] =
"";
242 if($this->mail_allowed &&
245 $a_set[
'mail_url'] =
ilMailFormCall::getLinkTarget($this->topGuiObj,
'', array(), array(
'type' =>
'new',
'rcp_to' => urlencode($a_set[
'login'])));
249 $a_set[
"profile"] = in_array(
256 if ($a_set[
"mail_url"] !=
"")
258 $this->tpl->setCurrentBlock(
"mailto_link");
259 $this->tpl->setVariable(
"TXT_MAIL",
$lng->txt(
"mail"));
260 $this->tpl->setVariable(
"MAIL_URL", $a_set[
"mail_url"]);
261 $this->tpl->parseCurrentBlock();
264 $chatSettings =
new ilSetting(
'chatroom');
265 if($chatSettings->get(
'chat_enabled'))
275 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
276 if($a_set[
"id"] ==
$ilUser->getId() &&
280 $this->tpl->setCurrentBlock(
'chat_link');
281 $this->tpl->setVariable(
'TXT_CHAT_INVITE',
$lng->txt(
'chat_enter_public_room'));
282 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP',
$lng->txt(
'chat_enter_public_room_tooltip'));
285 $this->tpl->parseCurrentBlock();
290 $this->tpl->setCurrentBlock(
"usr_image");
291 $this->tpl->setVariable(
"USR_IMAGE",
293 $this->tpl->setVariable(
"USR_ALT",
$lng->txt(
"personal_picture"));
294 $this->tpl->parseCurrentBlock();
295 $this->tpl->touchBlock(
"usr_image_space");
299 if(!$a_set[
"profile"])
301 $this->tpl->setVariable(
"USR_LOGIN", $a_set[
"login"]);
305 $this->tpl->setVariable(
"USR_LOGIN",
"<br />".$a_set[
"login"]);
309 $this->tpl->setVariable(
"USR_LOGIN",
" [".$a_set[
"login"].
"]");
313 if ($a_set[
"profile"])
315 include_once
"Services/User/classes/class.ilUserUtil.php";
318 $this->tpl->setCurrentBlock(
"profile_link");
319 $this->tpl->setVariable(
"TXT_VIEW",
$lng->txt(
"profile"));
325 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
331 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
332 $this->tpl->setVariable(
"LINK_PROFILE",
333 $ilCtrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML"));
338 include_once
"Services/Link/classes/class.ilLink.php";
339 $this->tpl->setVariable(
"LINK_PROFILE",
ilLink::_getLink($a_set[
"id"],
"usr"));
340 $this->tpl->setVariable(
"LINK_TARGET",
"_blank");
343 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
344 $this->tpl->setVariable(
"LINK_FULLNAME", $user_name);
345 $this->tpl->parseCurrentBlock();
349 $this->tpl->setVariable(
"USR_FULLNAME",
"");
361 if (empty($this->visitors) || $this->users_online_pref ==
"associated")
365 elseif ($this->visitors ==
"1")
367 $visitor_text =
"1 ".$lng->txt(
"visitor");
371 $visitor_text = $visitors.
" ".
$lng->txt(
"visitors");
375 if ($this->num_users > 0)
377 $user_kind = ($this->users_online_pref ==
"associated") ?
"associated_user" :
"registered_user";
378 if ($this->num_users == 1)
380 $user_list = $this->num_users.
" ".
$lng->txt($user_kind);
385 $user_list = $this->num_users.
" ".
$lng->txt($user_kind.
"s");
388 if (!empty($visitor_text))
390 $user_list .=
" ".$lng->txt(
"and").
" ".$visitor_text;
395 $user_list = $visitor_text;
398 return '<div class="small">'.$user_list.
"</div>";
403 global $rbacsystem,
$lng;
428 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
430 if($a_usr_id ==
$ilUser->getId())
440 $this->tpl->setCurrentBlock(
"chat_link");
441 $this->tpl->setVariable(
"TXT_CHAT_INVITE",
$lng->txt(
'chat_invite_public_room'));
444 $this->tpl->setVariable(
"CHAT_LINK",
'./ilias.php?baseClass=ilRepositoryGUI&ref_id='.
ilObjChatroom::_getPublicRefId().
'&usr_id='.$a_usr_id.
'&cmd=view-invitePD');
445 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP',
$lng->txt(
'chat_invite_public_room_tooltip'));
446 $this->tpl->parseCurrentBlock();
An exception for terminatinating execution or to throw for unit testing.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setLimit($a_limit)
Set Limit.
getCurrentDetailLevel()
Get Current Detail Level.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setData($a_data)
Set Data.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setColSpan($a_colspan)
Set Columns Span.
setTitle($a_title)
Set Title.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
setCurrentDetailLevel($a_currentdetaillevel)
Set Current Detail Level.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
static _lookupPref($a_usr_id, $a_keyword)
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
GUI class for personal desktop.
GUI class for public user profile presentation.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
BlockGUI class for Personal Desktop Users Online block.
getUsers()
Get online users.
getListRowData()
Get list data.
fillDataSection()
Fill data section.
static isRepositoryObject()
Is block used in repository object?
executeCommand()
execute command
static getBlockType()
Get block type.
getOverview()
Get overview.
__showChatInvitation($a_usr_id)
__showActiveChatsOfUser($a_usr_id)
getHTML()
Handle config status.
__construct()
Constructor.
fillRow($a_set)
get flat bookmark list for personal desktop
static getScreenMode()
Get Screen Mode for current command.
static getAssociatedUsersOnline($a_user_id)