24 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
50 $this->
setTitle($lng->txt(
"users_online"));
81 switch($ilCtrl->getCmd())
83 case "showUserProfile":
100 $next_class = $ilCtrl->getNextClass();
101 $cmd = $ilCtrl->getCmd(
"getHTML");
106 case "ilpublicuserprofilegui":
107 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
109 $return = $ilCtrl->forwardCommand($profile_gui);
113 return $this->
$cmd();
121 $this->users_online_pref = $ilUser->getPref(
"show_users_online");
123 if ($this->users_online_pref !=
"y" && $this->users_online_pref !=
"associated")
147 if ($this->users_online_pref ==
"associated")
156 $this->num_users = 0;
158 $this->users[$ilUser->getId()] =
159 array(
"user_id" => $ilUser->getId(),
160 "firstname" => $ilUser->getFirstname(),
161 "lastname" => $ilUser->getLastname(),
162 "title" => $ilUser->getUTitle(),
163 "login" => $ilUser->getLogin());
165 foreach ($this->users as $user_id =>
$user)
167 if ($user_id != ANONYMOUS_USER_ID)
173 $this->visitors =
$user[
"num"];
187 include_once(
"Services/Notes/classes/class.ilNote.php");
191 $this->
setRowTemplate(
"tpl.users_online_row.html",
"Services/PersonalDesktop");
216 $mail =
new ilMail($ilUser->getId());
219 foreach ($this->users as $user_id =>
$user)
221 if ($user_id != ANONYMOUS_USER_ID &&
229 if (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID)
232 if($rbacsystem->checkAccess(
'mail_visible',$mail_settings_id) and
233 $rbacsystem->checkAccessOfUser($user_id,
'mail_visible',$mail_settings_id))
239 #$mail_to = urlencode($mail_to);
240 $mail_to =
$user[
'login'];
246 $q =
"SELECT value FROM usr_pref WHERE usr_id = ".
247 $ilDB->quote($user_id).
" AND keyword='public_profile' AND value='y'";
248 $r = $ilDB->query($q);
256 "mail_to" => $mail_to,
258 "profile" => $profile,
259 "login" =>
$user[
"login"]
267 if (count(
$data) == 0)
271 $this->enabledetailrow =
false;
288 if ($a_set[
"mail_to"] !=
"")
290 $this->tpl->setCurrentBlock(
"mailto_link");
291 $this->tpl->setVariable(
"TXT_MAIL", $lng->txt(
"mail"));
292 $this->tpl->setVariable(
"MAIL_USR_LOGIN", urlencode($a_set[
"mail_to"]));
293 $this->tpl->parseCurrentBlock();
296 include_once
'./Modules/Chat/classes/class.ilChatServerConfig.php';
307 include_once
'./Modules/Chat/classes/class.ilObjChat.php';
308 if($user_obj->getId() == $ilUser->getId() &&
311 $this->tpl->setCurrentBlock(
'chat_link');
312 $this->tpl->setVariable(
'TXT_CHAT_INVITE', $lng->txt(
'chat_enter_public_room'));
313 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_enter_public_room_tooltip'));
315 $this->tpl->parseCurrentBlock();
320 $this->tpl->setCurrentBlock(
"usr_image");
321 $this->tpl->setVariable(
"USR_IMAGE",
322 $user_obj->getPersonalPicturePath(
"xxsmall"));
323 $this->tpl->setVariable(
"USR_ALT", $lng->txt(
"personal_picture"));
324 $this->tpl->parseCurrentBlock();
327 $osi_server = $pd_set->get(
"osi_host");
329 if (trim($osi_server) !=
"")
333 $im_arr = array(
"icq" => 1,
343 foreach ($im_arr as $im_name => $im_check)
345 if ($im_id = $user_obj->getInstantMessengerId($im_name))
351 $im_url =
"http://people.icq.com/people/about_me.php?uin=".$im_id;
352 $im_img =
"http://status.icq.com/online.gif?icq=".$im_id.
"&img=5";
356 $im_url =
"http://edit.yahoo.com/config/send_webmesg?.target=".$im_id.
"&.src=pg";
357 $im_img =
"http://opi.yahoo.com/online?u=".$im_id.
"&m=g&t=5";
361 $im_url =
"http://messenger.live.com";
368 $im_url =
"http://aimexpress.aim.com";
374 $im_url =
"skype:".$im_id.
"?call";
381 $im_img =
"http://mystatus.skype.com/smallicon/".$im_id;
385 $this->tpl->setCurrentBlock(
"instant_messengers");
389 $this->tpl->setVariable(
"URL_IM",$osi_server.
"/message/".$im_name.
"/".$im_id);
390 $this->tpl->setVariable(
"IMG_IM_ICON",$osi_server.
"/".$im_name.
"/".$im_id);
394 $this->tpl->setVariable(
"URL_IM",$im_url);
395 $this->tpl->setVariable(
"IMG_IM_ICON", $im_check ? $im_img :
ilUtil::getImagePath($im_name.
'offline.gif'));
398 $this->tpl->setVariable(
"TXT_IM_ICON", $lng->txt(
"im_".$im_name));
399 $this->tpl->parseCurrentBlock();
408 $this->tpl->setVariable(
"USR_LOGIN",
"<br />".$a_set[
"login"]);
412 $this->tpl->setVariable(
"USR_LOGIN",
" [".$a_set[
"login"].
"]");
416 if ($a_set[
"profile"])
418 $this->tpl->setCurrentBlock(
"profile_link");
419 $this->tpl->setVariable(
"TXT_VIEW", $lng->txt(
"profile"));
420 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
421 $this->tpl->setVariable(
"LINK_PROFILE",
422 $ilCtrl->getLinkTarget($this,
"showUserProfile"));
423 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
424 $this->tpl->setVariable(
"LINK_FULLNAME", $user_obj->getFullname());
425 $this->tpl->parseCurrentBlock();
429 $this->tpl->setVariable(
"USR_FULLNAME", $user_obj->getFullname());
441 if (empty($this->visitors) || $this->users_online_pref ==
"associated")
445 elseif ($this->visitors ==
"1")
447 $visitor_text =
"1 ".$lng->txt(
"visitor");
451 $visitor_text = $visitors.
" ".$lng->txt(
"visitors");
455 if ($this->num_users > 0)
457 $user_kind = ($this->users_online_pref ==
"associated") ?
"associated_user" :
"registered_user";
458 if ($this->num_users == 1)
460 $user_list = $this->num_users.
" ".$lng->txt($user_kind);
465 $user_list = $this->num_users.
" ".$lng->txt($user_kind.
"s");
468 if (!empty($visitor_text))
470 $user_list .=
" ".$lng->txt(
"and").
" ".$visitor_text;
475 $user_list = $visitor_text;
478 return '<div class="small">'.$user_list.
"</div>";
483 global $rbacsystem,
$lng;
486 include_once
'./Modules/Chat/classes/class.ilChatRoom.php';
491 if($rbacsystem->checkAccess(
'read',$ref_id))
493 $this->tpl->setCurrentBlock(
"chat_info");
494 $this->tpl->setVariable(
"CHAT_ACTIVE_IN",$lng->txt(
'chat_active_in'));
495 $this->tpl->setVariable(
"CHAT_LINK",
"./ilias.php?baseClass=ilChatPresentationGUI&ref_id=".$ref_id.
"&room_id=0");
497 $this->tpl->parseCurrentBlock();
507 global $rbacsystem,$ilUser,
$lng;
509 include_once
'./Modules/Chat/classes/class.ilObjChat.php';
511 if($a_usr_id == $ilUser->getId())
519 $this->tpl->setCurrentBlock(
"chat_link");
520 $this->tpl->setVariable(
"TXT_CHAT_INVITE",$lng->txt(
'chat_invite_public_room'));
522 '&usr_id='.$a_usr_id.
'&cmd=invitePD');
523 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_invite_public_room_tooltip'));
524 $this->tpl->parseCurrentBlock();
538 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
540 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
542 $profile_gui->setAsRows(
true);
543 $content_block->setContent($ilCtrl->getHTML($profile_gui));
545 $content_block->setTitle($lng->txt(
"profile_of").
" ".
547 $content_block->setColSpan(2);
549 $content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
550 $lng->txt(
"selected_items_back"));
552 return $content_block->getHTML();