ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailMemberCourseRoles Class Reference

Class ilMailMemberCourseRoles. More...

+ Inheritance diagram for ilMailMemberCourseRoles:
+ Collaboration diagram for ilMailMemberCourseRoles:

Public Member Functions

 __construct ()
 ilMailMemberCourseRoles constructor. More...
 
 getRadioOptionTitle ()
 
 getMailRoles ($ref_id)
 
- Public Member Functions inherited from ilAbstractMailMemberRoles
 getMailRoles ($ref_id)
 
 getRadioOptionTitle ()
 
 getMailboxRoleAddress ($role_id)
 

Protected Attributes

 $lng
 
 $rbacreview
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailMemberCourseRoles::__construct ( )

ilMailMemberCourseRoles constructor.

Definition at line 25 of file class.ilMailMemberCourseRoles.php.

References $DIC.

26  {
27  global $DIC;
28 
29  $this->lng = $DIC['lng'];
30  $this->rbacreview = $DIC['rbacreview'];
31  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ getMailRoles()

ilMailMemberCourseRoles::getMailRoles (   $ref_id)
Parameters
$ref_id
Returns
array sorted_roles

Definition at line 45 of file class.ilMailMemberCourseRoles.php.

References $counter, ilObject\_lookupTitle(), array, and ilAbstractMailMemberRoles\getMailboxRoleAddress().

46  {
47  $role_ids = $this->rbacreview->getLocalRoles($ref_id);
48 
49  // Sort by relevance
50  $sorted_role_ids = array();
51  $counter = 3;
52 
53  foreach ($role_ids as $role_id) {
54  $role_title = ilObject::_lookupTitle($role_id);
55  $mailbox = $this->getMailboxRoleAddress($role_id);
56 
57  switch (substr($role_title, 0, 8)) {
58  case 'il_crs_a':
59  $sorted_role_ids[2]['role_id'] = $role_id;
60  $sorted_role_ids[2]['mailbox'] = $mailbox;
61  $sorted_role_ids[2]['form_option_title'] = $this->lng->txt('send_mail_admins');
62  break;
63 
64  case 'il_crs_t':
65  $sorted_role_ids[1]['role_id'] = $role_id;
66  $sorted_role_ids[1]['mailbox'] = $mailbox;
67  $sorted_role_ids[1]['form_option_title'] = $this->lng->txt('send_mail_tutors');
68  break;
69 
70  case 'il_crs_m':
71  $sorted_role_ids[0]['role_id'] = $role_id;
72  $sorted_role_ids[0]['mailbox'] = $mailbox;
73  $sorted_role_ids[0]['form_option_title'] = $this->lng->txt('send_mail_members');
74  break;
75 
76  default:
77  $sorted_role_ids[$counter]['role_id'] = $role_id;
78  $sorted_role_ids[$counter]['mailbox'] = $mailbox;
79  $sorted_role_ids[$counter]['form_option_title'] = $role_title;
80 
81  $counter++;
82  break;
83  }
84  }
85  ksort($sorted_role_ids, SORT_NUMERIC);
86 
87  return $sorted_role_ids;
88  }
static _lookupTitle($a_id)
lookup object title
$counter
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getRadioOptionTitle()

ilMailMemberCourseRoles::getRadioOptionTitle ( )
Returns
string

Definition at line 36 of file class.ilMailMemberCourseRoles.php.

37  {
38  return $this->lng->txt('mail_crs_roles');
39  }

Field Documentation

◆ $lng

ilMailMemberCourseRoles::$lng
protected

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

◆ $rbacreview

ilMailMemberCourseRoles::$rbacreview
protected

Definition at line 20 of file class.ilMailMemberCourseRoles.php.


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