61 : void
62 {
63 $participants = $this->objParticipants->getParticipants();
64 if ($this->type === 'crs' || $this->type === 'grp') {
65 $participants = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
66 'read',
67 'manage_members',
68 $this->ref_id,
69 $participants
70 );
71 }
72
73 $preloadedRoleIds = [];
74 foreach ($participants as $user_id) {
76 if (!$user || !($user instanceof
ilObjUser)) {
77 continue;
78 }
79
80 if (!$user->getActive()) {
81 continue;
82 }
83
84 $login = $user->getLogin();
85
86 $publicName = '';
87 if (in_array($user->getPref('public_profile'), ['g', 'y'])) {
88 $publicName = $user->getLastname() . ', ' . $user->getFirstname();
89 }
90
91 $this->data[$user_id]['user_id'] = $user_id;
92 $this->data[$user_id][
'login'] =
$login;
93 $this->data[$user_id]['name'] = $publicName;
94
95 $assignedRoles = $this->objParticipants->getAssignedRoles($user_id);
96 $rolesToPreload = array_diff($assignedRoles, $preloadedRoleIds);
97 $this->dataCache->preloadObjectCache($rolesToPreload);
98
99 $roleTitles = [];
100 foreach ($assignedRoles as $roleId) {
101 $preloadedRoleIds[$roleId] = $roleId;
102 $title = $this->dataCache->lookupTitle($roleId);
103 $roleTitles[] = $title;
104 }
105
106 $roleTitles = $this->
sortRoles($roleTitles);
107
108 $roleTitles = array_map(function (string $roleTitle) : string {
110 }, $roleTitles);
111
112 $this->data[$user_id]['role'] = implode(', ', $roleTitles);
113 }
114 }
buildRoleTitle(string $role)
sortRoles(array $roleTitles)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id