ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilSessionMailTemplateParticipantContext.php
Go to the documentation of this file.
1 <?php declare(strict_types=1);
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Mail/classes/class.ilMailTemplateContext.php';
5 
13 {
14  const ID = 'sess_context_participant_manual';
15 
19  public function getId() : string
20  {
21  return self::ID;
22  }
23 
27  public function getTitle() : string
28  {
29  global $DIC;
30 
31  $lng = $DIC['lng'];
32 
33  $lng->loadLanguageModule('sess');
34  return $lng->txt('sess_mail_context_participant_title');
35  }
36 
40  public function getDescription() : string
41  {
42  global $DIC;
43 
44  $lng = $DIC['lng'];
45  $lng->loadLanguageModule('sess');
46 
47  return $lng->txt('sess_mail_context_participant_info');
48  }
49 
54  public function getSpecificPlaceholders() : array
55  {
56  global $DIC;
57 
61  $lng = $DIC['lng'];
62 
63  $lng->loadLanguageModule('sess');
64  $lng->loadLanguageModule('crs');
65 
66  $placeholders = [];
67  $placeholders['sess_title'] = [
68  'placeholder' => 'SESS_TITLE',
69  'label' => $lng->txt('sess_title')
70  ];
71 
72  $placeholders['sess_appointment'] = [
73  'placeholder' => 'SESS_APPOINTMENT',
74  'label' => $lng->txt('event_date_time')
75  ];
76 
77 
78  $placeholders['sess_location'] = [
79  'placeholder' => 'SESS_LOCATION',
80  'label' => $lng->txt('event_location')
81  ];
82 
83  $placeholders['sess_details'] = [
84  'placeholder' => 'SESS_DETAILS',
85  'label' => $lng->txt('event_details_workflow')
86  ];
87 
88 
89  return $placeholders;
90  }
91 
95  public function resolveSpecificPlaceholder(
96  string $placeholder_id,
97  array $context_parameters,
98  ilObjUser $recipient = null,
99  bool $html_markup = false
100  ) : string {
101  global $DIC;
102 
103  $ilObjDataCache = $DIC['ilObjDataCache'];
104  $obj_id = $ilObjDataCache->lookupObjId($context_parameters['ref_id']);
105  $sess_data = ilObjSession::lookupSession($obj_id);
106  $sess_app = ilSessionAppointment::_lookupAppointment($obj_id);
107 
108 
109  switch ($placeholder_id) {
110  case 'sess_title':
111  return $ilObjDataCache->lookupTitle($obj_id);
112  case 'sess_appointment':
113  return ilSessionAppointment::_appointmentToString($sess_app['start'], $sess_app['end'], $sess_app['fullday']);
114  case 'sess_location':
115  return $sess_data['location'];
116  case 'sess_details':
117  return $sess_data['details'];
118  }
119 
120  return '';
121  }
122 }
getSpecificPlaceholders()
Return an array of placeholders.
static lookupSession($a_obj_id)
Get session data.
$lng
global $DIC
Definition: goto.php:24
static _appointmentToString($start, $end, $fulltime)
Class ilMailTemplateContext.
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ilObjUser $recipient=null, bool $html_markup=false)
{}
static _lookupAppointment($a_obj_id)
lookup appointment