ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilMailMemberGroupRoles Class Reference

Class ilMailMemberCourseRoles. More...

+ Inheritance diagram for ilMailMemberGroupRoles:
+ Collaboration diagram for ilMailMemberGroupRoles:

Public Member Functions

 __construct ()
 
 getRadioOptionTitle ()
 
 getMailRoles (int $ref_id)
 
- Public Member Functions inherited from ilAbstractMailMemberRoles
 getMailRoles (int $ref_id)
 
 getRadioOptionTitle ()
 
 getMailboxRoleAddress (int $role_id)
 

Protected Attributes

ilLanguage $lng
 
ilRbacReview $rbacreview
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailMemberGroupRoles::__construct ( )

Definition at line 30 of file class.ilMailMemberGroupRoles.php.

References $DIC, and ILIAS\Repository\lng().

31  {
32  global $DIC;
33 
34  $this->lng = $DIC['lng'];
35  $this->rbacreview = $DIC['rbacreview'];
36  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ getMailRoles()

ilMailMemberGroupRoles::getMailRoles ( int  $ref_id)

Definition at line 44 of file class.ilMailMemberGroupRoles.php.

References ilObject\_lookupTitle(), ilAbstractMailMemberRoles\getMailboxRoleAddress(), and ILIAS\Repository\lng().

44  : array
45  {
46  $role_ids = $this->rbacreview->getLocalRoles($ref_id);
47 
48  $sorted_role_ids = [];
49  $counter = 2;
50 
51  foreach ($role_ids as $role_id) {
52  $role_title = ilObject::_lookupTitle($role_id);
53  $mailbox = $this->getMailboxRoleAddress($role_id);
54 
55  switch (substr($role_title, 0, 8)) {
56  case 'il_grp_a':
57  $sorted_role_ids[1]['role_id'] = $role_id;
58  $sorted_role_ids[1]['mailbox'] = $mailbox;
59  $sorted_role_ids[1]['form_option_title'] = $this->lng->txt('send_mail_admins');
60  break;
61 
62  case 'il_grp_m':
63  $sorted_role_ids[0]['role_id'] = $role_id;
64  $sorted_role_ids[0]['mailbox'] = $mailbox;
65  $sorted_role_ids[0]['form_option_title'] = $this->lng->txt('send_mail_members');
66  break;
67 
68  default:
69  $sorted_role_ids[$counter]['role_id'] = $role_id;
70  $sorted_role_ids[$counter]['mailbox'] = $mailbox;
71  $sorted_role_ids[$counter]['form_option_title'] = $role_title;
72 
73  $counter++;
74  break;
75  }
76  }
77  ksort($sorted_role_ids, SORT_NUMERIC);
78 
79  return $sorted_role_ids;
80  }
$ref_id
Definition: ltiauth.php:65
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:

◆ getRadioOptionTitle()

ilMailMemberGroupRoles::getRadioOptionTitle ( )

Definition at line 39 of file class.ilMailMemberGroupRoles.php.

References ILIAS\Repository\lng().

39  : string
40  {
41  return $this->lng->txt('mail_roles');
42  }
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilMailMemberGroupRoles::$lng
protected

Definition at line 27 of file class.ilMailMemberGroupRoles.php.

◆ $rbacreview

ilRbacReview ilMailMemberGroupRoles::$rbacreview
protected

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


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