ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilAwarenessUserProviderMemberships Class Reference

All members of the same courses/groups as the user. More...

+ Inheritance diagram for ilAwarenessUserProviderMemberships:
+ Collaboration diagram for ilAwarenessUserProviderMemberships:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getProviderId ()
 Get provider id. 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...
 
- Public Member Functions inherited from ilAwarenessUserProvider
 __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...
 

Additional Inherited Members

- Data Fields inherited from ilAwarenessUserProvider
const MODE_INACTIVE = 0
 
const MODE_ONLINE_ONLY = 1
 
const MODE_INCL_OFFLINE = 2
 
- Protected Member Functions inherited from ilAwarenessUserProvider
 addUserToCollection ($a_user_id, ilAwarenessUserCollection $a_collection)
 Add user to collection. More...
 
- Protected Attributes inherited from ilAwarenessUserProvider
 $user_id
 
 $ref_id
 
 $lng
 
 $db
 
 $online_user_filter = false
 
 $log
 

Detailed Description

All members of the same courses/groups as the user.

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.ilAwarenessUserProviderMemberships.php.

Constructor & Destructor Documentation

◆ __construct()

ilAwarenessUserProviderMemberships::__construct ( )

Constructor.

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

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

21  {
22  global $DIC;
23 
25 
26  $this->db = $DIC->database();
27  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ getInfo()

ilAwarenessUserProviderMemberships::getInfo ( )

Provider info (used in administration settings)

Returns
string provider info text

Definition at line 55 of file class.ilAwarenessUserProviderMemberships.php.

56  {
57  $this->lng->loadLanguageModule("crs");
58  return $this->lng->txt("mmbr_awrn_my_groups_courses_info");
59  }

◆ getInitialUserSet()

ilAwarenessUserProviderMemberships::getInitialUserSet ( )

Get initial set of users.

Returns
array array of user IDs

Definition at line 66 of file class.ilAwarenessUserProviderMemberships.php.

References ilAwarenessUserProvider\$db, $ilDB, ilParticipants\_getMembershipByType(), and ilAwarenessUserProvider\getUserId().

67  {
68  $ilDB = $this->db;
69 
70  $groups_and_courses_of_user = ilParticipants::_getMembershipByType($this->getUserId(), array("grp", "crs"));
71 
72  $set = $ilDB->query(
73  "SELECT DISTINCT usr_id FROM obj_members " .
74  " WHERE " . $ilDB->in("obj_id", $groups_and_courses_of_user, false, "integer") . ' ' .
75  'AND (admin > ' . $ilDB->quote(0, 'integer') . ' ' .
76  'OR tutor > ' . $ilDB->quote(0, 'integer') . ' ' .
77  'OR member > ' . $ilDB->quote(0, 'integer') . ")"
78  );
79  $ub = array();
80  while ($rec = $ilDB->fetchAssoc($set)) {
81  $ub[] = $rec["usr_id"];
82  }
83 
84  return $ub;
85  }
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
global $ilDB
+ Here is the call graph for this function:

◆ getProviderId()

ilAwarenessUserProviderMemberships::getProviderId ( )

Get provider id.

Returns
string provider id

Definition at line 34 of file class.ilAwarenessUserProviderMemberships.php.

35  {
36  return "mmbr_user_grpcrs";
37  }

◆ getTitle()

ilAwarenessUserProviderMemberships::getTitle ( )

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

Returns
string provider title

Definition at line 44 of file class.ilAwarenessUserProviderMemberships.php.

45  {
46  $this->lng->loadLanguageModule("mmbr");
47  return $this->lng->txt("mmbr_awrn_my_groups_courses");
48  }

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