ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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, $a_html="")
 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 481 of file class.ilUsersOnlineBlockGUI.php.

References $lng.

Referenced by fillRow().

482  {
483  global $rbacsystem, $lng;
484 
485  // show chat info
486  /*
487  $chat_id = ilChatRoom::_isActive($a_usr_id);
488  foreach(ilObject::_getAllReferences($chat_id) as $ref_id)
489  {
490  if($rbacsystem->checkAccess('read',$ref_id))
491  {
492  $this->tpl->setCurrentBlock("chat_info");
493  $this->tpl->setVariable("CHAT_ACTIVE_IN",$lng->txt('chat_active_in'));
494  $this->tpl->setVariable("CHAT_LINK","./ilias.php?baseClass=ilChatPresentationGUI&ref_id=".$ref_id."&room_id=0");
495  $this->tpl->setVariable("CHAT_TITLE",ilObject::_lookupTitle($chat_id));
496  $this->tpl->parseCurrentBlock();
497 
498  return true;
499  }
500  }*/
501  return false;
502  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ __showChatInvitation()

ilUsersOnlineBlockGUI::__showChatInvitation (   $a_usr_id)

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

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

Referenced by fillRow().

505  {
506  global $rbacsystem,$ilUser,$lng;
507 
508  include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
509 
510  if($a_usr_id == $ilUser->getId())
511  {
512  return false;
513  }
514 
515  //if($rbacsystem->checkAccess('read',ilObjChat::_getPublicChatRefId())
516  //and $rbacsystem->checkAccessOfUser($a_usr_id,'read',ilObjChat::_getPublicChatRefId()))
517  if($rbacsystem->checkAccess('read',ilObjChatroom::_getPublicRefId())
518  and $rbacsystem->checkAccessOfUser($a_usr_id,'read',ilObjChatroom::_getPublicRefId()))
519  {
520  $this->tpl->setCurrentBlock("chat_link");
521  $this->tpl->setVariable("TXT_CHAT_INVITE",$lng->txt('chat_invite_public_room'));
522  //$this->tpl->setVariable("CHAT_LINK",'./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId().
523  //'&usr_id='.$a_usr_id.'&cmd=invitePD');
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();
527 
528  return true;
529  }
530  return false;
531  }
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 85 of file class.ilUsersOnlineBlockGUI.php.

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

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

◆ fillDataSection()

ilUsersOnlineBlockGUI::fillDataSection ( )

Fill data section.

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

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

177  {
178  global $ilUser, $ilSetting, $ilCtrl;
179 
180  $pd_set = new ilSetting("pd");
181 
182  include_once("Services/Notes/classes/class.ilNote.php");
183 
184  if ($this->getCurrentDetailLevel() > 1 && $this->num_users > 0)
185  {
186  $this->setRowTemplate("tpl.users_online_row.html", "Services/PersonalDesktop");
187  $this->getListRowData();
188  if ($this->getCurrentDetailLevel() > 2)
189  {
190  $this->setColSpan(2);
191  }
192  parent::fillDataSection();
193  }
194  else
195  {
196  $this->setEnableNumInfo(false);
197  $this->setDataSection($this->getOverview());
198  }
199  }
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 236 of file class.ilUsersOnlineBlockGUI.php.

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

237  {
238  global $ilUser, $ilCtrl, $lng, $ilSetting, $rbacsetting, $rbacsystem;
239 
240  // mail link
241  $a_set["mail_to"] = "";
242  if($this->mail_allowed &&
243  $rbacsystem->checkAccessOfUser($a_set['id'],'internal_mail', ilMailGlobalServices::getMailObjectRefId()))
244  {
245  $a_set['mail_url'] = ilMailFormCall::getLinkTarget($this->topGuiObj, '', array(), array('type' => 'new', 'rcp_to' => urlencode($a_set['login'])));
246  }
247 
248  // check for profile
249  $a_set["profile"] = in_array(
250  ilObjUser::_lookupPref($a_set["id"], "public_profile"),
251  array("y", "g"));
252 
253  // user image
254  if ($this->getCurrentDetailLevel() > 2)
255  {
256  if ($a_set["mail_url"] != "")
257  {
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();
262  }
263 
264  $chatSettings = new ilSetting('chatroom');
265  if(/*ilChatServerConfig::_isActive() && */$chatSettings->get('chat_enabled'))
266  {
267  if(!$this->__showActiveChatsOfUser($a_set["id"]))
268  {
269  // Show invite to chat
270  $this->__showChatInvitation($a_set["id"]);
271  }
272 
273  global $rbacsystem;
274 
275  include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
276  if($a_set["id"] == $ilUser->getId() &&
277  //$rbacsystem->checkAccess('read', ilObjChat::_getPublicChatRefId()))
278  $rbacsystem->checkAccess('read', ilObjChatroom::_getPublicRefId()))
279  {
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'));
283 // $this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId());
284  $this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilRepositoryGUI&cmd=view&ref_id='.ilObjChatroom::_getPublicRefId());
285  $this->tpl->parseCurrentBlock();
286  }
287  }
288 
289  // user image
290  $this->tpl->setCurrentBlock("usr_image");
291  $this->tpl->setVariable("USR_IMAGE",
292  ilObjUser::_getPersonalPicturePath($a_set["id"],"xxsmall"));
293  $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
294  $this->tpl->parseCurrentBlock();
295  $this->tpl->touchBlock("usr_image_space");
296 
297  $pd_set = new ilSetting("pd");
298  $osi_server = $pd_set->get("osi_host");
299 
300 // if (trim($osi_server) != "")
301 // {
302  // instant messengers
303  // 1 indicates to use online status check
304  $im_arr = array("icq" => 0,
305  "yahoo" => 1,
306  "msn" => 0,
307  "aim" => 0,
308  "skype" => 1,
309  "jabber" => 0,
310  "voip" => 0);
311 
312  // use onlinestatus.org
313  // when enabled all instant messengers are checked online and ignores settings above
314  if (trim($osi_server) != "")
315  {
316  $osi_enable = true;
317  }
318 
319  // removed calls to external servers due to
320  // bug 10583, alex 8 Mar 2013
321 
322  foreach ($im_arr as $im_name => $im_check)
323  {
324  if ($im_id = ilObjUser::_lookupIm($a_set["id"], $im_name))
325  {
326  $im_url = "";
327 
328  switch ($im_name)
329  {
330  case "icq":
331  $im_url = "http://http://www.icq.com/people/".$im_id;
332  break;
333 
334  case "yahoo":
335  $im_url = "http://edit.yahoo.com/config/send_webmesg?target=".$im_id."&src=pg";
336  break;
337 
338  case "msn":
339  $im_url = "http://messenger.live.com";
340  break;
341 
342  case "aim":
343  //$im_url = "aim:GoIM?screenname=".$im_id;
344  $im_url = "http://aimexpress.aim.com";
345  break;
346 
347  case "skype":
348  $im_url = "skype:".$im_id."?call";
349  break;
350  }
351  $im_img = ilUtil::getImagePath($im_name.'online.png');
352 
353 
354  if ($im_url != "")
355  {
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");
360  }
361 
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);
367 
368  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
369  ilTooltipGUI::addTooltip($icon_id, $lng->txt("im_".$im_name).": ".$im_id, "",
370  "top center", "bottom center");
371 
372  $this->tpl->parseCurrentBlock();
373  }
374  }
375 // }
376  }
377 
378  // username
379  if(!$a_set["profile"])
380  {
381  $this->tpl->setVariable("USR_LOGIN", $a_set["login"]);
382  }
383  else if ($this->getCurrentDetailLevel() > 2)
384  {
385  $this->tpl->setVariable("USR_LOGIN", "<br />".$a_set["login"]);
386  }
387  else
388  {
389  $this->tpl->setVariable("USR_LOGIN", " [".$a_set["login"]."]");
390  }
391 
392  // profile link
393  if ($a_set["profile"])
394  {
395  include_once "Services/User/classes/class.ilUserUtil.php";
396  $user_name = ilUserUtil::getNamePresentation($a_set["id"], false, false, "", false, true, false);
397 
398  $this->tpl->setCurrentBlock("profile_link");
399  $this->tpl->setVariable("TXT_VIEW", $lng->txt("profile"));
400 
401  // see ilPersonalProfileGUI::getProfilePortfolio()
402  $has_prtf = false;
403  if ($ilSetting->get('user_portfolios'))
404  {
405  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
406  $has_prtf = ilObjPortfolio::getDefaultPortfolio($a_set["id"]);
407  }
408  if(!$has_prtf)
409  {
410  // (simple) profile: center column
411  $ilCtrl->setParameter($this, "user", $a_set["id"]);
412  $this->tpl->setVariable("LINK_PROFILE",
413  $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
414  }
415  else
416  {
417  // portfolio: fullscreen
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");
421  }
422 
423  $this->tpl->setVariable("USR_ID", $a_set["id"]);
424  $this->tpl->setVariable("LINK_FULLNAME", $user_name);
425  $this->tpl->parseCurrentBlock();
426  }
427  else
428  {
429  $this->tpl->setVariable("USR_FULLNAME", "");
430  }
431  }
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...
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
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 43 of file class.ilUsersOnlineBlockGUI.php.

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

◆ getHTML()

ilUsersOnlineBlockGUI::getHTML ( )

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

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

108  {
109  global $ilUser;
110 
111  $this->users_online_pref = $ilUser->getPref("show_users_online");
112 
113  if ($this->users_online_pref != "y" && $this->users_online_pref != "associated")
114  {
115  return "";
116  }
117 
118  $this->getUsers();
119 
120  if ($this->getCurrentDetailLevel() == 0)
121  {
122  return "";
123  }
124  else
125  {
126  return parent::getHTML();
127  }
128  }
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 205 of file class.ilUsersOnlineBlockGUI.php.

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

Referenced by fillDataSection().

206  {
207  global $ilUser, $lng, $ilCtrl, $ilDB, $rbacsystem;
208 
209  $data = array();
210 
211  $this->mail_allowed = ($ilUser->getId() != ANONYMOUS_USER_ID &&
212  $rbacsystem->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId()));
213 
214  foreach ($this->users as $user_id => $user)
215  {
216  $data[] = array(
217  "id" => $user_id,
218  "login" => $user["login"]
219  );
220  }
221  $this->setData($data);
222 
223  // we do not have at least one (non hidden) active user
224  if (count($data) == 0)
225  {
226  $this->setEnableNumInfo(false);
227  $this->setCurrentDetailLevel(1);
228  $this->enabledetailrow = false;
229  $this->setDataSection($this->getOverview());
230  }
231  }
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
global $ilDB
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 436 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilUser, and $lng.

Referenced by fillDataSection(), and getListRowData().

437  {
438  global $ilUser, $lng, $ilCtrl;
439 
440  // parse visitors text
441  if (empty($this->visitors) || $this->users_online_pref == "associated")
442  {
443  $visitor_text = "";
444  }
445  elseif ($this->visitors == "1")
446  {
447  $visitor_text = "1 ".$lng->txt("visitor");
448  }
449  else
450  {
451  $visitor_text = $visitors." ".$lng->txt("visitors");
452  }
453 
454  // parse registered users text
455  if ($this->num_users > 0)
456  {
457  $user_kind = ($this->users_online_pref == "associated") ? "associated_user" : "registered_user";
458  if ($this->num_users == 1)
459  {
460  $user_list = $this->num_users." ".$lng->txt($user_kind);
461  }
462 
463  else
464  {
465  $user_list = $this->num_users." ".$lng->txt($user_kind."s");
466  }
467 
468  if (!empty($visitor_text))
469  {
470  $user_list .= " ".$lng->txt("and")." ".$visitor_text;
471  }
472  }
473  else
474  {
475  $user_list = $visitor_text;
476  }
477 
478  return '<div class="small">'.$user_list."</div>";
479  }
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 61 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, IL_SCREEN_FULL, and IL_SCREEN_SIDE.

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

◆ getUsers()

ilUsersOnlineBlockGUI::getUsers ( )

Get online users.

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

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

Referenced by getHTML().

134  {
135  global $ilUser;
136 
137  if ($this->users_online_pref == "associated")
138  {
139  $this->users = ilUtil::getAssociatedUsersOnline($ilUser->getId(), true);
140  }
141  else
142  {
143  $this->users = ilObjUser::_getUsersOnline(0, true);
144  }
145 
146  $this->num_users = 0;
147 
148  // add current user always to list
149  if ($ilUser->getId() != ANONYMOUS_USER_ID &&
150  ilObjUser::_lookupPref($ilUser->getId(), "hide_own_online_status") != "y")
151  {
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());
158  }
159 
160  foreach ($this->users as $user_id => $user)
161  {
162  if ($user_id != ANONYMOUS_USER_ID)
163  {
164  $this->num_users++;
165  }
166  else
167  {
168  $this->visitors = $user["num"];
169  }
170  }
171  }
_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, ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setLimit(), and ilBlockGUI\setTitle().

25  {
26  global $ilCtrl, $lng, $ilUser;
27 
28  parent::ilBlockGUI();
29 
30  $this->setLimit(10);
31  $this->setTitle($lng->txt("users_online"));
32  $this->setAvailableDetailLevels(3);
33 
34  // mjansen: Used for mail referer link (@see fillRow). I don't want to create a new instance in each fillRow call.
35  $this->topGuiObj = new ilPersonalDesktopGUI();
36  }
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title)
Set Title.
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 53 of file class.ilUsersOnlineBlockGUI.php.

54  {
55  return false;
56  }

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: