ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilAwarenessChatFeatureProvider Class Reference

Adds link to chat feature. More...

+ Inheritance diagram for ilAwarenessChatFeatureProvider:
+ Collaboration diagram for ilAwarenessChatFeatureProvider:

Public Member Functions

 __construct ()
 Constructor. More...
 
 checkUserChatAccess ($a_user_id)
 Check user chat access. More...
 
 collectFeaturesForTargetUser ($a_target_user)
 Collect all features. More...
 
- Public Member Functions inherited from ilAwarenessFeatureProvider
 __construct ()
 Constructor. More...
 
 setUserId ($a_val)
 Set user id. More...
 
 getUserId ()
 Get user id. More...
 
 collectFeaturesForTargetUser ($a_target_user)
 Collect features for a target user. More...
 

Protected Attributes

 $pub_ref_id = 0
 
- Protected Attributes inherited from ilAwarenessFeatureProvider
 $user_id
 
 $lng
 
 $db
 

Static Protected Attributes

static $user_access = array()
 

Detailed Description

Adds link to chat feature.

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

Definition at line 14 of file class.ilAwarenessChatFeatureProvider.php.

Constructor & Destructor Documentation

◆ __construct()

ilAwarenessChatFeatureProvider::__construct ( )

Constructor.

Definition at line 22 of file class.ilAwarenessChatFeatureProvider.php.

References ilObjChatroom\_getPublicRefId().

23  {
24  parent::__construct();
25 
26  include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
27  $this->pub_ref_id = ilObjChatroom::_getPublicRefId();
28 
29  $chatSettings = new ilSetting('chatroom');
30  $this->chat_enabled = $chatSettings->get('chat_enabled');
31  }
ILIAS Setting Class.
+ Here is the call graph for this function:

Member Function Documentation

◆ checkUserChatAccess()

ilAwarenessChatFeatureProvider::checkUserChatAccess (   $a_user_id)

Check user chat access.

Parameters

Definition at line 39 of file class.ilAwarenessChatFeatureProvider.php.

Referenced by collectFeaturesForTargetUser().

40  {
41  global $rbacsystem;
42 
43  if (!isset(self::$user_access[$a_user_id]))
44  {
45  self::$user_access[$a_user_id] =
46  $rbacsystem->checkAccessOfUser($a_user_id, 'read', $this->pub_ref_id);
47  }
48  return self::$user_access[$a_user_id];
49  }
+ Here is the caller graph for this function:

◆ collectFeaturesForTargetUser()

ilAwarenessChatFeatureProvider::collectFeaturesForTargetUser (   $a_target_user)

Collect all features.

Parameters
int$a_target_usertarget user
Returns
ilAwarenessUserCollection collection

Definition at line 59 of file class.ilAwarenessChatFeatureProvider.php.

References checkUserChatAccess(), ilAwarenessFeatureCollection\getInstance(), and ilAwarenessFeatureProvider\getUserId().

60  {
62  include_once("./Services/Awareness/classes/class.ilAwarenessFeature.php");
63 
64  if (!$this->chat_enabled)
65  {
66  return $coll;
67  }
68 
69  if ($this->checkUserChatAccess($this->getUserId()))
70  {
71  // this check is not really needed anymore, since the current
72  // user will never be listed in the awareness tool
73  if ($a_target_user != $this->getUserId())
74  {
75  if ($this->checkUserChatAccess($a_target_user))
76  {
77  $f = new ilAwarenessFeature();
78  $f->setText($this->lng->txt('chat_invite_public_room'));
79  $f->setHref('./ilias.php?baseClass=ilRepositoryGUI&ref_id='.$this->pub_ref_id.
80  '&usr_id='.$a_target_user.'&cmd=view-invitePD');
81  //$this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_invite_public_room_tooltip'));
82  $coll->addFeature($f);
83  }
84  }
85  }
86 
87  return $coll;
88  }
checkUserChatAccess($a_user_id)
Check user chat access.
Awareness tool feature (presented in user drop downs) (data object)
+ Here is the call graph for this function:

Field Documentation

◆ $pub_ref_id

ilAwarenessChatFeatureProvider::$pub_ref_id = 0
protected

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

◆ $user_access

ilAwarenessChatFeatureProvider::$user_access = array()
staticprotected

Definition at line 16 of file class.ilAwarenessChatFeatureProvider.php.


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