ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 protected $lng;
29
34 {
35 global $DIC;
36
37 $this->objParticipants = $objParticipants;
38 $this->type = $this->objParticipants->getType();
39 $this->lng = $DIC['lng'];
40
41 $this->collectTableData();
42 }
43
47 private function collectTableData()
48 {
49 $members = $this->objParticipants->getMembers();
50 $admins = $this->objParticipants->getAdmins();
51
52 $participants['il_' . $this->type . '_member'] = $members;
53 $participants['il_' . $this->type . '_admin'] = $admins;
54 if ($this->type == 'crs') {
55 $tutors = $this->objParticipants->getTutors();
56 $participants['il_crs_tutor'] = $tutors;
57 }
58
59 foreach ($participants as $role => $users) {
60 foreach ($users as $user_id) {
61 $name = ilObjUser::_lookupName($user_id);
62 $login = ilObjUser::_lookupLogin($user_id);
63
64 $publicName = '';
65 if (in_array(ilObjUser::_lookupPref($user_id, 'public_profile'), array('g', 'y'))) {
66 $publicName = $name['lastname'] . ', ' . $name['firstname'];
67 }
68
69 $this->data[$user_id]['user_id'] = $user_id;
70 $this->data[$user_id]['login'] = $login;
71 $this->data[$user_id]['name'] = $publicName;
72 $this->data[$user_id]['role'] = $this->lng->txt($role);
73 }
74 }
75 }
76
80 public function getData()
81 {
82 return $this->data;
83 }
84}
An exception for terminatinating execution or to throw for unit testing.
Class ilMailMemberSearchDataProvider.
static _lookupPref($a_usr_id, $a_keyword)
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
global $DIC