ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Awareness\User\ProviderMemberships Class Reference

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

+ Inheritance diagram for ILIAS\Awareness\User\ProviderMemberships:
+ Collaboration diagram for ILIAS\Awareness\User\ProviderMemberships:

Public Member Functions

 __construct (Container $DIC)
 
 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 (?array $user_ids=null)
 Get initial set of users. More...
 
 isHighlighted ()
 Is highlighted. More...
 

Protected Attributes

ilObjUser $user
 
ilLanguage $lng
 
ilDBInterface $db
 

Detailed Description

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

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Awareness\User\ProviderMemberships::__construct ( Container  $DIC)

Definition at line 33 of file class.ProviderMemberships.php.

References ILIAS\DI\Container\database(), ILIAS\DI\Container\language(), ILIAS\Repository\lng(), ILIAS\Repository\user(), and ILIAS\DI\Container\user().

34  {
35  $this->db = $DIC->database();
36  $this->lng = $DIC->language();
37  $this->user = $DIC->user();
38  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getInfo()

ILIAS\Awareness\User\ProviderMemberships::getInfo ( )

Provider info (used in administration settings)

Returns
string provider info text

Implements ILIAS\Awareness\User\Provider.

Definition at line 63 of file class.ProviderMemberships.php.

References ILIAS\Repository\lng().

63  : string
64  {
65  $this->lng->loadLanguageModule("crs");
66  return $this->lng->txt("mmbr_awrn_my_groups_courses_info");
67  }
+ Here is the call graph for this function:

◆ getInitialUserSet()

ILIAS\Awareness\User\ProviderMemberships::getInitialUserSet ( ?array  $user_ids = null)

Get initial set of users.

Parameters
?int[]$user_ids
Returns
int[] array of user IDs

Implements ILIAS\Awareness\User\Provider.

Definition at line 74 of file class.ProviderMemberships.php.

References ILIAS\Awareness\User\ProviderMemberships\$db, $ilDB, ilParticipants\_getMembershipByType(), ILIAS\Repository\int(), and ILIAS\Repository\user().

74  : array
75  {
76  $ilDB = $this->db;
77 
78  $groups_and_courses_of_user = \ilParticipants::_getMembershipByType(
79  $this->user->getId(),
80  ["grp", "crs"]
81  );
82 
83  $set = $ilDB->query(
84  "SELECT DISTINCT usr_id FROM obj_members " .
85  " WHERE " . $ilDB->in("obj_id", $groups_and_courses_of_user, false, "integer") . ' ' .
86  'AND (admin > ' . $ilDB->quote(0, 'integer') . ' ' .
87  'OR tutor > ' . $ilDB->quote(0, 'integer') . ' ' .
88  'OR member > ' . $ilDB->quote(0, 'integer') . ")"
89  );
90  $ub = array();
91  while ($rec = $ilDB->fetchAssoc($set)) {
92  $ub[] = (int) $rec["usr_id"];
93  }
94 
95  return $ub;
96  }
static _getMembershipByType(int $a_usr_id, array $a_type, bool $a_only_member_role=false)
get membership by type Get course or group membership
+ Here is the call graph for this function:

◆ getProviderId()

ILIAS\Awareness\User\ProviderMemberships::getProviderId ( )

Get provider id.

Returns
string provider id

Implements ILIAS\Awareness\User\Provider.

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

44  : string
45  {
46  return "mmbr_user_grpcrs";
47  }

◆ getTitle()

ILIAS\Awareness\User\ProviderMemberships::getTitle ( )

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

Returns
string provider title

Implements ILIAS\Awareness\User\Provider.

Definition at line 53 of file class.ProviderMemberships.php.

References ILIAS\Repository\lng().

53  : string
54  {
55  $this->lng->loadLanguageModule("mmbr");
56  return $this->lng->txt("mmbr_awrn_my_groups_courses");
57  }
+ Here is the call graph for this function:

◆ isHighlighted()

ILIAS\Awareness\User\ProviderMemberships::isHighlighted ( )

Is highlighted.

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

Implements ILIAS\Awareness\User\Provider.

Definition at line 98 of file class.ProviderMemberships.php.

98  : bool
99  {
100  return false;
101  }

Field Documentation

◆ $db

ilDBInterface ILIAS\Awareness\User\ProviderMemberships::$db
protected

◆ $lng

ilLanguage ILIAS\Awareness\User\ProviderMemberships::$lng
protected

Definition at line 30 of file class.ProviderMemberships.php.

◆ $user

ilObjUser ILIAS\Awareness\User\ProviderMemberships::$user
protected

Definition at line 29 of file class.ProviderMemberships.php.


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