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';
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 $profile_gui->setBackUrl($ilCtrl->getParentReturn($this));
99 return $ilCtrl->forwardCommand($profile_gui);
103 return $this->
$cmd();
111 $this->users_online_pref = $ilUser->getPref(
"show_users_online");
113 if ($this->users_online_pref !=
"y" && $this->users_online_pref !=
"associated")
137 if ($this->users_online_pref ==
"associated")
143 $this->users = ilObjUser::_getUsersOnline(0,
true);
146 $this->num_users = 0;
149 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
152 $this->users[$ilUser->getId()] =
153 array(
"user_id" => $ilUser->getId(),
154 "firstname" => $ilUser->getFirstname(),
155 "lastname" => $ilUser->getLastname(),
156 "title" => $ilUser->getUTitle(),
157 "login" => $ilUser->getLogin());
160 foreach ($this->users as $user_id => $user)
162 if ($user_id != ANONYMOUS_USER_ID)
168 $this->visitors = $user[
"num"];
182 include_once(
"Services/Notes/classes/class.ilNote.php");
186 $this->
setRowTemplate(
"tpl.users_online_row.html",
"Services/PersonalDesktop");
211 $this->mail_allowed = ($ilUser->getId() != ANONYMOUS_USER_ID &&
214 foreach ($this->users as $user_id => $user)
218 "login" => $user[
"login"]
224 if (count(
$data) == 0)
228 $this->enabledetailrow =
false;
241 $a_set[
"mail_to"] =
"";
242 if($this->mail_allowed &&
245 $a_set[
'mail_url'] =
ilMailFormCall::getLinkTarget($this->topGuiObj,
'', array(), array(
'type' =>
'new',
'rcp_to' => urlencode($a_set[
'login'])));
249 $a_set[
"profile"] = in_array(
256 if ($a_set[
"mail_url"] !=
"")
258 $this->tpl->setCurrentBlock(
"mailto_link");
259 $this->tpl->setVariable(
"TXT_MAIL", $lng->txt(
"mail"));
260 $this->tpl->setVariable(
"MAIL_URL", $a_set[
"mail_url"]);
261 $this->tpl->parseCurrentBlock();
264 $chatSettings =
new ilSetting(
'chatroom');
265 if($chatSettings->get(
'chat_enabled'))
275 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
276 if($a_set[
"id"] == $ilUser->getId() &&
280 $this->tpl->setCurrentBlock(
'chat_link');
281 $this->tpl->setVariable(
'TXT_CHAT_INVITE', $lng->txt(
'chat_enter_public_room'));
282 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_enter_public_room_tooltip'));
285 $this->tpl->parseCurrentBlock();
290 $this->tpl->setCurrentBlock(
"usr_image");
291 $this->tpl->setVariable(
"USR_IMAGE",
293 $this->tpl->setVariable(
"USR_ALT", $lng->txt(
"personal_picture"));
294 $this->tpl->parseCurrentBlock();
295 $this->tpl->touchBlock(
"usr_image_space");
298 $osi_server = $pd_set->get(
"osi_host");
304 $im_arr = array(
"icq" => 0,
314 if (trim($osi_server) !=
"")
322 foreach ($im_arr as $im_name => $im_check)
331 $im_url =
"http://http://www.icq.com/people/".$im_id;
335 $im_url =
"http://edit.yahoo.com/config/send_webmesg?target=".$im_id.
"&src=pg";
339 $im_url =
"http://messenger.live.com";
344 $im_url =
"http://aimexpress.aim.com";
348 $im_url =
"skype:".$im_id.
"?call";
356 $this->tpl->setCurrentBlock(
"im_link_start");
357 $this->tpl->setVariable(
"URL_IM",$im_url);
358 $this->tpl->parseCurrentBlock();
359 $this->tpl->touchBlock(
"im_link_end");
362 $this->tpl->setCurrentBlock(
"instant_messengers");
363 $this->tpl->setVariable(
"IMG_IM_ICON", $im_img);
364 $this->tpl->setVariable(
"TXT_IM_ICON", $lng->txt(
"im_".$im_name));
365 $icon_id =
"im_".$im_name.
"_usr_".$a_set[
"id"];
366 $this->tpl->setVariable(
"ICON_ID", $icon_id);
368 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
370 "top center",
"bottom center");
372 $this->tpl->parseCurrentBlock();
379 if(!$a_set[
"profile"])
381 $this->tpl->setVariable(
"USR_LOGIN", $a_set[
"login"]);
385 $this->tpl->setVariable(
"USR_LOGIN",
"<br />".$a_set[
"login"]);
389 $this->tpl->setVariable(
"USR_LOGIN",
" [".$a_set[
"login"].
"]");
393 if ($a_set[
"profile"])
395 include_once
"Services/User/classes/class.ilUserUtil.php";
398 $this->tpl->setCurrentBlock(
"profile_link");
399 $this->tpl->setVariable(
"TXT_VIEW", $lng->txt(
"profile"));
403 if ($ilSetting->get(
'user_portfolios'))
405 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
411 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
412 $this->tpl->setVariable(
"LINK_PROFILE",
413 $ilCtrl->getLinkTargetByClass(
"ilpublicuserprofilegui",
"getHTML"));
418 include_once
"Services/Link/classes/class.ilLink.php";
419 $this->tpl->setVariable(
"LINK_PROFILE",
ilLink::_getLink($a_set[
"id"],
"usr"));
420 $this->tpl->setVariable(
"LINK_TARGET",
"_blank");
423 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
424 $this->tpl->setVariable(
"LINK_FULLNAME", $user_name);
425 $this->tpl->parseCurrentBlock();
429 $this->tpl->setVariable(
"USR_FULLNAME",
"");
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;
508 include_once
'./Modules/Chatroom/classes/class.ilObjChatroom.php';
510 if($a_usr_id == $ilUser->getId())
520 $this->tpl->setCurrentBlock(
"chat_link");
521 $this->tpl->setVariable(
"TXT_CHAT_INVITE",$lng->txt(
'chat_invite_public_room'));
524 $this->tpl->setVariable(
"CHAT_LINK",
'./ilias.php?baseClass=ilRepositoryGUI&ref_id='.
ilObjChatroom::_getPublicRefId().
'&usr_id='.$a_usr_id.
'&cmd=view-invitePD');
525 $this->tpl->setVariable(
'TXT_CHAT_INVITE_TOOLTIP', $lng->txt(
'chat_invite_public_room_tooltip'));
526 $this->tpl->parseCurrentBlock();