68 {
70
72
74 {
75 foreach ($this->response as $item) {
76 $userIdent = str_replace('mailto:', '', $item['mbox']);
77 if (empty($userIdent))
78 {
79 $userIdent = $item['account'];
80 }
81 $cmixUser = $this->cmixUsersByIdent[$userIdent];
83 'user_ident' => $userIdent,
84 'user' => '',
87 'score' => $item['score']['scaled'],
88 'ilias_user_id' => $cmixUser->getUsrId()
89 ];
90 }
91 }
93 {
94 foreach ($this->response as $item) {
95 $userIdent = $item['account'];
96 $cmixUser = $this->cmixUsersByIdent[$userIdent];
98 'user_ident' => $userIdent,
99 'user' => '',
102 'score' => $item['score']['scaled'],
103 'ilias_user_id' => $cmixUser->getUsrId()
104 ];
105 }
106 }
107 else
108 {
109 foreach ($this->response as $item) {
110 $userIdent = str_replace('mailto:', '', $item['mbox']);
111 $cmixUser = $this->cmixUsersByIdent[$userIdent];
113 'user_ident' => $userIdent,
114 'user' => '',
117 'score' => $item['score']['scaled'],
118 'ilias_user_id' => $cmixUser->getUsrId()
119 ];
120 }
121 }
123 return $a[
'score'] !=
$b[
'score'] ?
$a[
'score'] >
$b[
'score'] ? -1 : 1 : 0;
124 });
125
127 $prevScore = null;
128
129 $retArr = [];
130 foreach (
$rows as $key => $item) {
131 if ($prevScore !== $item['score']) {
133 }
135 $prevScore =
$rows[$key][
'score'];
136
137 if (null === $this->userRank) {
138
139 $userIdent = str_replace(
'mailto:',
'',
$rows[$key][
'user_ident']);
140 $cmixUser = $this->cmixUsersByIdent[$userIdent];
141 if ($cmixUser->getUsrId() ==
$DIC->user()->getId()) {
142 $this->userRank = $key;
144 $rows[$key][
'user'] = $userObj->getFullname();
145 }
146 $retArr[$key] =
$rows[$key];
147 } else {
148
149 $rows[$key][
'user_ident'] =
false;
150 $retArr[$key] =
$rows[$key];
151 }
152 }
153 $this->tableData = $retArr;
154 return true;
155 }
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