ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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/classes/class.ilAbstractGalleryUsers.php';
4
9{
13 protected $participants;
14
18 protected $users = array();
19
24 {
25 $this->participants = $participants;
26 }
27
32 protected function getSortedUsers(array $users)
33 {
34 $participants_data = array();
35 foreach($users as $users_id)
36 {
37 if(isset($this->users[$users_id]))
38 {
39 continue;
40 }
41
45 if(!($user = ilObjectFactory::getInstanceByObjId($users_id, false)))
46 {
47 continue;
48 }
49
50 if(!$user->getActive())
51 {
52 continue;
53 }
54
55 $participants_data[$user->getId()] = array(
56 'id' => $user->getId(),
57 'user' => $user
58 );
59 $this->users[$user->getId()] = true;
60 }
61 $participants_data = $this->collectUserDetails($participants_data);
62 $participants_data = ilUtil::sortArray($participants_data, 'sort', 'asc');
63 return $participants_data;
64 }
65
69 public function getGalleryUsers()
70 {
71 $ordered_user = $this->getSortedUsers($this->participants->getAdmins());
72 $ordered_user = array_merge($ordered_user, $this->getSortedUsers($this->participants->getTutors()));
73 $ordered_user = array_merge($ordered_user, $this->getSortedUsers($this->participants->getMembers()));
74 return $ordered_user;
75 }
76
80 public function getUserCssClass()
81 {
82 return '';
83 }
84}
Class ilAbstractGalleryUsers.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilUsersGalleryParticipants.
__construct(ilParticipants $participants)
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray