4 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
5 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
31 $this->
setTitle($lng->txt(
"users_online"));
65 if ($ilCtrl->getCmdClass() ==
"ilpublicuserprofilegui")
70 switch($ilCtrl->getCmd())
72 case "showUserProfile":
89 $next_class = $ilCtrl->getNextClass();
90 $cmd = $ilCtrl->getCmd(
"getHTML");
95 case "ilpublicuserprofilegui":
96 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
98 return $ilCtrl->forwardCommand($profile_gui);
102 return $this->
$cmd();
110 $this->users_online_pref = $ilUser->getPref(
"show_users_online");
112 if ($this->users_online_pref !=
"y" && $this->users_online_pref !=
"associated")
136 if ($this->users_online_pref ==
"associated")
145 $this->num_users = 0;
148 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
151 $this->users[$ilUser->getId()] =
152 array(
"user_id" => $ilUser->getId(),
153 "firstname" => $ilUser->getFirstname(),
154 "lastname" => $ilUser->getLastname(),
155 "title" => $ilUser->getUTitle(),
156 "login" => $ilUser->getLogin());
159 foreach ($this->users as $user_id =>
$user)
161 if ($user_id != ANONYMOUS_USER_ID)
167 $this->visitors =
$user[
"num"];
181 include_once(
"Services/Notes/classes/class.ilNote.php");
185 $this->
setRowTemplate(
"tpl.users_online_row.html",
"Services/PersonalDesktop");
210 $mail =
new ilMail($ilUser->getId());
212 $this->mail_allowed = (
$_SESSION[
"AccountId"] != ANONYMOUS_USER_ID
213 && $rbacsystem->checkAccess(
'mail_visible',$this->mail_settings_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 &&
244 $rbacsystem->checkAccessOfUser($a_set[
"id"],
'mail_visible',$this->mail_settings_id))
250 #$mail_to = urlencode($mail_to);
251 $a_set[
'mail_url'] =
ilMailFormCall::_getLinkTarget($this->topGuiObj,
'', array(), array(
'type' =>
'new',
'rcp_to' => urlencode($a_set[
'login'])));
255 $a_set[
"profile"] = in_array(
262 if ($a_set[
"mail_url"] !=
"")
264 $this->tpl->setCurrentBlock(
"mailto_link");
265 $this->tpl->setVariable(
"TXT_MAIL", $lng->txt(
"mail"));
266 $this->tpl->setVariable(
"MAIL_URL", $a_set[
"mail_url"]);
267 $this->tpl->parseCurrentBlock();
270 include_once
'./Modules/Chat/classes/class.ilChatServerConfig.php';
281 include_once
'./Modules/Chat/classes/class.ilObjChat.php';
282 if($a_set[
"id"] == $ilUser->getId() &&
285 $this->tpl->setCurrentBlock(
'chat_link');
286 $this->tpl->setVariable(
'TXT_CHAT_INVITE', $lng->txt(
'chat_enter_public_room'));
287 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_enter_public_room_tooltip'));
289 $this->tpl->parseCurrentBlock();
294 $this->tpl->setCurrentBlock(
"usr_image");
295 $this->tpl->setVariable(
"USR_IMAGE",
297 $this->tpl->setVariable(
"USR_ALT", $lng->txt(
"personal_picture"));
298 $this->tpl->parseCurrentBlock();
301 $osi_server = $pd_set->get(
"osi_host");
307 $im_arr = array(
"icq" => 0,
317 if (trim($osi_server) !=
"")
322 foreach ($im_arr as $im_name => $im_check)
331 $im_url =
"http://people.icq.com/people/about_me.php?uin=".$im_id;
333 $im_img =
"http://wwp.icq.com/scripts/online.dll?icq=".$im_id.
"&img=5";
337 $im_url =
"http://edit.yahoo.com/config/send_webmesg?.target=".$im_id.
"&.src=pg";
338 $im_img =
"http://opi.yahoo.com/online?u=".$im_id.
"&m=g&t=5";
342 $im_url =
"http://messenger.live.com";
348 $im_url =
"http://aimexpress.aim.com";
354 $im_url =
"skype:".$im_id.
"?call";
361 $im_img =
"http://mystatus.skype.com/smallicon/".$im_id;
365 $this->tpl->setCurrentBlock(
"instant_messengers");
369 $this->tpl->setVariable(
"URL_IM",$osi_server.
"/message/".$im_name.
"/".$im_id);
370 $this->tpl->setVariable(
"IMG_IM_ICON",$osi_server.
"/".$im_name.
"/".$im_id);
374 $this->tpl->setVariable(
"URL_IM",$im_url);
375 $this->tpl->setVariable(
"IMG_IM_ICON", $im_check ? $im_img :
ilUtil::getImagePath($im_name.
'offline.gif'));
378 $this->tpl->setVariable(
"TXT_IM_ICON", $lng->txt(
"im_".$im_name));
379 $this->tpl->parseCurrentBlock();
388 $this->tpl->setVariable(
"USR_LOGIN",
"<br />".$a_set[
"login"]);
392 $this->tpl->setVariable(
"USR_LOGIN",
" [".$a_set[
"login"].
"]");
396 if ($a_set[
"profile"])
398 $this->tpl->setCurrentBlock(
"profile_link");
399 $this->tpl->setVariable(
"TXT_VIEW", $lng->txt(
"profile"));
400 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
401 $this->tpl->setVariable(
"LINK_PROFILE",
402 $ilCtrl->getLinkTarget($this,
"showUserProfile"));
403 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
404 $this->tpl->setVariable(
"LINK_FULLNAME", ilObjUser::_lookupFullName($a_set[
"id"]));
405 $this->tpl->parseCurrentBlock();
409 $this->tpl->setVariable(
"USR_FULLNAME", ilObjUser::_lookupFullName($a_set[
"id"]));
421 if (empty($this->visitors) || $this->users_online_pref ==
"associated")
425 elseif ($this->visitors ==
"1")
427 $visitor_text =
"1 ".$lng->txt(
"visitor");
431 $visitor_text = $visitors.
" ".$lng->txt(
"visitors");
435 if ($this->num_users > 0)
437 $user_kind = ($this->users_online_pref ==
"associated") ?
"associated_user" :
"registered_user";
438 if ($this->num_users == 1)
440 $user_list = $this->num_users.
" ".$lng->txt($user_kind);
445 $user_list = $this->num_users.
" ".$lng->txt($user_kind.
"s");
448 if (!empty($visitor_text))
450 $user_list .=
" ".$lng->txt(
"and").
" ".$visitor_text;
455 $user_list = $visitor_text;
458 return '<div class="small">'.$user_list.
"</div>";
463 global $rbacsystem,
$lng;
466 include_once
'./Modules/Chat/classes/class.ilChatRoom.php';
471 if($rbacsystem->checkAccess(
'read',$ref_id))
473 $this->tpl->setCurrentBlock(
"chat_info");
474 $this->tpl->setVariable(
"CHAT_ACTIVE_IN",$lng->txt(
'chat_active_in'));
475 $this->tpl->setVariable(
"CHAT_LINK",
"./ilias.php?baseClass=ilChatPresentationGUI&ref_id=".$ref_id.
"&room_id=0");
477 $this->tpl->parseCurrentBlock();
487 global $rbacsystem,$ilUser,
$lng;
489 include_once
'./Modules/Chat/classes/class.ilObjChat.php';
491 if($a_usr_id == $ilUser->getId())
499 $this->tpl->setCurrentBlock(
"chat_link");
500 $this->tpl->setVariable(
"TXT_CHAT_INVITE",$lng->txt(
'chat_invite_public_room'));
502 '&usr_id='.$a_usr_id.
'&cmd=invitePD');
503 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_invite_public_room_tooltip'));
504 $this->tpl->parseCurrentBlock();
520 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
523 $profile_gui->setBackUrl($ilCtrl->getParentReturn($this));
534 return $ilCtrl->getHTML($profile_gui);