ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMailMemberSessionRoles.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Contact/classes/class.ilAbstractMailMemberRoles.php';
5 
11 {
15  protected $lng;
16 
20  protected $rbacreview;
21 
25  public function __construct()
26  {
27  global $DIC;
28 
29  $this->lng = $DIC['lng'];
30  $this->rbacreview = $DIC['rbacreview'];
31  }
32 
36  public function getRadioOptionTitle()
37  {
38  return $this->lng->txt('mail_sess_roles');
39  }
40 
45  public function getMailRoles($ref_id)
46  {
47  $role_ids = $this->rbacreview->getLocalRoles($ref_id);
48 
49  $sorted_role_ids = array();
50  $counter = 2;
51 
52  foreach ($role_ids as $role_id) {
53  $role_title = ilObject::_lookupTitle($role_id);
54  // mailbox addresses are not supported in general since title of object might be empty
55  $mailbox = $this->lng->txt('il_sess_participant') . ' <#' . $role_title . '>';
56 
57  switch (substr($role_title, 0, 12)) {
58  case 'il_sess_part':
59  $sorted_role_ids[1]['default_checked'] = true;
60  $sorted_role_ids[1]['role_id'] = $role_id;
61  $sorted_role_ids[1]['mailbox'] = $mailbox;
62  $sorted_role_ids[1]['form_option_title'] = $this->lng->txt('send_mail_participants');
63  break;
64 
65  }
66  }
67  ksort($sorted_role_ids, SORT_NUMERIC);
68 
69  return $sorted_role_ids;
70  }
71 }
global $DIC
Definition: saml.php:7
Class ilMailMemberSessionRoles.
__construct()
ilMailMemberSessionRoles constructor.
static _lookupTitle($a_id)
lookup object title
Class ilAbstractMailMemberRoles.