Class ilMailMemberSearchDataProvider.
More...
◆ __construct()
ilMailMemberSearchDataProvider::__construct |
( |
|
$objParticipants | ) |
|
◆ buildRoleTitle()
ilMailMemberSearchDataProvider::buildRoleTitle |
( |
|
$role | ) |
|
|
private |
- Parameters
-
- Returns
- string
Definition at line 130 of file class.ilMailMemberSearchDataProvider.php.
132 require_once
'Services/AccessControl/classes/class.ilObjRole.php';
133 return \ilObjRole::_getTranslation($role);
◆ collectTableData()
ilMailMemberSearchDataProvider::collectTableData |
( |
| ) |
|
|
private |
Definition at line 56 of file class.ilMailMemberSearchDataProvider.php.
References $name, $title, ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilObjUser\_lookupPref(), array, data, and sortRoles().
Referenced by __construct().
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);
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
sortRoles(array $roleTitles)
Create styles array
The data for the language used.
static _lookupPref($a_usr_id, $a_keyword)
◆ getData()
ilMailMemberSearchDataProvider::getData |
( |
| ) |
|
◆ sortRoles()
ilMailMemberSearchDataProvider::sortRoles |
( |
array |
$roleTitles | ) |
|
|
private |
- Parameters
-
- Returns
- string[]
Definition at line 95 of file class.ilMailMemberSearchDataProvider.php.
Referenced by collectTableData().
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);
◆ $data
ilMailMemberSearchDataProvider::$data = array() |
|
protected |
◆ $dataCache
ilMailMemberSearchDataProvider::$dataCache |
|
protected |
◆ $lng
ilMailMemberSearchDataProvider::$lng |
|
protected |
◆ $objParticipants
ilMailMemberSearchDataProvider::$objParticipants = null |
|
protected |
◆ $roleSortWeightMap
ilMailMemberSearchDataProvider::$roleSortWeightMap |
|
protected |
◆ $type
ilMailMemberSearchDataProvider::$type = 'crs' |
|
protected |
The documentation for this class was generated from the following file: