4 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
30 $this->
setTitle($lng->txt(
"users_online"));
61 switch($ilCtrl->getCmd())
63 case "showUserProfile":
80 $next_class = $ilCtrl->getNextClass();
81 $cmd = $ilCtrl->getCmd(
"getHTML");
86 case "ilpublicuserprofilegui":
87 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
89 $return = $ilCtrl->forwardCommand($profile_gui);
101 $this->users_online_pref = $ilUser->getPref(
"show_users_online");
103 if ($this->users_online_pref !=
"y" && $this->users_online_pref !=
"associated")
127 if ($this->users_online_pref ==
"associated")
136 $this->num_users = 0;
139 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
142 $this->users[$ilUser->getId()] =
143 array(
"user_id" => $ilUser->getId(),
144 "firstname" => $ilUser->getFirstname(),
145 "lastname" => $ilUser->getLastname(),
146 "title" => $ilUser->getUTitle(),
147 "login" => $ilUser->getLogin());
150 foreach ($this->users as $user_id =>
$user)
152 if ($user_id != ANONYMOUS_USER_ID)
158 $this->visitors =
$user[
"num"];
172 include_once(
"Services/Notes/classes/class.ilNote.php");
176 $this->
setRowTemplate(
"tpl.users_online_row.html",
"Services/PersonalDesktop");
201 $mail =
new ilMail($ilUser->getId());
203 $this->mail_allowed = (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID
204 && $rbacsystem->checkAccess(
'mail_visible',$this->mail_settings_id));
206 foreach ($this->users as $user_id =>
$user)
210 "login" =>
$user[
"login"]
216 if (count(
$data) == 0)
220 $this->enabledetailrow =
false;
233 $a_set[
"mail_to"] =
"";
234 if($this->mail_allowed &&
235 $rbacsystem->checkAccessOfUser($a_set[
"id"],
'mail_visible',$this->mail_settings_id))
241 #$mail_to = urlencode($mail_to);
242 $a_set[
"mail_to"] = $a_set[
'login'];
246 $a_set[
"profile"] = in_array(
253 if ($a_set[
"mail_to"] !=
"")
255 $this->tpl->setCurrentBlock(
"mailto_link");
256 $this->tpl->setVariable(
"TXT_MAIL", $lng->txt(
"mail"));
257 $this->tpl->setVariable(
"MAIL_USR_LOGIN", urlencode($a_set[
"mail_to"]));
258 $this->tpl->parseCurrentBlock();
261 include_once
'./Modules/Chat/classes/class.ilChatServerConfig.php';
272 include_once
'./Modules/Chat/classes/class.ilObjChat.php';
273 if($a_set[
"id"] == $ilUser->getId() &&
276 $this->tpl->setCurrentBlock(
'chat_link');
277 $this->tpl->setVariable(
'TXT_CHAT_INVITE', $lng->txt(
'chat_enter_public_room'));
278 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_enter_public_room_tooltip'));
280 $this->tpl->parseCurrentBlock();
285 $this->tpl->setCurrentBlock(
"usr_image");
286 $this->tpl->setVariable(
"USR_IMAGE",
288 $this->tpl->setVariable(
"USR_ALT", $lng->txt(
"personal_picture"));
289 $this->tpl->parseCurrentBlock();
292 $osi_server = $pd_set->get(
"osi_host");
298 $im_arr = array(
"icq" => 1,
308 if (trim($osi_server) !=
"")
313 foreach ($im_arr as $im_name => $im_check)
321 $im_url =
"http://people.icq.com/people/about_me.php?uin=".$im_id;
323 $im_img =
"http://wwp.icq.com/scripts/online.dll?icq=".$im_id.
"&img=5";
327 $im_url =
"http://edit.yahoo.com/config/send_webmesg?.target=".$im_id.
"&.src=pg";
328 $im_img =
"http://opi.yahoo.com/online?u=".$im_id.
"&m=g&t=5";
332 $im_url =
"http://messenger.live.com";
339 $im_url =
"http://aimexpress.aim.com";
345 $im_url =
"skype:".$im_id.
"?call";
352 $im_img =
"http://mystatus.skype.com/smallicon/".$im_id;
356 $this->tpl->setCurrentBlock(
"instant_messengers");
360 $this->tpl->setVariable(
"URL_IM",$osi_server.
"/message/".$im_name.
"/".$im_id);
361 $this->tpl->setVariable(
"IMG_IM_ICON",$osi_server.
"/".$im_name.
"/".$im_id);
365 $this->tpl->setVariable(
"URL_IM",$im_url);
366 $this->tpl->setVariable(
"IMG_IM_ICON", $im_check ? $im_img :
ilUtil::getImagePath($im_name.
'offline.gif'));
369 $this->tpl->setVariable(
"TXT_IM_ICON", $lng->txt(
"im_".$im_name));
370 $this->tpl->parseCurrentBlock();
379 $this->tpl->setVariable(
"USR_LOGIN",
"<br />".$a_set[
"login"]);
383 $this->tpl->setVariable(
"USR_LOGIN",
" [".$a_set[
"login"].
"]");
387 if ($a_set[
"profile"])
389 $this->tpl->setCurrentBlock(
"profile_link");
390 $this->tpl->setVariable(
"TXT_VIEW", $lng->txt(
"profile"));
391 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
392 $this->tpl->setVariable(
"LINK_PROFILE",
393 $ilCtrl->getLinkTarget($this,
"showUserProfile"));
394 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
395 $this->tpl->setVariable(
"LINK_FULLNAME", ilObjUser::_lookupFullName($a_set[
"id"]));
396 $this->tpl->parseCurrentBlock();
400 $this->tpl->setVariable(
"USR_FULLNAME", ilObjUser::_lookupFullName($a_set[
"id"]));
412 if (empty($this->visitors) || $this->users_online_pref ==
"associated")
416 elseif ($this->visitors ==
"1")
418 $visitor_text =
"1 ".$lng->txt(
"visitor");
422 $visitor_text = $visitors.
" ".$lng->txt(
"visitors");
426 if ($this->num_users > 0)
428 $user_kind = ($this->users_online_pref ==
"associated") ?
"associated_user" :
"registered_user";
429 if ($this->num_users == 1)
431 $user_list = $this->num_users.
" ".$lng->txt($user_kind);
436 $user_list = $this->num_users.
" ".$lng->txt($user_kind.
"s");
439 if (!empty($visitor_text))
441 $user_list .=
" ".$lng->txt(
"and").
" ".$visitor_text;
446 $user_list = $visitor_text;
449 return '<div class="small">'.$user_list.
"</div>";
454 global $rbacsystem,
$lng;
457 include_once
'./Modules/Chat/classes/class.ilChatRoom.php';
462 if($rbacsystem->checkAccess(
'read',$ref_id))
464 $this->tpl->setCurrentBlock(
"chat_info");
465 $this->tpl->setVariable(
"CHAT_ACTIVE_IN",$lng->txt(
'chat_active_in'));
466 $this->tpl->setVariable(
"CHAT_LINK",
"./ilias.php?baseClass=ilChatPresentationGUI&ref_id=".$ref_id.
"&room_id=0");
468 $this->tpl->parseCurrentBlock();
478 global $rbacsystem,$ilUser,
$lng;
480 include_once
'./Modules/Chat/classes/class.ilObjChat.php';
482 if($a_usr_id == $ilUser->getId())
490 $this->tpl->setCurrentBlock(
"chat_link");
491 $this->tpl->setVariable(
"TXT_CHAT_INVITE",$lng->txt(
'chat_invite_public_room'));
493 '&usr_id='.$a_usr_id.
'&cmd=invitePD');
494 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_invite_public_room_tooltip'));
495 $this->tpl->parseCurrentBlock();
511 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
514 $profile_gui->setBackUrl($ilCtrl->getParentReturn($this));
525 return $ilCtrl->getHTML($profile_gui);