ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
 
 $log
 

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 32 of file class.ilAwarenessUserProvider.php.

References $ilDB, $lng, ilLoggerFactory\getLogger(), and settings().

33  {
34  global $lng, $ilDB;
35 
36  $this->lng = $lng;
37  $this->db = $ilDB;
38  $this->settings = new ilSetting("awrn");
39  $this->log = ilLoggerFactory::getLogger('awrn');
40  }
ILIAS Setting Class.
settings()
Definition: settings.php:2
global $ilDB
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

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 175 of file class.ilAwarenessUserProvider.php.

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

Referenced by collectUsers().

176  {
177  $ou = $this->getOnlineUserFilter();
178  if ($this->getUserId() != $a_user_id && ($ou === false || in_array($a_user_id, $ou)))
179  {
180  $a_collection->addUser($a_user_id);
181  }
182  }
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 157 of file class.ilAwarenessUserProvider.php.

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

158  {
160 
161  foreach ($this->getInitialUserSet() as $u)
162  {
163  $this->addUserToCollection($u, $coll);
164  }
165 
166  return $coll;
167  }
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 57 of file class.ilAwarenessUserProvider.php.

References getProviderId(), and settings().

58  {
59  return (int) $this->settings->get("up_act_".$this->getProviderId());
60  }
settings()
Definition: settings.php:2
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(), 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 117 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 97 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 77 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 189 of file class.ilAwarenessUserProvider.php.

190  {
191  return false;
192  }

◆ setActivationMode()

ilAwarenessUserProvider::setActivationMode (   $a_val)

Activate provider.

Parameters
boolean$a_valactivate provider

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

References getProviderId(), and settings().

48  {
49  $this->settings->set("up_act_".$this->getProviderId(), (int) $a_val);
50  }
settings()
Definition: settings.php:2
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 107 of file class.ilAwarenessUserProvider.php.

108  {
109  $this->online_user_filter = $a_val;
110  }

◆ setRefId()

ilAwarenessUserProvider::setRefId (   $a_val)

Set ref id.

Parameters
int$a_valref id

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

88  {
89  $this->ref_id = $a_val;
90  }

◆ setUserId()

ilAwarenessUserProvider::setUserId (   $a_val)

Set user id.

Parameters
int$a_valuser id

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

68  {
69  $this->user_id = $a_val;
70  }

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

◆ $log

ilAwarenessUserProvider::$log
protected

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

◆ $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

◆ $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: