ILIAS  release_4-4 Revision
ilUsersOnlineBlockGUI Class Reference

BlockGUI class for Personal Desktop Users Online block. More...

+ Inheritance diagram for ilUsersOnlineBlockGUI:
+ Collaboration diagram for ilUsersOnlineBlockGUI:

Public Member Functions

 ilUsersOnlineBlockGUI ()
 Constructor. More...
 
executeCommand ()
 execute command More...
 
 getHTML ()
 
 getUsers ()
 Get online users. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getListRowData ()
 Get list data. More...
 
 fillRow ($a_set)
 get flat bookmark list for personal desktop More...
 
 getOverview ()
 Get overview. More...
 
 __showActiveChatsOfUser ($a_usr_id)
 
 __showChatInvitation ($a_usr_id)
 
- Public Member Functions inherited from ilBlockGUI
 ilBlockGUI ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false)
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ($a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Is block used in repository object? More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Static Public Attributes

static $block_type = "pdusers"
 

Additional Inherited Members

- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 

Detailed Description

BlockGUI class for Personal Desktop Users Online block.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilUsersOnlineBlockGUI: ilColumnGUI ilUsersOnlineBlockGUI: ilPublicUserProfileGUI

Definition at line 17 of file class.ilUsersOnlineBlockGUI.php.

Member Function Documentation

◆ __showActiveChatsOfUser()

ilUsersOnlineBlockGUI::__showActiveChatsOfUser (   $a_usr_id)

Definition at line 464 of file class.ilUsersOnlineBlockGUI.php.

References $lng.

Referenced by fillRow().

465  {
466  global $rbacsystem, $lng;
467 
468  // show chat info
469  /*
470  $chat_id = ilChatRoom::_isActive($a_usr_id);
471  foreach(ilObject::_getAllReferences($chat_id) as $ref_id)
472  {
473  if($rbacsystem->checkAccess('read',$ref_id))
474  {
475  $this->tpl->setCurrentBlock("chat_info");
476  $this->tpl->setVariable("CHAT_ACTIVE_IN",$lng->txt('chat_active_in'));
477  $this->tpl->setVariable("CHAT_LINK","./ilias.php?baseClass=ilChatPresentationGUI&ref_id=".$ref_id."&room_id=0");
478  $this->tpl->setVariable("CHAT_TITLE",ilObject::_lookupTitle($chat_id));
479  $this->tpl->parseCurrentBlock();
480 
481  return true;
482  }
483  }*/
484  return false;
485  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ __showChatInvitation()

ilUsersOnlineBlockGUI::__showChatInvitation (   $a_usr_id)

Definition at line 487 of file class.ilUsersOnlineBlockGUI.php.

References $ilUser, $lng, and ilObjChatroom\_getPublicRefId().

Referenced by fillRow().

488  {
489  global $rbacsystem,$ilUser,$lng;
490 
491  include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
492 
493  if($a_usr_id == $ilUser->getId())
494  {
495  return false;
496  }
497 
498  //if($rbacsystem->checkAccess('read',ilObjChat::_getPublicChatRefId())
499  //and $rbacsystem->checkAccessOfUser($a_usr_id,'read',ilObjChat::_getPublicChatRefId()))
500  if($rbacsystem->checkAccess('read',ilObjChatroom::_getPublicRefId())
501  and $rbacsystem->checkAccessOfUser($a_usr_id,'read',ilObjChatroom::_getPublicRefId()))
502  {
503  $this->tpl->setCurrentBlock("chat_link");
504  $this->tpl->setVariable("TXT_CHAT_INVITE",$lng->txt('chat_invite_public_room'));
505  //$this->tpl->setVariable("CHAT_LINK",'./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId().
506  //'&usr_id='.$a_usr_id.'&cmd=invitePD');
507  $this->tpl->setVariable("CHAT_LINK",'./ilias.php?baseClass=ilRepositoryGUI&ref_id='.ilObjChatroom::_getPublicRefId().'&usr_id='.$a_usr_id.'&cmd=view-invitePD');
508  $this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_invite_public_room_tooltip'));
509  $this->tpl->parseCurrentBlock();
510 
511  return true;
512  }
513  return false;
514  }
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

& ilUsersOnlineBlockGUI::executeCommand ( )

execute command

Definition at line 86 of file class.ilUsersOnlineBlockGUI.php.

References $_GET, $cmd, $ilCtrl, and $tpl.

87  {
88  global $ilCtrl, $tpl;
89 
90  $next_class = $ilCtrl->getNextClass();
91  $cmd = $ilCtrl->getCmd("getHTML");
92 
93  switch($next_class)
94  {
95  // profile
96  case "ilpublicuserprofilegui":
97  include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
98  $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
99  $profile_gui->setBackUrl($ilCtrl->getParentReturn($this));
100  return $ilCtrl->forwardCommand($profile_gui);
101  break;
102 
103  default:
104  return $this->$cmd();
105  }
106  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
GUI class for public user profile presentation.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl

◆ fillDataSection()

ilUsersOnlineBlockGUI::fillDataSection ( )

Fill data section.

Definition at line 177 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilSetting, $ilUser, ilBlockGUI\getCurrentDetailLevel(), getListRowData(), getOverview(), ilBlockGUI\setColSpan(), ilBlockGUI\setDataSection(), ilBlockGUI\setEnableNumInfo(), and ilBlockGUI\setRowTemplate().

178  {
179  global $ilUser, $ilSetting, $ilCtrl;
180 
181  $pd_set = new ilSetting("pd");
182 
183  include_once("Services/Notes/classes/class.ilNote.php");
184 
185  if ($this->getCurrentDetailLevel() > 1 && $this->num_users > 0)
186  {
187  $this->setRowTemplate("tpl.users_online_row.html", "Services/PersonalDesktop");
188  $this->getListRowData();
189  if ($this->getCurrentDetailLevel() > 2)
190  {
191  $this->setColSpan(2);
192  }
193  parent::fillDataSection();
194  }
195  else
196  {
197  $this->setEnableNumInfo(false);
198  $this->setDataSection($this->getOverview());
199  }
200  }
ILIAS Setting Class.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
setColSpan($a_colspan)
Set Columns Span.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ fillRow()

ilUsersOnlineBlockGUI::fillRow (   $a_set)

get flat bookmark list for personal desktop

Definition at line 237 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilSetting, $ilUser, $lng, __showActiveChatsOfUser(), __showChatInvitation(), ilObjUser\_getPersonalPicturePath(), ilObjChatroom\_getPublicRefId(), ilObjUser\_lookupIm(), ilObjUser\_lookupPref(), ilTooltipGUI\addTooltip(), ilBlockGUI\getCurrentDetailLevel(), ilUtil\getImagePath(), ilMailFormCall\getLinkTarget(), ilMailGlobalServices\getMailObjectRefId(), and ilUserUtil\getNamePresentation().

238  {
239  global $ilUser, $ilCtrl, $lng, $ilSetting, $rbacsetting, $rbacsystem;
240 
241  // mail link
242  $a_set["mail_to"] = "";
243  if($this->mail_allowed &&
244  $rbacsystem->checkAccessOfUser($a_set['id'],'internal_mail', ilMailGlobalServices::getMailObjectRefId()))
245  {
246  $a_set['mail_url'] = ilMailFormCall::getLinkTarget($this->topGuiObj, '', array(), array('type' => 'new', 'rcp_to' => urlencode($a_set['login'])));
247  }
248 
249  // check for profile
250  $a_set["profile"] = in_array(
251  ilObjUser::_lookupPref($a_set["id"], "public_profile"),
252  array("y", "g"));
253 
254  // user image
255  if ($this->getCurrentDetailLevel() > 2)
256  {
257  if ($a_set["mail_url"] != "")
258  {
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();
263  }
264 
265  $chatSettings = new ilSetting('chatroom');
266  if(/*ilChatServerConfig::_isActive() && */$chatSettings->get('chat_enabled'))
267  {
268  if(!$this->__showActiveChatsOfUser($a_set["id"]))
269  {
270  // Show invite to chat
271  $this->__showChatInvitation($a_set["id"]);
272  }
273 
274  global $rbacsystem;
275 
276  include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
277  if($a_set["id"] == $ilUser->getId() &&
278  //$rbacsystem->checkAccess('read', ilObjChat::_getPublicChatRefId()))
279  $rbacsystem->checkAccess('read', ilObjChatroom::_getPublicRefId()))
280  {
281  $this->tpl->setCurrentBlock('chat_link');
282  $this->tpl->setVariable('TXT_CHAT_INVITE', $lng->txt('chat_enter_public_room'));
283  $this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_enter_public_room_tooltip'));
284 // $this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId());
285  $this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilRepositoryGUI&cmd=view&ref_id='.ilObjChatroom::_getPublicRefId());
286  $this->tpl->parseCurrentBlock();
287  }
288  }
289 
290  // user image
291  $this->tpl->setCurrentBlock("usr_image");
292  $this->tpl->setVariable("USR_IMAGE",
293  ilObjUser::_getPersonalPicturePath($a_set["id"],"xxsmall"));
294  $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
295  $this->tpl->parseCurrentBlock();
296  $this->tpl->touchBlock("usr_image_space");
297 
298  $pd_set = new ilSetting("pd");
299  $osi_server = $pd_set->get("osi_host");
300 
301 // if (trim($osi_server) != "")
302 // {
303  // instant messengers
304  // 1 indicates to use online status check
305  $im_arr = array("icq" => 0,
306  "yahoo" => 1,
307  "msn" => 0,
308  "aim" => 0,
309  "skype" => 1,
310  "jabber" => 0,
311  "voip" => 0);
312 
313  // use onlinestatus.org
314  // when enabled all instant messengers are checked online and ignores settings above
315  if (trim($osi_server) != "")
316  {
317  $osi_enable = true;
318  }
319 
320  // removed calls to external servers due to
321  // bug 10583, alex 8 Mar 2013
322 
323  foreach ($im_arr as $im_name => $im_check)
324  {
325  if ($im_id = ilObjUser::_lookupIm($a_set["id"], $im_name))
326  {
327  $im_url = "";
328 
329  switch ($im_name)
330  {
331  case "icq":
332  $im_url = "http://http://www.icq.com/people/".$im_id;
333  break;
334 
335  case "yahoo":
336  $im_url = "http://edit.yahoo.com/config/send_webmesg?target=".$im_id."&src=pg";
337  break;
338 
339  case "msn":
340  $im_url = "http://messenger.live.com";
341  break;
342 
343  case "aim":
344  //$im_url = "aim:GoIM?screenname=".$im_id;
345  $im_url = "http://aimexpress.aim.com";
346  break;
347 
348  case "skype":
349  $im_url = "skype:".$im_id."?call";
350  break;
351  }
352  $im_img = ilUtil::getImagePath($im_name.'online.png');
353 
354 
355  if ($im_url != "")
356  {
357  $this->tpl->setCurrentBlock("im_link_start");
358  $this->tpl->setVariable("URL_IM",$im_url);
359  $this->tpl->parseCurrentBlock();
360  $this->tpl->touchBlock("im_link_end");
361  }
362 
363  $this->tpl->setCurrentBlock("instant_messengers");
364  $this->tpl->setVariable("IMG_IM_ICON", $im_img);
365  $this->tpl->setVariable("TXT_IM_ICON", $lng->txt("im_".$im_name));
366  $icon_id = "im_".$im_name."_usr_".$a_set["id"];
367  $this->tpl->setVariable("ICON_ID", $icon_id);
368 
369  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
370  ilTooltipGUI::addTooltip($icon_id, $lng->txt("im_".$im_name).": ".$im_id, "",
371  "top center", "bottom center");
372 
373  $this->tpl->parseCurrentBlock();
374  }
375  }
376 // }
377  }
378 
379  // username
380  if(!$a_set["profile"])
381  {
382  $this->tpl->setVariable("USR_LOGIN", $a_set["login"]);
383  }
384  else if ($this->getCurrentDetailLevel() > 2)
385  {
386  $this->tpl->setVariable("USR_LOGIN", "<br />".$a_set["login"]);
387  }
388  else
389  {
390  $this->tpl->setVariable("USR_LOGIN", " [".$a_set["login"]."]");
391  }
392 
393  // profile link
394  if ($a_set["profile"])
395  {
396  include_once "Services/User/classes/class.ilUserUtil.php";
397  $user_name = ilUserUtil::getNamePresentation($a_set["id"], false, false, "", false, true, false);
398 
399  $this->tpl->setCurrentBlock("profile_link");
400  $this->tpl->setVariable("TXT_VIEW", $lng->txt("profile"));
401 
402  $ilCtrl->setParameter($this, "user", $a_set["id"]);
403  $this->tpl->setVariable("LINK_PROFILE",
404  $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
405 
406  $this->tpl->setVariable("USR_ID", $a_set["id"]);
407  $this->tpl->setVariable("LINK_FULLNAME", $user_name);
408  $this->tpl->parseCurrentBlock();
409  }
410  else
411  {
412  $this->tpl->setVariable("USR_FULLNAME", "");
413  }
414  }
ILIAS Setting Class.
static getLinkTarget($gui, $cmd, Array $gui_params=array(), Array $mail_params=array())
_lookupPref($a_usr_id, $a_keyword)
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true)
Default behaviour is:
global $ilCtrl
Definition: ilias.php:18
static addTooltip($a_el_id, $a_text, $a_container="", $a_my="bottom center", $a_at="top center", $a_use_htmlspecialchars=true)
Adds a tooltip to an HTML element.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
_lookupIm($a_user_id, $a_type)
Lookup IM.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable...
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getBlockType()

static ilUsersOnlineBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Definition at line 44 of file class.ilUsersOnlineBlockGUI.php.

45  {
46  return self::$block_type;
47  }

◆ getHTML()

ilUsersOnlineBlockGUI::getHTML ( )

Definition at line 108 of file class.ilUsersOnlineBlockGUI.php.

References $ilUser, ilBlockGUI\getCurrentDetailLevel(), and getUsers().

109  {
110  global $ilUser;
111 
112  $this->users_online_pref = $ilUser->getPref("show_users_online");
113 
114  if ($this->users_online_pref != "y" && $this->users_online_pref != "associated")
115  {
116  return "";
117  }
118 
119  $this->getUsers();
120 
121  if ($this->getCurrentDetailLevel() == 0)
122  {
123  return "";
124  }
125  else
126  {
127  return parent::getHTML();
128  }
129  }
global $ilUser
Definition: imgupload.php:15
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ getListRowData()

ilUsersOnlineBlockGUI::getListRowData ( )

Get list data.

Definition at line 206 of file class.ilUsersOnlineBlockGUI.php.

References ilBlockGUI\$data, $ilCtrl, $ilUser, $lng, ilMailGlobalServices\getMailObjectRefId(), getOverview(), ilBlockGUI\setCurrentDetailLevel(), ilBlockGUI\setData(), ilBlockGUI\setDataSection(), and ilBlockGUI\setEnableNumInfo().

Referenced by fillDataSection().

207  {
208  global $ilUser, $lng, $ilCtrl, $ilDB, $rbacsystem;
209 
210  $data = array();
211 
212  $this->mail_allowed = ($ilUser->getId() != ANONYMOUS_USER_ID &&
213  $rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()));
214 
215  foreach ($this->users as $user_id => $user)
216  {
217  $data[] = array(
218  "id" => $user_id,
219  "login" => $user["login"]
220  );
221  }
222  $this->setData($data);
223 
224  // we do not have at least one (non hidden) active user
225  if (count($data) == 0)
226  {
227  $this->setEnableNumInfo(false);
228  $this->setCurrentDetailLevel(1);
229  $this->enabledetailrow = false;
230  $this->setDataSection($this->getOverview());
231  }
232  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
global $ilCtrl
Definition: ilias.php:18
setData($a_data)
Set Data.
global $ilUser
Definition: imgupload.php:15
setCurrentDetailLevel($a_currentdetaillevel)
Set Current Detail Level.
global $lng
Definition: privfeed.php:40
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverview()

ilUsersOnlineBlockGUI::getOverview ( )

Get overview.

Definition at line 419 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilUser, and $lng.

Referenced by fillDataSection(), and getListRowData().

420  {
421  global $ilUser, $lng, $ilCtrl;
422 
423  // parse visitors text
424  if (empty($this->visitors) || $this->users_online_pref == "associated")
425  {
426  $visitor_text = "";
427  }
428  elseif ($this->visitors == "1")
429  {
430  $visitor_text = "1 ".$lng->txt("visitor");
431  }
432  else
433  {
434  $visitor_text = $visitors." ".$lng->txt("visitors");
435  }
436 
437  // parse registered users text
438  if ($this->num_users > 0)
439  {
440  $user_kind = ($this->users_online_pref == "associated") ? "associated_user" : "registered_user";
441  if ($this->num_users == 1)
442  {
443  $user_list = $this->num_users." ".$lng->txt($user_kind);
444  }
445 
446  else
447  {
448  $user_list = $this->num_users." ".$lng->txt($user_kind."s");
449  }
450 
451  if (!empty($visitor_text))
452  {
453  $user_list .= " ".$lng->txt("and")." ".$visitor_text;
454  }
455  }
456  else
457  {
458  $user_list = $visitor_text;
459  }
460 
461  return '<div class="small">'.$user_list."</div>";
462  }
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilUsersOnlineBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 62 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

63  {
64  global $ilCtrl;
65 
66  if ($ilCtrl->getCmdClass() == "ilpublicuserprofilegui")
67  {
68  return IL_SCREEN_FULL;
69  }
70 
71  switch($ilCtrl->getCmd())
72  {
73  case "showUserProfile":
74  return IL_SCREEN_FULL;
75  break;
76 
77  default:
78  return IL_SCREEN_SIDE;
79  break;
80  }
81  }
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_FULL
const IL_SCREEN_SIDE

◆ getUsers()

ilUsersOnlineBlockGUI::getUsers ( )

Get online users.

Definition at line 134 of file class.ilUsersOnlineBlockGUI.php.

References $ilUser, ilObjUser\_lookupPref(), and ilUtil\getAssociatedUsersOnline().

Referenced by getHTML().

135  {
136  global $ilUser;
137 
138  if ($this->users_online_pref == "associated")
139  {
140  $this->users = ilUtil::getAssociatedUsersOnline($ilUser->getId(), true);
141  }
142  else
143  {
144  $this->users = ilObjUser::_getUsersOnline(0, true);
145  }
146 
147  $this->num_users = 0;
148 
149  // add current user always to list
150  if ($ilUser->getId() != ANONYMOUS_USER_ID &&
151  ilObjUser::_lookupPref($ilUser->getId(), "hide_own_online_status") != "y")
152  {
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());
159  }
160 
161  foreach ($this->users as $user_id => $user)
162  {
163  if ($user_id != ANONYMOUS_USER_ID)
164  {
165  $this->num_users++;
166  }
167  else
168  {
169  $this->visitors = $user["num"];
170  }
171  }
172  }
_lookupPref($a_usr_id, $a_keyword)
static getAssociatedUsersOnline($a_user_id)
reads all active sessions from db and returns users that are online and who have a local role in a gr...
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilUsersOnlineBlockGUI()

ilUsersOnlineBlockGUI::ilUsersOnlineBlockGUI ( )

Constructor.

Definition at line 24 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilUser, $lng, ilUtil\getImagePath(), ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setImage(), ilBlockGUI\setLimit(), and ilBlockGUI\setTitle().

25  {
26  global $ilCtrl, $lng, $ilUser;
27 
28  parent::ilBlockGUI();
29 
30  $this->setLimit(10);
31  $this->setImage(ilUtil::getImagePath("icon_grp_s.png"));
32  $this->setTitle($lng->txt("users_online"));
33  $this->setAvailableDetailLevels(3);
34 
35  // mjansen: Used for mail referer link (@see fillRow). I don't want to create a new instance in each fillRow call.
36  $this->topGuiObj = new ilPersonalDesktopGUI();
37  }
global $ilCtrl
Definition: ilias.php:18
setImage($a_image)
Set Image.
setTitle($a_title)
Set Title.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
setLimit($a_limit)
Set Limit.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
GUI class for personal desktop.
+ Here is the call graph for this function:

◆ isRepositoryObject()

static ilUsersOnlineBlockGUI::isRepositoryObject ( )
static

Is block used in repository object?

Returns
string Block type.

Definition at line 54 of file class.ilUsersOnlineBlockGUI.php.

55  {
56  return false;
57  }

Field Documentation

◆ $block_type

ilUsersOnlineBlockGUI::$block_type = "pdusers"
static

Definition at line 19 of file class.ilUsersOnlineBlockGUI.php.


The documentation for this class was generated from the following file: