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();
271 $this->tpl->setCurrentBlock(
"usr_image");
272 $this->tpl->setVariable(
"USR_IMAGE",
274 $this->tpl->setVariable(
"USR_ALT", $lng->txt(
"personal_picture"));
275 $this->tpl->parseCurrentBlock();
278 $osi_server = $pd_set->get(
"osi_host");
284 $im_arr = array(
"icq" => 0,
294 if (trim($osi_server) !=
"")
299 foreach ($im_arr as $im_name => $im_check)
308 $im_url =
"http://people.icq.com/people/about_me.php?uin=".$im_id;
310 $im_img =
"http://wwp.icq.com/scripts/online.dll?icq=".$im_id.
"&img=5";
314 $im_url =
"http://edit.yahoo.com/config/send_webmesg?.target=".$im_id.
"&.src=pg";
315 $im_img =
"http://opi.yahoo.com/online?u=".$im_id.
"&m=g&t=5";
319 $im_url =
"http://messenger.live.com";
325 $im_url =
"http://aimexpress.aim.com";
331 $im_url =
"skype:".$im_id.
"?call";
338 $im_img =
"http://mystatus.skype.com/smallicon/".$im_id;
342 $this->tpl->setCurrentBlock(
"instant_messengers");
346 $this->tpl->setVariable(
"URL_IM",$osi_server.
"/message/".$im_name.
"/".$im_id);
347 $this->tpl->setVariable(
"IMG_IM_ICON",$osi_server.
"/".$im_name.
"/".$im_id);
351 $this->tpl->setVariable(
"URL_IM",$im_url);
352 $this->tpl->setVariable(
"IMG_IM_ICON", $im_check ? $im_img :
ilUtil::getImagePath($im_name.
'offline.gif'));
355 $this->tpl->setVariable(
"TXT_IM_ICON", $lng->txt(
"im_".$im_name));
356 $this->tpl->parseCurrentBlock();
365 $this->tpl->setVariable(
"USR_LOGIN",
"<br />".$a_set[
"login"]);
369 $this->tpl->setVariable(
"USR_LOGIN",
" [".$a_set[
"login"].
"]");
373 if ($a_set[
"profile"])
375 $this->tpl->setCurrentBlock(
"profile_link");
376 $this->tpl->setVariable(
"TXT_VIEW", $lng->txt(
"profile"));
377 $ilCtrl->setParameter($this,
"user", $a_set[
"id"]);
378 $this->tpl->setVariable(
"LINK_PROFILE",
379 $ilCtrl->getLinkTarget($this,
"showUserProfile"));
380 $this->tpl->setVariable(
"USR_ID", $a_set[
"id"]);
381 $this->tpl->setVariable(
"LINK_FULLNAME", ilObjUser::_lookupFullName($a_set[
"id"]));
382 $this->tpl->parseCurrentBlock();
386 $this->tpl->setVariable(
"USR_FULLNAME", ilObjUser::_lookupFullName($a_set[
"id"]));
398 if (empty($this->visitors) || $this->users_online_pref ==
"associated")
402 elseif ($this->visitors ==
"1")
404 $visitor_text =
"1 ".$lng->txt(
"visitor");
408 $visitor_text = $visitors.
" ".$lng->txt(
"visitors");
412 if ($this->num_users > 0)
414 $user_kind = ($this->users_online_pref ==
"associated") ?
"associated_user" :
"registered_user";
415 if ($this->num_users == 1)
417 $user_list = $this->num_users.
" ".$lng->txt($user_kind);
422 $user_list = $this->num_users.
" ".$lng->txt($user_kind.
"s");
425 if (!empty($visitor_text))
427 $user_list .=
" ".$lng->txt(
"and").
" ".$visitor_text;
432 $user_list = $visitor_text;
435 return '<div class="small">'.$user_list.
"</div>";
447 include_once(
'./Services/User/classes/class.ilPublicUserProfileGUI.php');
450 $profile_gui->setBackUrl($ilCtrl->getParentReturn($this));
461 return $ilCtrl->getHTML($profile_gui);