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

A class that provides a collection of users for the awareness tool. More...

+ Inheritance diagram for ilAwarenessUserProvider:
+ Collaboration diagram for ilAwarenessUserProvider:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setActivationMode ($a_val)
 Activate provider. More...
 
 getActivationMode ()
 Get Activate provider. More...
 
 setUserId ($a_val)
 Set user id. More...
 
 getUserId ()
 Get user id. More...
 
 setRefId ($a_val)
 Set ref id. More...
 
 getRefId ()
 Get ref id. More...
 
 setOnlineUserFilter ($a_val)
 Set online user filter. More...
 
 getOnlineUserFilter ()
 Get online user filter. More...
 
 getProviderId ()
 This should return a unique id for the provider The ID should start with the service/module id, separated by "_" and a second part that is unique within the module/service, e.g. More...
 
 getTitle ()
 Provider title (used in awareness overlay and in administration settings) More...
 
 getInfo ()
 Provider info (used in administration settings) More...
 
 getInitialUserSet ()
 Get initial set of users. More...
 
 collectUsers ()
 Collect all users. More...
 
 isHighlighted ()
 Is highlighted. More...
 

Data Fields

const MODE_INACTIVE = 0
 
const MODE_ONLINE_ONLY = 1
 
const MODE_INCL_OFFLINE = 2
 

Protected Member Functions

 addUserToCollection ($a_user_id, ilAwarenessUserCollection $a_collection)
 Add user to collection. More...
 

Protected Attributes

 $user_id
 
 $ref_id
 
 $lng
 
 $db
 
 $online_user_filter = false
 

Detailed Description

A class that provides a collection of users for the awareness tool.

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

Definition at line 12 of file class.ilAwarenessUserProvider.php.

Constructor & Destructor Documentation

◆ __construct()

ilAwarenessUserProvider::__construct ( )

Constructor.

Definition at line 27 of file class.ilAwarenessUserProvider.php.

References $ilDB, and $lng.

28  {
29  global $lng, $ilDB;
30 
31  $this->lng = $lng;
32  $this->db = $ilDB;
33  $this->settings = new ilSetting("awrn");
34  }
ILIAS Setting Class.
global $ilDB

Member Function Documentation

◆ addUserToCollection()

ilAwarenessUserProvider::addUserToCollection (   $a_user_id,
ilAwarenessUserCollection  $a_collection 
)
protected

Add user to collection.

Parameters
int$a_user_iduser id
ilAwarenessUserCollection$a_collectioncollection

Definition at line 169 of file class.ilAwarenessUserProvider.php.

References ilAwarenessUserCollection\addUser(), getOnlineUserFilter(), and getUserId().

Referenced by collectUsers().

170  {
171  $ou = $this->getOnlineUserFilter();
172  if ($this->getUserId() != $a_user_id && ($ou === false || in_array($a_user_id, $ou)))
173  {
174  $a_collection->addUser($a_user_id);
175  }
176  }
getOnlineUserFilter()
Get online user filter.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collectUsers()

ilAwarenessUserProvider::collectUsers ( )

Collect all users.

Returns
ilAwarenessUserCollection collection

Definition at line 151 of file class.ilAwarenessUserProvider.php.

References addUserToCollection(), getInitialUserSet(), and ilAwarenessUserCollection\getInstance().

152  {
154 
155  foreach ($this->getInitialUserSet() as $u)
156  {
157  $this->addUserToCollection($u, $coll);
158  }
159 
160  return $coll;
161  }
getInitialUserSet()
Get initial set of users.
addUserToCollection($a_user_id, ilAwarenessUserCollection $a_collection)
Add user to collection.
+ Here is the call graph for this function:

◆ getActivationMode()

ilAwarenessUserProvider::getActivationMode ( )

Get Activate provider.

Returns
boolean activate provider

Definition at line 51 of file class.ilAwarenessUserProvider.php.

References getProviderId().

52  {
53  return (int) $this->settings->get("up_act_".$this->getProviderId());
54  }
getProviderId()
This should return a unique id for the provider The ID should start with the service/module id...
+ Here is the call graph for this function:

◆ getInfo()

ilAwarenessUserProvider::getInfo ( )
abstract

Provider info (used in administration settings)

Returns
string provider info text

Referenced by getOnlineUserFilter().

+ Here is the caller graph for this function:

◆ getInitialUserSet()

ilAwarenessUserProvider::getInitialUserSet ( )
abstract

Get initial set of users.

Returns
array array of user IDs

Referenced by collectUsers(), ilAwarenessUserProviderContactRequests\getInfo(), ilAwarenessUserProviderApprovedContacts\getInfo(), and getOnlineUserFilter().

+ Here is the caller graph for this function:

◆ getOnlineUserFilter()

ilAwarenessUserProvider::getOnlineUserFilter ( )

Get online user filter.

Returns
array array of user IDs | false if online status is not relevant

Definition at line 111 of file class.ilAwarenessUserProvider.php.

References $online_user_filter, getInfo(), getInitialUserSet(), getProviderId(), and getTitle().

Referenced by addUserToCollection(), and ilAwarenessUserProviderAllUsers\getInitialUserSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProviderId()

ilAwarenessUserProvider::getProviderId ( )
abstract

This should return a unique id for the provider The ID should start with the service/module id, separated by "_" and a second part that is unique within the module/service, e.g.

"user_all"

Returns
string provider id

Referenced by getActivationMode(), getOnlineUserFilter(), and setActivationMode().

+ Here is the caller graph for this function:

◆ getRefId()

ilAwarenessUserProvider::getRefId ( )

Get ref id.

Returns
int ref id

Definition at line 91 of file class.ilAwarenessUserProvider.php.

References $ref_id.

Referenced by ilAwarenessUserProviderCurrentCourse\getInitialUserSet().

+ Here is the caller graph for this function:

◆ getTitle()

ilAwarenessUserProvider::getTitle ( )
abstract

Provider title (used in awareness overlay and in administration settings)

Returns
string provider title

Referenced by getOnlineUserFilter().

+ Here is the caller graph for this function:

◆ getUserId()

ilAwarenessUserProvider::getUserId ( )

Get user id.

Returns
int user id

Definition at line 71 of file class.ilAwarenessUserProvider.php.

References $user_id.

Referenced by addUserToCollection(), ilAwarenessUserProviderMemberships\getInitialUserSet(), and ilAwarenessUserProviderCourseContacts\getInitialUserSet().

+ Here is the caller graph for this function:

◆ isHighlighted()

ilAwarenessUserProvider::isHighlighted ( )

Is highlighted.

Returns
bool return true, if user group should be highlighted (using extra highlighted number)

Definition at line 183 of file class.ilAwarenessUserProvider.php.

184  {
185  return false;
186  }

◆ setActivationMode()

ilAwarenessUserProvider::setActivationMode (   $a_val)

Activate provider.

Parameters
boolean$a_valactivate provider

Definition at line 41 of file class.ilAwarenessUserProvider.php.

References getProviderId().

42  {
43  $this->settings->set("up_act_".$this->getProviderId(), (int) $a_val);
44  }
getProviderId()
This should return a unique id for the provider The ID should start with the service/module id...
+ Here is the call graph for this function:

◆ setOnlineUserFilter()

ilAwarenessUserProvider::setOnlineUserFilter (   $a_val)

Set online user filter.

Parameters
array$a_valarray of user IDs | false if online status is not relevant

Definition at line 101 of file class.ilAwarenessUserProvider.php.

102  {
103  $this->online_user_filter = $a_val;
104  }

◆ setRefId()

ilAwarenessUserProvider::setRefId (   $a_val)

Set ref id.

Parameters
int$a_valref id

Definition at line 81 of file class.ilAwarenessUserProvider.php.

82  {
83  $this->ref_id = $a_val;
84  }

◆ setUserId()

ilAwarenessUserProvider::setUserId (   $a_val)

Set user id.

Parameters
int$a_valuser id

Definition at line 61 of file class.ilAwarenessUserProvider.php.

62  {
63  $this->user_id = $a_val;
64  }

Field Documentation

◆ $db

ilAwarenessUserProvider::$db
protected

Definition at line 21 of file class.ilAwarenessUserProvider.php.

◆ $lng

ilAwarenessUserProvider::$lng
protected

Definition at line 20 of file class.ilAwarenessUserProvider.php.

Referenced by __construct().

◆ $online_user_filter

ilAwarenessUserProvider::$online_user_filter = false
protected

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

Referenced by getOnlineUserFilter().

◆ $ref_id

ilAwarenessUserProvider::$ref_id
protected

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

Referenced by getRefId().

◆ $user_id

ilAwarenessUserProvider::$user_id
protected

Definition at line 18 of file class.ilAwarenessUserProvider.php.

Referenced by getUserId().

◆ MODE_INACTIVE

const ilAwarenessUserProvider::MODE_INACTIVE = 0

◆ MODE_INCL_OFFLINE

const ilAwarenessUserProvider::MODE_INCL_OFFLINE = 2

◆ MODE_ONLINE_ONLY

const ilAwarenessUserProvider::MODE_ONLINE_ONLY = 1

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