4 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
5 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
6 include_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $this->
user = $DIC->user();
47 $this->db = $DIC->database();
48 $this->rbacsystem = $DIC->rbac()->system();
49 $lng = $DIC->language();
51 parent::__construct();
68 return self::$block_type;
90 if (
$ilCtrl->getCmdClass() ==
"ilpublicuserprofilegui") {
95 case "showUserProfile":
112 $next_class =
$ilCtrl->getNextClass();
113 $cmd =
$ilCtrl->getCmd(
"getHTML");
115 switch ($next_class) {
117 case "ilpublicuserprofilegui":
118 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
120 $profile_gui->setBackUrl(
$ilCtrl->getParentReturn($this));
121 return $ilCtrl->forwardCommand($profile_gui);
125 return $this->$cmd();
133 $this->users_online_pref =
$ilUser->getPref(
"show_users_online");
135 if ($this->users_online_pref !=
"y" && $this->users_online_pref !=
"associated") {
144 return parent::getHTML();
155 if ($this->users_online_pref ==
"associated") {
158 $this->users = ilObjUser::_getUsersOnline(0,
true);
161 $this->num_users = 0;
164 if (
$ilUser->getId() != ANONYMOUS_USER_ID &&
166 $this->users[
$ilUser->getId()] =
168 "firstname" =>
$ilUser->getFirstname(),
169 "lastname" =>
$ilUser->getLastname(),
170 "title" =>
$ilUser->getUTitle(),
171 "login" =>
$ilUser->getLogin());
174 foreach ($this->users as $user_id =>
$user) {
175 if ($user_id != ANONYMOUS_USER_ID) {
178 $this->visitors =
$user[
"num"];
188 include_once(
"Services/Notes/classes/class.ilNote.php");
191 $this->
setRowTemplate(
"tpl.users_online_row.html",
"Services/PersonalDesktop");
196 parent::fillDataSection();
214 $this->mail_allowed = (
$ilUser->getId() != ANONYMOUS_USER_ID &&
217 foreach ($this->users as $user_id =>
$user) {
220 "login" =>
$user[
"login"]
226 if (count(
$data) == 0) {
229 $this->enabledetailrow =
false;
246 $a_set[
"mail_to"] =
"";
247 if ($this->mail_allowed &&
253 $a_set[
"profile"] = in_array(
260 if ($a_set[
"mail_url"] !=
"") {
261 $this->tpl->setCurrentBlock(
"mailto_link");
262 $this->tpl->setVariable(
"TXT_MAIL",
$lng->txt(
"mail"));
263 $this->tpl->setVariable(
"MAIL_URL", $a_set[
"mail_url"]);
264 $this->tpl->parseCurrentBlock();
267 $chatSettings =
new ilSetting(
'chatroom');
268 if ($chatSettings->get(
'chat_enabled')) {
274 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
275 if ($a_set[
"id"] ==
$ilUser->getId() &&
277 $this->tpl->setCurrentBlock(
'chat_link');
278 $this->tpl->setVariable(
'TXT_CHAT_INVITE',
$lng->txt(
'chat_enter_public_room'));
279 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP',
$lng->txt(
'chat_enter_public_room_tooltip'));
281 $this->tpl->parseCurrentBlock();
286 $this->tpl->setCurrentBlock(
"usr_image");
287 $this->tpl->setVariable(
289 ilObjUser::_getPersonalPicturePath($a_set[
"id"],
"xxsmall")
291 $this->tpl->setVariable(
"USR_ALT",
$lng->txt(
"personal_picture"));
292 $this->tpl->parseCurrentBlock();
293 $this->tpl->touchBlock(
"usr_image_space");
297 if (!$a_set[
"profile"]) {
298 $this->tpl->setVariable(
"USR_LOGIN", $a_set[
"login"]);
300 $this->tpl->setVariable(
"USR_LOGIN",
"<br />" . $a_set[
"login"]);
302 $this->tpl->setVariable(
"USR_LOGIN",
" [" . $a_set[
"login"] .
"]");
306 if ($a_set[
"profile"]) {
307 include_once
"Services/User/classes/class.ilUserUtil.php";
310 $this->tpl->setCurrentBlock(
"profile_link");
311 $this->tpl->setVariable(
"TXT_VIEW",
$lng->txt(
"profile"));
316 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
321 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
322 $this->tpl->setVariable(
324 $ilCtrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML")
328 include_once
"Services/Link/classes/class.ilLink.php";
329 $this->tpl->setVariable(
"LINK_PROFILE",
ilLink::_getLink($a_set[
"id"],
"usr"));
330 $this->tpl->setVariable(
"LINK_TARGET",
"_blank");
333 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
334 $this->tpl->setVariable(
"LINK_FULLNAME", $user_name);
335 $this->tpl->parseCurrentBlock();
337 $this->tpl->setVariable(
"USR_FULLNAME",
"");
349 if (empty($this->visitors) || $this->users_online_pref ==
"associated") {
351 } elseif ($this->visitors ==
"1") {
352 $visitor_text =
"1 " .
$lng->txt(
"visitor");
354 $visitor_text = $visitors .
" " .
$lng->txt(
"visitors");
358 if ($this->num_users > 0) {
359 $user_kind = ($this->users_online_pref ==
"associated") ?
"associated_user" :
"registered_user";
360 if ($this->num_users == 1) {
361 $user_list = $this->num_users .
" " .
$lng->txt($user_kind);
363 $user_list = $this->num_users .
" " .
$lng->txt($user_kind .
"s");
366 if (!empty($visitor_text)) {
367 $user_list .=
" " .
$lng->txt(
"and") .
" " . $visitor_text;
370 $user_list = $visitor_text;
373 return '<div class="small">' . $user_list .
"</div>";
387 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
389 if ($a_usr_id ==
$ilUser->getId()) {
395 $this->tpl->setCurrentBlock(
"chat_link");
396 $this->tpl->setVariable(
"TXT_CHAT_INVITE",
$lng->txt(
'chat_invite_public_room'));
397 $this->tpl->setVariable(
"CHAT_LINK",
'./ilias.php?baseClass=ilRepositoryGUI&ref_id=' .
ilObjChatroom::_getPublicRefId() .
'&usr_id=' . $a_usr_id .
'&cmd=view-invitePD');
398 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP',
$lng->txt(
'chat_invite_public_room_tooltip'));
399 $this->tpl->parseCurrentBlock();
__construct()
Constructor.
static getScreenMode()
Get Screen Mode for current command.
BlockGUI class for Personal Desktop Users Online block.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
getOverview()
Get overview.
__showChatInvitation($a_usr_id)
__showActiveChatsOfUser($a_usr_id)
setColSpan($a_colspan)
Set Columns Span.
GUI class for public user profile presentation.
static getAssociatedUsersOnline($a_user_id)
reads all active sessions from db and returns users that are online and who have a local role in a gr...
setTitle($a_title)
Set Title.
setData($a_data)
Set Data.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
getUsers()
Get online users.
static isRepositoryObject()
Is block used in repository object?
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, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static getBlockType()
Get block type.
Create styles array
The data for the language used.
fillDataSection()
Fill data section.
setLimit($a_limit)
Set Limit.
getListRowData()
Get list data.
setCurrentDetailLevel($a_currentdetaillevel)
Set Current Detail Level.
static _lookupPref($a_usr_id, $a_keyword)
executeCommand()
execute command
GUI class for personal desktop.
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.
This class represents a block method of a block.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
fillRow($a_set)
get flat bookmark list for personal desktop
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
getCurrentDetailLevel()
Get Current Detail Level.