68 {
70
72
74 foreach ($this->response as $item) {
75 $userIdent = str_replace('mailto:', '', $item['mbox']);
76 if (empty($userIdent)) {
77 $userIdent = $item['account'];
78 }
79 $cmixUser = $this->cmixUsersByIdent[$userIdent];
81 'user_ident' => $userIdent,
82 'user' => '',
85 'score' => $item['score']['scaled'],
86 'ilias_user_id' => $cmixUser->getUsrId()
87 ];
88 }
90 foreach ($this->response as $item) {
91 $userIdent = $item['account'];
92 $cmixUser = $this->cmixUsersByIdent[$userIdent];
94 'user_ident' => $userIdent,
95 'user' => '',
98 'score' => $item['score']['scaled'],
99 'ilias_user_id' => $cmixUser->getUsrId()
100 ];
101 }
102 } else {
103 foreach ($this->response as $item) {
104 $userIdent = str_replace('mailto:', '', $item['mbox']);
105 $cmixUser = $this->cmixUsersByIdent[$userIdent];
107 'user_ident' => $userIdent,
108 'user' => '',
111 'score' => $item['score']['scaled'],
112 'ilias_user_id' => $cmixUser->getUsrId()
113 ];
114 }
115 }
117 return $a[
'score'] !=
$b[
'score'] ?
$a[
'score'] >
$b[
'score'] ? -1 : 1 : 0;
118 });
119
121 $prevScore = null;
122
123 $retArr = [];
124 foreach (
$rows as $key => $item) {
125 if ($prevScore !== $item['score']) {
127 }
129 $prevScore =
$rows[$key][
'score'];
130
131 if (null === $this->userRank) {
132
133 $userIdent = str_replace(
'mailto:',
'',
$rows[$key][
'user_ident']);
134 $cmixUser = $this->cmixUsersByIdent[$userIdent];
135 if ($cmixUser->getUsrId() ==
$DIC->user()->getId()) {
136 $this->userRank = $key;
138 $rows[$key][
'user'] = $userObj->getFullname();
139 }
140 $retArr[$key] =
$rows[$key];
141 } else {
142
143 $rows[$key][
'user_ident'] =
false;
144 $retArr[$key] =
$rows[$key];
145 }
146 }
147 $this->tableData = $retArr;
148 return true;
149 }
fetchTotalDuration($allDurations)
formatRawTimestamp($rawTimestamp)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples