ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilUsersOnlineBlockGUI Class Reference

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

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

Public Member Functions

 __construct ()
 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
 __construct ()
 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.

Constructor & Destructor Documentation

◆ __construct()

ilUsersOnlineBlockGUI::__construct ( )

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::__construct();
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.
$ilUser
Definition: imgupload.php:18
setLimit($a_limit)
Set Limit.
global $lng
Definition: privfeed.php:17
GUI class for personal desktop.
+ Here is the call graph for this function:

Member Function Documentation

◆ __showActiveChatsOfUser()

ilUsersOnlineBlockGUI::__showActiveChatsOfUser (   $a_usr_id)

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

References $lng.

Referenced by fillRow().

402  {
403  global $rbacsystem, $lng;
404 
405  // show chat info
406  /*
407  $chat_id = ilChatRoom::_isActive($a_usr_id);
408  foreach(ilObject::_getAllReferences($chat_id) as $ref_id)
409  {
410  if($rbacsystem->checkAccess('read',$ref_id))
411  {
412  $this->tpl->setCurrentBlock("chat_info");
413  $this->tpl->setVariable("CHAT_ACTIVE_IN",$lng->txt('chat_active_in'));
414  $this->tpl->setVariable("CHAT_LINK","./ilias.php?baseClass=ilChatPresentationGUI&ref_id=".$ref_id."&room_id=0");
415  $this->tpl->setVariable("CHAT_TITLE",ilObject::_lookupTitle($chat_id));
416  $this->tpl->parseCurrentBlock();
417 
418  return true;
419  }
420  }*/
421  return false;
422  }
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ __showChatInvitation()

ilUsersOnlineBlockGUI::__showChatInvitation (   $a_usr_id)

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

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

Referenced by fillRow().

425  {
426  global $rbacsystem,$ilUser,$lng;
427 
428  include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
429 
430  if($a_usr_id == $ilUser->getId())
431  {
432  return false;
433  }
434 
435  //if($rbacsystem->checkAccess('read',ilObjChat::_getPublicChatRefId())
436  //and $rbacsystem->checkAccessOfUser($a_usr_id,'read',ilObjChat::_getPublicChatRefId()))
437  if($rbacsystem->checkAccess('read',ilObjChatroom::_getPublicRefId())
438  and $rbacsystem->checkAccessOfUser($a_usr_id,'read',ilObjChatroom::_getPublicRefId()))
439  {
440  $this->tpl->setCurrentBlock("chat_link");
441  $this->tpl->setVariable("TXT_CHAT_INVITE",$lng->txt('chat_invite_public_room'));
442  //$this->tpl->setVariable("CHAT_LINK",'./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId().
443  //'&usr_id='.$a_usr_id.'&cmd=invitePD');
444  $this->tpl->setVariable("CHAT_LINK",'./ilias.php?baseClass=ilRepositoryGUI&ref_id='.ilObjChatroom::_getPublicRefId().'&usr_id='.$a_usr_id.'&cmd=view-invitePD');
445  $this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_invite_public_room_tooltip'));
446  $this->tpl->parseCurrentBlock();
447 
448  return true;
449  }
450  return false;
451  }
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
+ 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.
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
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\_lookupPref(), array, ilBlockGUI\getCurrentDetailLevel(), ilObjPortfolio\getDefaultPortfolio(), 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 
298  // username
299  if(!$a_set["profile"])
300  {
301  $this->tpl->setVariable("USR_LOGIN", $a_set["login"]);
302  }
303  else if ($this->getCurrentDetailLevel() > 2)
304  {
305  $this->tpl->setVariable("USR_LOGIN", "<br />".$a_set["login"]);
306  }
307  else
308  {
309  $this->tpl->setVariable("USR_LOGIN", " [".$a_set["login"]."]");
310  }
311 
312  // profile link
313  if ($a_set["profile"])
314  {
315  include_once "Services/User/classes/class.ilUserUtil.php";
316  $user_name = ilUserUtil::getNamePresentation($a_set["id"], false, false, "", false, true, false);
317 
318  $this->tpl->setCurrentBlock("profile_link");
319  $this->tpl->setVariable("TXT_VIEW", $lng->txt("profile"));
320 
321  // see ilPersonalProfileGUI::getProfilePortfolio()
322  $has_prtf = false;
323  if ($ilSetting->get('user_portfolios'))
324  {
325  include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
326  $has_prtf = ilObjPortfolio::getDefaultPortfolio($a_set["id"]);
327  }
328  if(!$has_prtf)
329  {
330  // (simple) profile: center column
331  $ilCtrl->setParameter($this, "user", $a_set["id"]);
332  $this->tpl->setVariable("LINK_PROFILE",
333  $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
334  }
335  else
336  {
337  // portfolio: fullscreen
338  include_once "Services/Link/classes/class.ilLink.php";
339  $this->tpl->setVariable("LINK_PROFILE", ilLink::_getLink($a_set["id"], "usr"));
340  $this->tpl->setVariable("LINK_TARGET", "_blank");
341  }
342 
343  $this->tpl->setVariable("USR_ID", $a_set["id"]);
344  $this->tpl->setVariable("LINK_FULLNAME", $user_name);
345  $this->tpl->parseCurrentBlock();
346  }
347  else
348  {
349  $this->tpl->setVariable("USR_FULLNAME", "");
350  }
351  }
ILIAS Setting Class.
global $ilCtrl
Definition: ilias.php:18
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, $a_return_data_array=false)
Default behaviour is:
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static getLinkTarget($gui, $cmd, Array $gui_params=array(), Array $mail_params=array(), $context_params=array())
global $ilSetting
Definition: privfeed.php:17
static _lookupPref($a_usr_id, $a_keyword)
global $lng
Definition: privfeed.php:17
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  }
$ilUser
Definition: imgupload.php:18
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, array, 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.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
setCurrentDetailLevel($a_currentdetaillevel)
Set Current Detail Level.
global $lng
Definition: privfeed.php:17
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 356 of file class.ilUsersOnlineBlockGUI.php.

References $ilCtrl, $ilUser, and $lng.

Referenced by fillDataSection(), and getListRowData().

357  {
358  global $ilUser, $lng, $ilCtrl;
359 
360  // parse visitors text
361  if (empty($this->visitors) || $this->users_online_pref == "associated")
362  {
363  $visitor_text = "";
364  }
365  elseif ($this->visitors == "1")
366  {
367  $visitor_text = "1 ".$lng->txt("visitor");
368  }
369  else
370  {
371  $visitor_text = $visitors." ".$lng->txt("visitors");
372  }
373 
374  // parse registered users text
375  if ($this->num_users > 0)
376  {
377  $user_kind = ($this->users_online_pref == "associated") ? "associated_user" : "registered_user";
378  if ($this->num_users == 1)
379  {
380  $user_list = $this->num_users." ".$lng->txt($user_kind);
381  }
382 
383  else
384  {
385  $user_list = $this->num_users." ".$lng->txt($user_kind."s");
386  }
387 
388  if (!empty($visitor_text))
389  {
390  $user_list .= " ".$lng->txt("and")." ".$visitor_text;
391  }
392  }
393  else
394  {
395  $user_list = $visitor_text;
396  }
397 
398  return '<div class="small">'.$user_list."</div>";
399  }
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
+ 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(), array, 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  }
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...
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static _lookupPref($a_usr_id, $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller 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: