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';
32 $this->
setTitle($lng->txt(
"users_online"));
66 if ($ilCtrl->getCmdClass() ==
"ilpublicuserprofilegui")
71 switch($ilCtrl->getCmd())
73 case "showUserProfile":
90 $next_class = $ilCtrl->getNextClass();
91 $cmd = $ilCtrl->getCmd(
"getHTML");
96 case "ilpublicuserprofilegui":
97 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
99 $profile_gui->setBackUrl($ilCtrl->getParentReturn($this));
100 return $ilCtrl->forwardCommand($profile_gui);
104 return $this->
$cmd();
112 $this->users_online_pref = $ilUser->getPref(
"show_users_online");
114 if ($this->users_online_pref !=
"y" && $this->users_online_pref !=
"associated")
138 if ($this->users_online_pref ==
"associated")
147 $this->num_users = 0;
150 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
153 $this->users[$ilUser->getId()] =
154 array(
"user_id" => $ilUser->getId(),
155 "firstname" => $ilUser->getFirstname(),
156 "lastname" => $ilUser->getLastname(),
157 "title" => $ilUser->getUTitle(),
158 "login" => $ilUser->getLogin());
161 foreach ($this->users as $user_id => $user)
163 if ($user_id != ANONYMOUS_USER_ID)
169 $this->visitors = $user[
"num"];
183 include_once(
"Services/Notes/classes/class.ilNote.php");
187 $this->
setRowTemplate(
"tpl.users_online_row.html",
"Services/PersonalDesktop");
212 $this->mail_allowed = ($ilUser->getId() != ANONYMOUS_USER_ID &&
215 foreach ($this->users as $user_id => $user)
219 "login" => $user[
"login"]
225 if (count(
$data) == 0)
229 $this->enabledetailrow =
false;
242 $a_set[
"mail_to"] =
"";
243 if($this->mail_allowed &&
246 $a_set[
'mail_url'] =
ilMailFormCall::getLinkTarget($this->topGuiObj,
'', array(), array(
'type' =>
'new',
'rcp_to' => urlencode($a_set[
'login'])));
250 $a_set[
"profile"] = in_array(
257 if ($a_set[
"mail_url"] !=
"")
259 $this->tpl->setCurrentBlock(
"mailto_link");
260 $this->tpl->setVariable(
"TXT_MAIL", $lng->txt(
"mail"));
261 $this->tpl->setVariable(
"MAIL_URL", $a_set[
"mail_url"]);
262 $this->tpl->parseCurrentBlock();
265 $chatSettings =
new ilSetting(
'chatroom');
266 if($chatSettings->get(
'chat_enabled'))
276 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
277 if($a_set[
"id"] == $ilUser->getId() &&
281 $this->tpl->setCurrentBlock(
'chat_link');
282 $this->tpl->setVariable(
'TXT_CHAT_INVITE', $lng->txt(
'chat_enter_public_room'));
283 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_enter_public_room_tooltip'));
286 $this->tpl->parseCurrentBlock();
291 $this->tpl->setCurrentBlock(
"usr_image");
292 $this->tpl->setVariable(
"USR_IMAGE",
294 $this->tpl->setVariable(
"USR_ALT", $lng->txt(
"personal_picture"));
295 $this->tpl->parseCurrentBlock();
296 $this->tpl->touchBlock(
"usr_image_space");
299 $osi_server = $pd_set->get(
"osi_host");
305 $im_arr = array(
"icq" => 0,
315 if (trim($osi_server) !=
"")
323 foreach ($im_arr as $im_name => $im_check)
332 $im_url =
"http://http://www.icq.com/people/".$im_id;
336 $im_url =
"http://edit.yahoo.com/config/send_webmesg?target=".$im_id.
"&src=pg";
340 $im_url =
"http://messenger.live.com";
345 $im_url =
"http://aimexpress.aim.com";
349 $im_url =
"skype:".$im_id.
"?call";
357 $this->tpl->setCurrentBlock(
"im_link_start");
358 $this->tpl->setVariable(
"URL_IM",$im_url);
359 $this->tpl->parseCurrentBlock();
360 $this->tpl->touchBlock(
"im_link_end");
363 $this->tpl->setCurrentBlock(
"instant_messengers");
364 $this->tpl->setVariable(
"IMG_IM_ICON", $im_img);
365 $this->tpl->setVariable(
"TXT_IM_ICON", $lng->txt(
"im_".$im_name));
366 $icon_id =
"im_".$im_name.
"_usr_".$a_set[
"id"];
367 $this->tpl->setVariable(
"ICON_ID", $icon_id);
369 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
371 "top center",
"bottom center");
373 $this->tpl->parseCurrentBlock();
380 if(!$a_set[
"profile"])
382 $this->tpl->setVariable(
"USR_LOGIN", $a_set[
"login"]);
386 $this->tpl->setVariable(
"USR_LOGIN",
"<br />".$a_set[
"login"]);
390 $this->tpl->setVariable(
"USR_LOGIN",
" [".$a_set[
"login"].
"]");
394 if ($a_set[
"profile"])
396 include_once
"Services/User/classes/class.ilUserUtil.php";
399 $this->tpl->setCurrentBlock(
"profile_link");
400 $this->tpl->setVariable(
"TXT_VIEW", $lng->txt(
"profile"));
402 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
403 $this->tpl->setVariable(
"LINK_PROFILE",
404 $ilCtrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML"));
406 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
407 $this->tpl->setVariable(
"LINK_FULLNAME", $user_name);
408 $this->tpl->parseCurrentBlock();
412 $this->tpl->setVariable(
"USR_FULLNAME",
"");
424 if (empty($this->visitors) || $this->users_online_pref ==
"associated")
428 elseif ($this->visitors ==
"1")
430 $visitor_text =
"1 ".$lng->txt(
"visitor");
434 $visitor_text = $visitors.
" ".$lng->txt(
"visitors");
438 if ($this->num_users > 0)
440 $user_kind = ($this->users_online_pref ==
"associated") ?
"associated_user" :
"registered_user";
441 if ($this->num_users == 1)
443 $user_list = $this->num_users.
" ".$lng->txt($user_kind);
448 $user_list = $this->num_users.
" ".$lng->txt($user_kind.
"s");
451 if (!empty($visitor_text))
453 $user_list .=
" ".$lng->txt(
"and").
" ".$visitor_text;
458 $user_list = $visitor_text;
461 return '<div class="small">'.$user_list.
"</div>";
466 global $rbacsystem,
$lng;
491 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
493 if($a_usr_id == $ilUser->getId())
503 $this->tpl->setCurrentBlock(
"chat_link");
504 $this->tpl->setVariable(
"TXT_CHAT_INVITE",$lng->txt(
'chat_invite_public_room'));
507 $this->tpl->setVariable(
"CHAT_LINK",
'./ilias.php?baseClass=ilRepositoryGUI&ref_id='.
ilObjChatroom::_getPublicRefId().
'&usr_id='.$a_usr_id.
'&cmd=view-invitePD');
508 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_invite_public_room_tooltip'));
509 $this->tpl->parseCurrentBlock();