45 $this->dataCache = $DIC[
'ilObjDataCache'];
47 $this->type = $this->objParticipants->getType();
48 $this->lng = $DIC[
'lng'];
58 $participants = $this->objParticipants->getParticipants();
59 foreach ($participants as $user_id) {
65 $publicName =
$name[
'lastname'] .
', ' .
$name[
'firstname'];
68 $this->
data[$user_id][
'user_id'] = $user_id;
69 $this->
data[$user_id][
'login'] = $login;
70 $this->
data[$user_id][
'name'] = $publicName;
72 $assignedRoles = $this->objParticipants->getAssignedRoles($user_id);
73 $this->dataCache->preloadObjectCache($assignedRoles);
75 foreach ($assignedRoles as $roleId) {
76 $title = $this->dataCache->lookupTitle($roleId);
80 $roleTitles = $this->
sortRoles($roleTitles);
83 $roleTitles = array_map(
function ($roleTitle) use ($that) {
84 return $that->buildRoleTitle($roleTitle);
87 $this->
data[$user_id][
'role'] = implode(
', ', $roleTitles);
98 usort($roleTitles,
function ($a, $b) use ($that) {
99 $leftPrefixTitle = substr($a, 0, 8);
100 $rightPrefixTitle = substr($b, 0, 8);
103 if (isset($that->roleSortWeightMap[$leftPrefixTitle])) {
104 $leftRating = $that->roleSortWeightMap[$leftPrefixTitle];
108 if (isset($that->roleSortWeightMap[$rightPrefixTitle])) {
109 $rightRating = $that->roleSortWeightMap[$rightPrefixTitle];
112 if ($leftRating > 0 || $rightRating > 0) {
113 if ($leftRating !== $rightRating) {
114 return $rightRating - $leftRating > 0 ? 1 : -1;
120 return strcmp($a, $b);
132 require_once
'Services/AccessControl/classes/class.ilObjRole.php';
133 return \ilObjRole::_getTranslation($role);
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
sortRoles(array $roleTitles)
__construct($objParticipants)
Create styles array
The data for the language used.
static _lookupPref($a_usr_id, $a_keyword)
Class ilMailMemberSearchDataProvider.