ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilMailMemberSearchDataProvider.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
11 {
15  protected $type = 'crs';
19  protected $data = array();
23  protected $objParticipants = null;
24 
28  public function __construct($objParticipants)
29  {
30  $this->objParticipants = $objParticipants;
31  $this->type = $this->objParticipants->getType();
32  $this->collectTableData();
33  }
34 
38  private function collectTableData()
39  {
40  global $lng;
41 
42  $members = $this->objParticipants->getMembers();
43  $admins = $this->objParticipants->getAdmins();
44 
45  $participants['il_'.$this->type.'_member'] = $members;
46  $participants['il_'.$this->type.'_admin'] = $admins;
47  if($this->type == 'crs')
48  {
49  $tutors = $this->objParticipants->getTutors();
50  $participants['il_crs_tutor'] = $tutors;
51  }
52 
53  foreach($participants as $role => $users )
54  {
55  foreach($users as $user_id)
56  {
57  $name = ilObjUser::_lookupName($user_id);
58  $login = ilObjUser::_lookupLogin($user_id);
59  $fullname = $name['lastname'] . ', ' . $name['firstname'];
60 
61  $this->data[$fullname]['user_id'] = $user_id;
62  $this->data[$fullname]['login'] = $login;
63  $this->data[$fullname]['name'] = $fullname;
64  $this->data[$fullname]['role'] = $lng->txt($role);
65  }
66  }
67  }
68 
72  public function getData()
73  {
74  return $this->data;
75  }
76 }
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
global $lng
Definition: privfeed.php:40
Class ilMailMemberSearchDataProvider.