Get data.
144 : array
145 {
147 return [
148 "data" => [],
149 "cnt" => "0:0"
150 ];
151 }
153 $max = $awrn_set->
get(
"max_nr_entries");
154
155 $all_user_ids = array();
156 $hall_user_ids = array();
157
158 if ($this->data == null) {
159 $online_users = $this->user_collector->getOnlineUsers();
160
162
163 $this->data = array();
164
166
167
168 if (count($this->data) >= $max) {
169 continue;
170 }
171
172 $user_collection = $uc["collection"];
173 $user_ids = $user_collection->getUsers();
174
175 foreach ($user_ids as $uid) {
176 if (!in_array($uid, $all_user_ids)) {
177 if ($uc["highlighted"]) {
178 $hall_user_ids[] = $uid;
179 } else {
180 $all_user_ids[] = $uid;
181 }
182 }
183 }
184
186 $user_ids,
187 true,
188 false,
189 "",
190 false,
191 false,
192 true,
193 true
194 );
195
196
197 foreach ($names as $k => $n) {
198 if (isset($online_users[$n["id"]])) {
199 $names[$k]["online"] = true;
200 $names[$k]["last_login"] = $online_users[$n["id"]]["last_login"];
201 $sort_str = "1";
202 } else {
203 $names[$k]["online"] = false;
204 $names[$k]["last_login"] = "";
205 $sort_str = "2";
206 }
207 if ($n["public_profile"]) {
208 $sort_str .= $n["lastname"] . " " . $n["firstname"];
209 } else {
210 $sort_str .= $n["login"];
211 }
212 $names[$k]["sort_str"] = $sort_str;
213 }
214
216
217 foreach ($names as $n) {
218
219 if (count($this->data) >= $max) {
220 continue;
221 }
222
223
224 $filter = trim($filter);
225 if ($filter != "" &&
226 !is_int(stripos($n["login"], $filter)) &&
227 (
228 !$n["public_profile"] || (
229 !is_int(stripos($n["firstname"], $filter)) &&
230 !is_int(stripos($n["lastname"], $filter))
231 )
232 )
233 ) {
234 continue;
235 }
236
237 $obj = new \stdClass();
238 $obj->lastname = $n["lastname"];
239 $obj->firstname = $n["firstname"];
240 $obj->login = $n["login"];
241 $obj->id = $n["id"];
242 $obj->collector = $uc["uc_title"];
243 $obj->highlighted = $uc["highlighted"];
244
245
247 $obj->public_profile = $n["public_profile"];
248
249 $obj->online = $n["online"];
250 $obj->last_login = $n["last_login"];
251
252
253 $action_collection = $this->action_collector->getActionsForTargetUser($n["id"]);
254 $obj->actions = array();
255 foreach ($action_collection->getActions() as $action) {
256 $f = new \stdClass();
257 $f->text = $action->getText();
258 $f->href = $action->getHref();
259 $f->data = $action->getData();
260 $obj->actions[] =
$f;
261 }
262
263 $this->data[] = $obj;
264 }
265 }
266 }
267
268
270 count($all_user_ids),
271 count($hall_user_ids)
272 );
273
274 return array("data" => $this->data, "cnt" => count($all_user_ids) . ":" . count($hall_user_ids));
275 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
get(string $a_keyword, ?string $a_default_value=null)
get setting
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is: