ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSessionMailTemplateParticipantContext.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
29 protected ilLanguage $lng;
31
32 public const ID = 'sess_context_participant_manual';
33
34 public function __construct()
35 {
36 global $DIC;
37
39
40 $this->lng = $DIC->language();
41 $this->obj_data_cache = $DIC['ilObjDataCache'];
42 }
43
44 public function getId(): string
45 {
46 return self::ID;
47 }
48
49 public function getTitle(): string
50 {
52
53 $lng->loadLanguageModule('sess');
54 return $lng->txt('sess_mail_context_participant_title');
55 }
56
57 public function getDescription(): string
58 {
60
61 $lng->loadLanguageModule('sess');
62 return $lng->txt('sess_mail_context_participant_info');
63 }
64
65 public function getSpecificPlaceholders(): array
66 {
68
69 $lng->loadLanguageModule('sess');
71
72 $placeholders = [];
73 $placeholders['sess_title'] = [
74 'placeholder' => 'SESS_TITLE',
75 'label' => $lng->txt('sess_title')
76 ];
77
78 $placeholders['sess_appointment'] = [
79 'placeholder' => 'SESS_APPOINTMENT',
80 'label' => $lng->txt('event_date_time')
81 ];
82
83 $placeholders['sess_location'] = [
84 'placeholder' => 'SESS_LOCATION',
85 'label' => $lng->txt('event_location')
86 ];
87
88 $placeholders['sess_details'] = [
89 'placeholder' => 'SESS_DETAILS',
90 'label' => $lng->txt('event_details_workflow')
91 ];
92
93 return $placeholders;
94 }
95
97 string $placeholder_id,
98 array $context_parameters,
99 ?ilObjUser $recipient = null
100 ): string {
101 $ilObjDataCache = $this->obj_data_cache;
102 $obj_id = $ilObjDataCache->lookupObjId((int) $context_parameters['ref_id']);
103 $sess_data = ilObjSession::lookupSession($obj_id);
104 $sess_app = ilSessionAppointment::_lookupAppointment($obj_id);
105
106 switch ($placeholder_id) {
107 case 'sess_title':
108 return $ilObjDataCache->lookupTitle($obj_id);
109 case 'sess_appointment':
110 return ilSessionAppointment::_appointmentToString($sess_app['start'], $sess_app['end'], (bool) $sess_app['fullday']);
111 case 'sess_location':
112 return $sess_data['location'];
113 case 'sess_details':
114 return $sess_data['details'];
115 }
116
117 return '';
118 }
119}
language handling
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static lookupSession(int $a_obj_id)
User class.
class ilObjectDataCache
static _lookupAppointment(int $a_obj_id)
static _appointmentToString(int $start, int $end, bool $fulltime)
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ?ilObjUser $recipient=null)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26