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'))
277 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
278 if($a_set[
"id"] == $ilUser->getId() &&
282 $this->tpl->setCurrentBlock(
'chat_link');
283 $this->tpl->setVariable(
'TXT_CHAT_INVITE', $lng->txt(
'chat_enter_public_room'));
284 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_enter_public_room_tooltip'));
287 $this->tpl->parseCurrentBlock();
292 $this->tpl->setCurrentBlock(
"usr_image");
293 $this->tpl->setVariable(
"USR_IMAGE",
295 $this->tpl->setVariable(
"USR_ALT", $lng->txt(
"personal_picture"));
296 $this->tpl->parseCurrentBlock();
299 $osi_server = $pd_set->get(
"osi_host");
305 $im_arr = array(
"icq" => 0,
315 if (trim($osi_server) !=
"")
320 foreach ($im_arr as $im_name => $im_check)
329 $im_url =
"http://people.icq.com/people/about_me.php?uin=".$im_id;
331 $im_img =
"http://wwp.icq.com/scripts/online.dll?icq=".$im_id.
"&img=5";
335 $im_url =
"http://edit.yahoo.com/config/send_webmesg?.target=".$im_id.
"&.src=pg";
336 $im_img =
"http://opi.yahoo.com/online?u=".$im_id.
"&m=g&t=5";
340 $im_url =
"http://messenger.live.com";
346 $im_url =
"http://aimexpress.aim.com";
352 $im_url =
"skype:".$im_id.
"?call";
359 $im_img =
"http://mystatus.skype.com/smallicon/".$im_id;
363 $this->tpl->setCurrentBlock(
"instant_messengers");
367 $this->tpl->setVariable(
"URL_IM",$osi_server.
"/message/".$im_name.
"/".$im_id);
368 $this->tpl->setVariable(
"IMG_IM_ICON",$osi_server.
"/".$im_name.
"/".$im_id);
372 $this->tpl->setVariable(
"URL_IM",$im_url);
373 $this->tpl->setVariable(
"IMG_IM_ICON", $im_check ? $im_img :
ilUtil::getImagePath($im_name.
'offline.gif'));
376 $this->tpl->setVariable(
"TXT_IM_ICON", $lng->txt(
"im_".$im_name));
377 $this->tpl->parseCurrentBlock();
384 if(!$a_set[
"profile"])
386 $this->tpl->setVariable(
"USR_LOGIN", $a_set[
"login"]);
390 $this->tpl->setVariable(
"USR_LOGIN",
"<br />".$a_set[
"login"]);
394 $this->tpl->setVariable(
"USR_LOGIN",
" [".$a_set[
"login"].
"]");
398 if ($a_set[
"profile"])
400 include_once
"Services/User/classes/class.ilUserUtil.php";
403 $this->tpl->setCurrentBlock(
"profile_link");
404 $this->tpl->setVariable(
"TXT_VIEW", $lng->txt(
"profile"));
406 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
407 $this->tpl->setVariable(
"LINK_PROFILE",
408 $ilCtrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML"));
410 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
411 $this->tpl->setVariable(
"LINK_FULLNAME", $user_name);
412 $this->tpl->parseCurrentBlock();
416 $this->tpl->setVariable(
"USR_FULLNAME",
"");
428 if (empty($this->visitors) || $this->users_online_pref ==
"associated")
432 elseif ($this->visitors ==
"1")
434 $visitor_text =
"1 ".$lng->txt(
"visitor");
438 $visitor_text = $visitors.
" ".$lng->txt(
"visitors");
442 if ($this->num_users > 0)
444 $user_kind = ($this->users_online_pref ==
"associated") ?
"associated_user" :
"registered_user";
445 if ($this->num_users == 1)
447 $user_list = $this->num_users.
" ".$lng->txt($user_kind);
452 $user_list = $this->num_users.
" ".$lng->txt($user_kind.
"s");
455 if (!empty($visitor_text))
457 $user_list .=
" ".$lng->txt(
"and").
" ".$visitor_text;
462 $user_list = $visitor_text;
465 return '<div class="small">'.$user_list.
"</div>";
470 global $rbacsystem,
$lng;
493 global $rbacsystem,$ilUser,
$lng;
496 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
498 if($a_usr_id == $ilUser->getId())
508 $this->tpl->setCurrentBlock(
"chat_link");
509 $this->tpl->setVariable(
"TXT_CHAT_INVITE",$lng->txt(
'chat_invite_public_room'));
513 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_invite_public_room_tooltip'));
514 $this->tpl->parseCurrentBlock();