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");
37 include_once(
"./Services/Awareness/classes/class.ilAwarenessUserActionContext.php");
48 $this->ref_id = $a_val;
68 $this->filter = $a_val;
98 if (!isset(self::$instances[$a_user_id])) {
102 return self::$instances[$a_user_id];
115 if (!isset($this->user_collections[(
int) $a_online_only])) {
116 $this->user_collector->setRefId($this->
getRefId());
117 $this->user_collections[(int) $a_online_only] = $this->user_collector->collectUsers($a_online_only);
120 return $this->user_collections[(int) $a_online_only];
128 $all_user_ids =
array();
129 $hall_user_ids =
array();
133 foreach ($user_collections as $uc) {
137 foreach ($user_ids as $uid) {
138 if (!in_array($uid, $all_user_ids)) {
139 if ($uc[
"highlighted"]) {
140 $hall_user_ids[] = $uid;
142 $all_user_ids[] = $uid;
148 return count($all_user_ids) .
":" . count($hall_user_ids);
162 $all_online_user_ids =
array();
164 foreach ($user_collections as $uc) {
167 foreach ($user_ids as $u) {
168 if (!in_array($u, $all_online_user_ids)) {
170 if (($a_ts ==
"" || $online_users[$u][
"last_login"] > $a_ts)
172 $all_online_user_ids[] = $u;
178 include_once(
"./Services/User/classes/class.ilUserUtil.php");
180 $all_online_user_ids,
192 $names[$k][
"online"] =
true;
193 $names[$k][
"last_login"] = $online_users[
$n[
"id"]][
"last_login"];
195 if ($n[
"public_profile"]) {
196 $sort_str.= $n[
"lastname"] .
" " . $n[
"firstname"];
198 $sort_str.= $n[
"login"];
200 $names[$k][
"sort_str"] = $sort_str;
207 $obj->lastname = $n[
"lastname"];
208 $obj->firstname = $n[
"firstname"];
209 $obj->login = $n[
"login"];
211 $obj->public_profile = $n[
"public_profile"];
212 $obj->online = $n[
"online"];
213 $obj->last_login = $n[
"last_login"];
229 if ($this->user_id == ANONYMOUS_USER_ID) {
236 $max = $awrn_set->get(
"max_nr_entries");
238 $all_user_ids =
array();
239 $hall_user_ids =
array();
241 if ($this->
data == null) {
248 foreach ($user_collections as $uc) {
251 if (count($this->
data) >= $max) {
258 foreach ($user_ids as $uid) {
259 if (!in_array($uid, $all_user_ids)) {
260 if ($uc[
"highlighted"]) {
261 $hall_user_ids[] = $uid;
263 $all_user_ids[] = $uid;
268 include_once(
"./Services/User/classes/class.ilUserUtil.php");
282 if (isset($online_users[
$n[
"id"]])) {
283 $names[$k][
"online"] =
true;
284 $names[$k][
"last_login"] = $online_users[$n[
"id"]][
"last_login"];
287 $names[$k][
"online"] =
false;
288 $names[$k][
"last_login"] =
"";
291 if ($n[
"public_profile"]) {
292 $sort_str.= $n[
"lastname"] .
" " . $n[
"firstname"];
294 $sort_str.= $n[
"login"];
296 $names[$k][
"sort_str"] = $sort_str;
303 if (count($this->
data) >= $max) {
310 !is_int(stripos($n[
"login"],
$filter)) &&
312 !$n[
"public_profile"] || (
313 !is_int(stripos($n[
"firstname"],
$filter)) &&
314 !is_int(stripos($n[
"lastname"],
$filter))
322 $obj->lastname = $n[
"lastname"];
323 $obj->firstname = $n[
"firstname"];
324 $obj->login = $n[
"login"];
326 $obj->collector = $uc[
"uc_title"];
327 $obj->highlighted = $uc[
"highlighted"];
330 $obj->img = ilObjUser::_getPersonalPicturePath($n[
"id"],
"xsmall");
331 $obj->public_profile = $n[
"public_profile"];
333 $obj->online = $n[
"online"];
334 $obj->last_login = $n[
"last_login"];
338 $action_collection = $this->action_collector->getActionsForTargetUser($n[
"id"]);
339 $obj->actions =
array();
340 foreach ($action_collection->getActions() as
$action) {
345 $obj->actions[] = $f;
348 $this->
data[] = $obj;
353 return array(
"data" => $this->
data,
"cnt" => count($all_user_ids) .
":" . count($hall_user_ids));
setRefId($a_val)
Set ref id.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getOnlineUserData($a_ts="")
Get online user data.
static getInstance($a_user_id, ilUserActionContext $a_context)
Get instance (for a user)
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, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
Awareness context for user actions.
Create styles array
The data for the language used.
getUserCollections($a_online_only=false)
Get user collections.
__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.