Get data.
151 : array
152 {
154 return [
155 "data" => [],
156 "cnt" => "0:0"
157 ];
158 }
160 $max = $awrn_set->
get(
"max_nr_entries");
161
162 $all_user_ids = array();
163 $hall_user_ids = array();
164
165 if ($this->data == null) {
166 $online_users = $this->user_collector->getOnlineUsers();
167
169
170 $this->data = array();
171
173
174 if (count($this->data) >= $max) {
175 continue;
176 }
177
178 $user_collection = $uc["collection"];
179 $user_ids = $user_collection->getUsers();
180
181 foreach ($user_ids as $uid) {
182 if (!in_array($uid, $all_user_ids)) {
183 if ($uc["highlighted"]) {
184 $hall_user_ids[] = $uid;
185 } else {
186 $all_user_ids[] = $uid;
187 }
188 }
189 }
190
192 $user_ids,
193 true,
194 false,
195 "",
196 false,
197 false,
198 true,
199 true
200 );
201
202
203 foreach ($names as $k => $n) {
204 if (isset($online_users[$n["id"]])) {
205 $names[$k]["online"] = true;
206 $names[$k]["last_login"] = $online_users[$n["id"]]["last_login"];
207 $sort_str = "1";
208 } else {
209 $names[$k]["online"] = false;
210 $names[$k]["last_login"] = "";
211 $sort_str = "2";
212 }
213 if ($n["public_profile"]) {
214 $sort_str .= $n["lastname"] . " " . $n["firstname"];
215 } else {
216 $sort_str .= $n["login"];
217 }
218 $names[$k]["sort_str"] = $sort_str;
219 }
220
222
223 foreach ($names as $n) {
224
225 if (count($this->data) >= $max) {
226 continue;
227 }
228
229
230 $filter = trim($filter);
231 if ($filter != "" &&
232 !is_int(stripos($n["login"], $filter)) &&
233 (
234 !$n["public_profile"] || (
235 !is_int(stripos($n["firstname"], $filter)) &&
236 !is_int(stripos($n["lastname"], $filter))
237 )
238 )
239 ) {
240 continue;
241 }
242
243 $obj = new \stdClass();
244 $obj->lastname = $n["lastname"];
245 $obj->firstname = $n["firstname"];
246 $obj->login = $n["login"];
247 $obj->id = $n["id"];
248 $obj->collector = $uc["uc_title"];
249 $obj->highlighted = $uc["highlighted"];
250
251
253 $obj->public_profile = $n["public_profile"];
254
255 $obj->online = $n["online"];
256 $obj->last_login = $n["last_login"];
257
258
259 $action_collection = $this->action_collector->getActionsForTargetUser($n["id"]);
260 $obj->actions = array();
261 foreach ($action_collection->getActions() as $action) {
262 $f = new \stdClass();
263 $f->text = $action->getText();
264 $f->href = $action->getHref();
265 $f->data = $action->getData();
266 $obj->actions[] =
$f;
267 }
268
269 $this->data[] = $obj;
270 }
271 }
272 }
273
274
276 count($all_user_ids),
277 count($hall_user_ids)
278 );
279
280 return array("data" => $this->data, "cnt" => count($all_user_ids) . ":" . count($hall_user_ids));
281 }
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)
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=null)
Default behaviour is: