ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilUsersGalleryParticipants.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3require_once 'Services/User/Gallery/classes/class.ilAbstractUsersGalleryCollectionProvider.php';
4
9{
13 protected $participants;
14
18 protected $users = array();
19
24 {
25 $this->participants = $participants;
26 }
27
32 protected function getUsers(array $usr_ids)
33 {
34 $users = [];
35
36 foreach ($usr_ids as $usr_id) {
37 if (isset($this->users[$usr_id])) {
38 continue;
39 }
40
44 if (!($user = ilObjectFactory::getInstanceByObjId($usr_id, false))) {
45 continue;
46 }
47
48 if (!$user->getActive()) {
49 continue;
50 }
51
52 $users[$user->getId()] = $user;
53 $this->users[$user->getId()] = true;
54 }
55
56 return $users;
57 }
58
62 public function getGroupedCollections()
63 {
67 global $DIC;
68
69 $groups = [];
70
71 foreach ([
72 array($this->participants->getContacts(), true, $DIC->language()->txt('crs_mem_contact')),
73 array($this->participants->getAdmins() , false, ''),
74 array($this->participants->getTutors() , false, ''),
75 array($this->participants->getMembers() , false, '')
76 ] as $users) {
77 $group = $this->getPopulatedGroup($this->getUsers($users[0]));
78 $group->setHighlighted($users[1]);
79 $group->setLabel($users[2]);
80 $groups[] = $group;
81 }
82
83 return $groups;
84 }
85}
An exception for terminatinating execution or to throw for unit testing.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilUsersGalleryParticipants.
__construct(ilParticipants $participants)
$user
Definition: migrateto20.php:57
global $DIC
Definition: saml.php:7