ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMailMemberSearchDataProvider Class Reference

Class ilMailMemberSearchDataProvider. More...

+ Collaboration diagram for ilMailMemberSearchDataProvider:

Public Member Functions

 __construct ($objParticipants)
 
 getData ()
 

Protected Attributes

 $type = 'crs'
 
 $data = array()
 
 $objParticipants = null
 
 $lng
 

Private Member Functions

 collectTableData ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailMemberSearchDataProvider::__construct (   $objParticipants)
Parameters
$objParticipants

Definition at line 33 of file class.ilMailMemberSearchDataProvider.php.

References $DIC, $objParticipants, and collectTableData().

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  }
global $DIC
+ Here is the call graph for this function:

Member Function Documentation

◆ collectTableData()

ilMailMemberSearchDataProvider::collectTableData ( )
private

Definition at line 47 of file class.ilMailMemberSearchDataProvider.php.

References ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilObjUser\_lookupPref(), array, and data.

Referenced by __construct().

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  }
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
Add some data
Create styles array
The data for the language used.
static _lookupPref($a_usr_id, $a_keyword)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getData()

ilMailMemberSearchDataProvider::getData ( )
Returns
array

Definition at line 80 of file class.ilMailMemberSearchDataProvider.php.

References $data.

Field Documentation

◆ $data

ilMailMemberSearchDataProvider::$data = array()
protected

Definition at line 19 of file class.ilMailMemberSearchDataProvider.php.

Referenced by getData().

◆ $lng

ilMailMemberSearchDataProvider::$lng
protected

Definition at line 28 of file class.ilMailMemberSearchDataProvider.php.

◆ $objParticipants

ilMailMemberSearchDataProvider::$objParticipants = null
protected

Definition at line 23 of file class.ilMailMemberSearchDataProvider.php.

Referenced by __construct().

◆ $type

ilMailMemberSearchDataProvider::$type = 'crs'
protected

Definition at line 15 of file class.ilMailMemberSearchDataProvider.php.


The documentation for this class was generated from the following file: