32 $this->user_id = $a_user_id;
34 include_once(
"./Services/Awareness/classes/class.ilAwarenessUserCollector.php");
36 include_once(
"./Services/User/Actions/classes/class.ilUserActionCollector.php");
47 $this->ref_id = $a_val;
67 $this->filter = $a_val;
97 if (!isset(self::$instances[$a_user_id]))
102 return self::$instances[$a_user_id];
115 if (!isset($this->user_collections[(
int) $a_online_only]))
117 $this->user_collector->setRefId($this->
getRefId());
118 $this->user_collections[(int) $a_online_only] = $this->user_collector->collectUsers($a_online_only);
121 return $this->user_collections[(int) $a_online_only];
129 $all_user_ids =
array();
130 $hall_user_ids =
array();
134 foreach ($user_collections as $uc)
139 foreach ($user_ids as $uid)
141 if (!in_array($uid, $all_user_ids))
143 if ($uc[
"highlighted"])
145 $hall_user_ids[] = $uid;
149 $all_user_ids[] = $uid;
155 return count($all_user_ids).
":".count($hall_user_ids);
169 $all_online_user_ids =
array();
171 foreach ($user_collections as $uc)
175 foreach ($user_ids as $u)
177 if (!in_array($u, $all_online_user_ids))
180 if (($a_ts ==
"" || $online_users[$u][
"last_login"] > $a_ts)
183 $all_online_user_ids[] = $u;
189 include_once(
"./Services/User/classes/class.ilUserUtil.php");
191 false,
"",
false,
false,
true,
true);
196 $names[$k][
"online"] =
true;
197 $names[$k][
"last_login"] = $online_users[
$n[
"id"]][
"last_login"];
199 if ($n[
"public_profile"])
201 $sort_str.= $n[
"lastname"].
" ".$n[
"firstname"];
205 $sort_str.= $n[
"login"];
207 $names[$k][
"sort_str"] = $sort_str;
215 $obj->lastname = $n[
"lastname"];
216 $obj->firstname = $n[
"firstname"];
217 $obj->login = $n[
"login"];
219 $obj->public_profile = $n[
"public_profile"];
220 $obj->online = $n[
"online"];
221 $obj->last_login = $n[
"last_login"];;
237 $max = $awrn_set->get(
"max_nr_entries");
239 $all_user_ids =
array();
240 $hall_user_ids =
array();
242 if ($this->
data == null)
250 foreach ($user_collections as $uc)
254 if (count($this->
data) >= $max)
262 foreach ($user_ids as $uid)
264 if (!in_array($uid, $all_user_ids))
266 if ($uc[
"highlighted"])
268 $hall_user_ids[] = $uid;
272 $all_user_ids[] = $uid;
277 include_once(
"./Services/User/classes/class.ilUserUtil.php");
279 false,
"",
false,
false,
true,
true);
284 if (isset($online_users[
$n[
"id"]]))
286 $names[$k][
"online"] =
true;
287 $names[$k][
"last_login"] = $online_users[$n[
"id"]][
"last_login"];
292 $names[$k][
"online"] =
false;
293 $names[$k][
"last_login"] =
"";
296 if ($n[
"public_profile"])
298 $sort_str.= $n[
"lastname"].
" ".$n[
"firstname"];
302 $sort_str.= $n[
"login"];
304 $names[$k][
"sort_str"] = $sort_str;
312 if (count($this->
data) >= $max)
320 !is_int(stripos($n[
"login"],
$filter)) &&
321 (!$n[
"public_profile"] || (
322 !is_int(stripos($n[
"firstname"],
$filter)) &&
323 !is_int(stripos($n[
"lastname"],
$filter))
332 $obj->lastname = $n[
"lastname"];
333 $obj->firstname = $n[
"firstname"];
334 $obj->login = $n[
"login"];
336 $obj->collector = $uc[
"uc_title"];
337 $obj->highlighted = $uc[
"highlighted"];
341 $obj->public_profile = $n[
"public_profile"];
343 $obj->online = $n[
"online"];
344 $obj->last_login = $n[
"last_login"];;
347 $action_collection = $this->action_collector->getActionsForTargetUser($n[
"id"],
"awrn",
"toplist");
348 $obj->actions =
array();
349 foreach ($action_collection->getActions() as $action)
352 $f->text = $action->getText();
353 $f->href = $action->getHref();
354 $f->data = $action->getData();
355 $obj->actions[] = $f;
358 $this->
data[] = $obj;
363 return array(
"data" => $this->
data,
"cnt" => count($all_user_ids).
":".count($hall_user_ids));
setRefId($a_val)
Set ref id.
static getInstance($a_user_id)
Get instance (for a user)
getOnlineUserData($a_ts="")
Get online user data.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
setFilter($a_val)
Set filter.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
Create styles array
The data for the language used.
getUserCollections($a_online_only=false)
Get user collections.
static _getPersonalPicturePath($a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
__construct($a_user_id)
Constructor.
static getInstance($a_user_id)
Get instance (for a user)
getUserCounter()
Get user counter.
static getInstance($a_user_id)
Get instance (for a user)
static getOnlineUsers()
Get online users.
getMaxOnlineUserCnt()
Maximum for online user data.